From: Richard Russon Date: Wed, 25 Jul 2018 08:40:34 +0000 (+0100) Subject: build: fix deps and out-of-tree build X-Git-Tag: 2019-10-25~733 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cc3e682825d29f38ceffbc37f16443ed3981e410;p=neomutt build: fix deps and out-of-tree build --- diff --git a/Makefile.autosetup b/Makefile.autosetup index b7daccc78..f6005f0ae 100644 --- a/Makefile.autosetup +++ b/Makefile.autosetup @@ -86,18 +86,6 @@ NEOMUTTOBJS+= mutt_lua.o CLEANFILES+= $(NEOMUTT) $(NEOMUTTOBJS) ALLOBJS+= $(NEOMUTTOBJS) -############################################################################### -# libemail -LIBEMAIL= libemail.a -LIBEMAILOBJS= email/address.o email/attach.o email/body.o \ - email/email_globals.o email/envelope.o email/from.o \ - email/header.o email/idna.o email/mime.o email/parameter.o \ - email/parse.o email/rfc2047.o email/rfc2231.o email/tags.o \ - email/thread.o email/url.o -CLEANFILES+= $(LIBEMAIL) $(LIBEMAILOBJS) -MUTTLIBS+= $(LIBEMAIL) -ALLOBJS+= $(LIBEMAILOBJS) - ############################################################################### # libpop LIBPOP= libpop.a @@ -140,18 +128,6 @@ CLEANFILES+= $(LIBMAILDIR) $(LIBMAILDIROBJS) MUTTLIBS+= $(LIBMAILDIR) ALLOBJS+= $(LIBMAILDIROBJS) -############################################################################### -# libmutt -LIBMUTT= libmutt.a -LIBMUTTOBJS= mutt/base64.o mutt/buffer.o mutt/charset.o mutt/date.o \ - mutt/envlist.o mutt/exit.o mutt/file.o mutt/hash.o \ - mutt/history.o mutt/list.o mutt/logging.o mutt/mapping.o \ - mutt/mbyte.o mutt/md5.o mutt/memory.o mutt/regex.o mutt/sha1.o \ - mutt/signal.o mutt/string.o -CLEANFILES+= $(LIBMUTT) $(LIBMUTTOBJS) -MUTTLIBS+= $(LIBMUTT) -ALLOBJS+= $(LIBMUTTOBJS) - ############################################################################### # libncrypt LIBNCRYPT= libncrypt.a @@ -207,18 +183,6 @@ CLEANFILES+= $(LIBCONN) $(LIBCONNOBJS) MUTTLIBS+= $(LIBCONN) ALLOBJS+= $(LIBCONNOBJS) -############################################################################### -# libconfig -LIBCONFIG= libconfig.a -LIBCONFIGOBJS= config/address.o config/bool.o config/command.o config/dump.o \ - config/long.o config/magic.o config/mbtable.o config/number.o \ - config/path.o config/quad.o config/regex.o config/set.o \ - config/sort.o config/string.o - -CLEANFILES+= $(LIBCONFIG) $(LIBCONFIGOBJS) -MUTTLIBS+= $(LIBCONFIG) -ALLOBJS+= $(LIBCONFIGOBJS) - ############################################################################### # libhcache @if USE_HCACHE @@ -254,6 +218,42 @@ PGPEWRAPOBJS= pgpewrap.o CLEANFILES+= $(PGPEWRAP) $(PGPEWRAPOBJS) ALLOBJS+= $(PGPEWRAPOBJS) +############################################################################### +# libconfig +LIBCONFIG= libconfig.a +LIBCONFIGOBJS= config/address.o config/bool.o config/command.o config/dump.o \ + config/long.o config/magic.o config/mbtable.o config/number.o \ + config/path.o config/quad.o config/regex.o config/set.o \ + config/sort.o config/string.o + +CLEANFILES+= $(LIBCONFIG) $(LIBCONFIGOBJS) +MUTTLIBS+= $(LIBCONFIG) +ALLOBJS+= $(LIBCONFIGOBJS) + +############################################################################### +# libemail +LIBEMAIL= libemail.a +LIBEMAILOBJS= email/address.o email/attach.o email/body.o \ + email/email_globals.o email/envelope.o email/from.o \ + email/header.o email/idna.o email/mime.o email/parameter.o \ + email/parse.o email/rfc2047.o email/rfc2231.o email/tags.o \ + email/thread.o email/url.o +CLEANFILES+= $(LIBEMAIL) $(LIBEMAILOBJS) +MUTTLIBS+= $(LIBEMAIL) +ALLOBJS+= $(LIBEMAILOBJS) + +############################################################################### +# libmutt +LIBMUTT= libmutt.a +LIBMUTTOBJS= mutt/base64.o mutt/buffer.o mutt/charset.o mutt/date.o \ + mutt/envlist.o mutt/exit.o mutt/file.o mutt/hash.o \ + mutt/history.o mutt/list.o mutt/logging.o mutt/mapping.o \ + mutt/mbyte.o mutt/md5.o mutt/memory.o mutt/regex.o mutt/sha1.o \ + mutt/signal.o mutt/string.o +CLEANFILES+= $(LIBMUTT) $(LIBMUTTOBJS) +MUTTLIBS+= $(LIBMUTT) +ALLOBJS+= $(LIBMUTTOBJS) + ############################################################################### # generated GENERATED= git_ver.h hcache/hcversion.h diff --git a/test/Makefile.autosetup b/test/Makefile.autosetup index 98deccb5a..edfea2bc4 100644 --- a/test/Makefile.autosetup +++ b/test/Makefile.autosetup @@ -16,7 +16,7 @@ CONFIG_OBJS = test/config/main.o test/config/account.o \ test/config/set.o test/config/sort.o test/config/string.o \ test/config/synonym.o -CFLAGS += -Itest +CFLAGS += -I$(SRCDIR)/test TEST_BINARY = test/neomutt-test$(EXEEXT) @@ -27,7 +27,7 @@ test: $(TEST_BINARY) $(TEST_CONFIG) $(TEST_BINARY) @for i in set account initial synonym address bool command long magic mbtable number path quad regex sort string; do \ $(TEST_CONFIG) $$i > test/config/$$i.txt.tmp; \ - if cmp -s test/config/$$i.txt test/config/$$i.txt.tmp; then \ + if cmp -s $(SRCDIR)/test/config/$$i.txt test/config/$$i.txt.tmp; then \ echo "Config test: '$$i' passed"; \ rm -f test/config/$$i.txt.tmp; \ else \ @@ -38,13 +38,16 @@ test: $(TEST_BINARY) $(TEST_CONFIG) $(TEST_BINARY): $(TEST_OBJS) $(MUTTLIBS) $(CC) -o $@ $(TEST_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS) -$(TEST_CONFIG): $(CONFIG_OBJS) $(MUTT_LIBS) - $(CC) -o $@ $(CONFIG_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS) libemail.a libmutt.a +$(TEST_CONFIG): $(PWD)/test/config/dump $(CONFIG_OBJS) $(MUTTLIBS) + $(CC) -o $@ $(CONFIG_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS) + +$(PWD)/test/config/dump: + $(MKDIR_P) $(PWD)/test/config/dump all-test: $(TEST_BINARY) $(TEST_CONFIG) clean-test: - $(RM) $(TEST_BINARY) $(TEST_OBJS) $(TEST_OBJS:.o=.Po) + $(RM) $(TEST_BINARY) $(TEST_OBJS) $(TEST_OBJS:.o=.Po) $(TEST_CONFIG) $(CONFIG_OBJS) $(CONFIG_OBJS:.o=.Po) install-test: uninstall-test: