]> granicus.if.org Git - neomutt/commitdiff
build: fix deps and out-of-tree build
authorRichard Russon <rich@flatcap.org>
Wed, 25 Jul 2018 08:40:34 +0000 (09:40 +0100)
committerRichard Russon <rich@flatcap.org>
Wed, 25 Jul 2018 08:40:34 +0000 (09:40 +0100)
Makefile.autosetup
test/Makefile.autosetup

index b7daccc78214d6d5eaf9ad46071d29a84c7a7895..f6005f0aeb2c93a24e211a3b91da694026bf745e 100644 (file)
@@ -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
index 98deccb5a3124d12aa46baf1ad7ec29125233c08..edfea2bc4db2bee8efe9b39c58d55074d689f76b 100644 (file)
@@ -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: