diff --git a/Makefile.am b/Makefile.am index b6eee7e..d347e9b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,44 +1,2 @@ -AM_CFLAGS = -Wall -Wextra --std=gnu99 - -bin_PROGRAMS = sbsign sbverify sbattach sbvarsign sbsiglist - -coff_headers = coff/external.h coff/pe.h - -common_SOURCES = idc.c idc.h image.c image.h fileio.c fileio.h \ - efivars.h $(coff_headers) -common_LDADD = lib/ccan/libccan.a $(libcrypto_LIBS) -common_CFLAGS = -I$(srcdir)/lib/ccan/ - -sbsign_SOURCES = sbsign.c $(common_SOURCES) -sbsign_LDADD = $(common_LDADD) -sbsign_CFLAGS = $(AM_CFLAGS) $(common_CFLAGS) - -sbverify_SOURCES = sbverify.c $(common_SOURCES) -sbverify_LDADD = $(common_LDADD) -sbverify_CFLAGS = $(AM_CFLAGS) $(common_CFLAGS) - -sbattach_SOURCES = sbattach.c $(common_SOURCES) -sbattach_LDADD = $(common_LDADD) -sbattach_CFLAGS = $(AM_CFLAGS) $(common_CFLAGS) - -sbvarsign_SOURCES = sbvarsign.c $(common_SOURCES) -sbvarsign_LDADD = $(common_LDADD) $(uuid_LIBS) -sbvarsign_CPPFLAGS = $(EFI_CPPFLAGS) -sbvarsign_CFLAGS = $(AM_CFLAGS) $(uuid_CFLAGS) $(common_CFLAGS) - -sbsiglist_SOURCES = sbsiglist.c $(common_SOURCES) -sbsiglist_LDADD = $(common_LDADD) $(uuid_LIBS) -sbsiglist_CPPFLAGS = $(EFI_CPPFLAGS) -sbsiglist_CFLAGS = $(AM_CFLAGS) $(common_CFLAGS) - -man1_MANS = docs/sbsign.1 docs/sbverify.1 docs/sbattach.1 - -EXTRA_DIST = docs/sbsign.1.in docs/sbverify.1.in docs/sbattach.1.in -CLEANFILES = $(man1_MANS) - -$(top_builddir)/docs/%.1: $(srcdir)/docs/%.1.in $(top_builddir)/% - $(MKDIR_P) $(@D) - $(HELP2MAN) --no-info -i $< -o $@ $(top_builddir)/$* - -SUBDIRS = lib/ccan . tests +SUBDIRS = lib/ccan src docs tests diff --git a/configure.ac b/configure.ac index 0a7f2db..6ca60d3 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ AM_INIT_AUTOMAKE() AC_PREREQ(2.60) AC_CONFIG_HEADERS(config.h) -AC_CONFIG_SRCDIR(sbsign.c) +AC_CONFIG_SRCDIR(src/sbsign.c) AM_PROG_AS AC_PROG_CC @@ -73,5 +73,6 @@ AC_CHECK_HEADERS([efi.h], [], [], $EFI_INCLUDES) CPPFLAGS="$CPPFLAGS_save" AC_SUBST(EFI_CPPFLAGS, $EFI_CPPFLAGS) -AC_CONFIG_FILES([Makefile lib/ccan/Makefile tests/Makefile]) +AC_CONFIG_FILES([Makefile src/Makefile lib/ccan/Makefile] + [docs/Makefile tests/Makefile]) AC_OUTPUT diff --git a/docs/Makefile.am b/docs/Makefile.am new file mode 100644 index 0000000..f6207f2 --- /dev/null +++ b/docs/Makefile.am @@ -0,0 +1,10 @@ + +man1_MANS = sbsign.1 sbverify.1 sbattach.1 + +EXTRA_DIST = sbsign.1.in sbverify.1.in sbattach.1.in +CLEANFILES = $(man1_MANS) + +$(builddir)/%.1: $(srcdir)/%.1.in $(top_builddir)/src/% + $(MKDIR_P) $(@D) + $(HELP2MAN) --no-info -i $< -o $@ $(top_builddir)/src/$* + diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..da7a6b9 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,32 @@ + +bin_PROGRAMS = sbsign sbverify sbattach sbvarsign sbsiglist + +coff_headers = coff/external.h coff/pe.h +AM_CFLAGS = -Wall -Wextra --std=gnu99 + +common_SOURCES = idc.c idc.h image.c image.h fileio.c fileio.h \ + efivars.h $(coff_headers) +common_LDADD = ../lib/ccan/libccan.a $(libcrypto_LIBS) +common_CFLAGS = -I$(top_srcdir)/lib/ccan/ + +sbsign_SOURCES = sbsign.c $(common_SOURCES) +sbsign_LDADD = $(common_LDADD) +sbsign_CFLAGS = $(AM_CFLAGS) $(common_CFLAGS) + +sbverify_SOURCES = sbverify.c $(common_SOURCES) +sbverify_LDADD = $(common_LDADD) +sbverify_CFLAGS = $(AM_CFLAGS) $(common_CFLAGS) + +sbattach_SOURCES = sbattach.c $(common_SOURCES) +sbattach_LDADD = $(common_LDADD) +sbattach_CFLAGS = $(AM_CFLAGS) $(common_CFLAGS) + +sbvarsign_SOURCES = sbvarsign.c $(common_SOURCES) +sbvarsign_LDADD = $(common_LDADD) $(uuid_LIBS) +sbvarsign_CPPFLAGS = $(EFI_CPPFLAGS) +sbvarsign_CFLAGS = $(AM_CFLAGS) $(uuid_CFLAGS) $(common_CFLAGS) + +sbsiglist_SOURCES = sbsiglist.c $(common_SOURCES) +sbsiglist_LDADD = $(common_LDADD) $(uuid_LIBS) +sbsiglist_CPPFLAGS = $(EFI_CPPFLAGS) +sbsiglist_CFLAGS = $(AM_CFLAGS) $(common_CFLAGS) diff --git a/coff/external.h b/src/coff/external.h similarity index 100% rename from coff/external.h rename to src/coff/external.h diff --git a/coff/pe.h b/src/coff/pe.h similarity index 100% rename from coff/pe.h rename to src/coff/pe.h diff --git a/efivars.h b/src/efivars.h similarity index 100% rename from efivars.h rename to src/efivars.h diff --git a/fileio.c b/src/fileio.c similarity index 100% rename from fileio.c rename to src/fileio.c diff --git a/fileio.h b/src/fileio.h similarity index 100% rename from fileio.h rename to src/fileio.h diff --git a/gen-keyfiles.c b/src/gen-keyfiles.c similarity index 100% rename from gen-keyfiles.c rename to src/gen-keyfiles.c diff --git a/idc.c b/src/idc.c similarity index 100% rename from idc.c rename to src/idc.c diff --git a/idc.h b/src/idc.h similarity index 100% rename from idc.h rename to src/idc.h diff --git a/image.c b/src/image.c similarity index 100% rename from image.c rename to src/image.c diff --git a/image.h b/src/image.h similarity index 100% rename from image.h rename to src/image.h diff --git a/libcoff.h b/src/libcoff.h similarity index 100% rename from libcoff.h rename to src/libcoff.h diff --git a/sbattach.c b/src/sbattach.c similarity index 100% rename from sbattach.c rename to src/sbattach.c diff --git a/sbsiglist.c b/src/sbsiglist.c similarity index 100% rename from sbsiglist.c rename to src/sbsiglist.c diff --git a/sbsign.c b/src/sbsign.c similarity index 100% rename from sbsign.c rename to src/sbsign.c diff --git a/sbvarsign.c b/src/sbvarsign.c similarity index 100% rename from sbvarsign.c rename to src/sbvarsign.c diff --git a/sbverify.c b/src/sbverify.c similarity index 100% rename from sbverify.c rename to src/sbverify.c diff --git a/verify.c b/src/verify.c similarity index 100% rename from verify.c rename to src/verify.c diff --git a/tests/test-wrapper.sh b/tests/test-wrapper.sh index bccd05a..d8d78e2 100755 --- a/tests/test-wrapper.sh +++ b/tests/test-wrapper.sh @@ -3,7 +3,7 @@ # set a few global variables that may be used by the test basedir=$(cd $srcdir && pwd) datadir=$(pwd) -bindir="$datadir/.." +bindir="$datadir/../src" sbsign=$bindir/sbsign sbverify=$bindir/sbverify