]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix dependency and test targets
authorRoy Marples <roy@marples.name>
Thu, 31 Jul 2014 00:57:47 +0000 (00:57 +0000)
committerRoy Marples <roy@marples.name>
Thu, 31 Jul 2014 00:57:47 +0000 (00:57 +0000)
GNUmakefile
Makefile
test/GNUmakefile
test/Makefile

index e06fb447d3a414eb56ea3a908d9c767bf81c54cf..55652948827fd49f22a1f4fd36bc23344423be37 100644 (file)
@@ -7,4 +7,6 @@ CONFIG_MK?=     $(shell test -e ${TOP}/config.mk && \
                    echo config.mk || echo config-null.mk)
 
 include Makefile
--include .depend
+ifneq ($(wildcard .depend), )
+include .depend
+endif
index 6d3730caf5ceacae19b22f16997f27f2cd43ca59..ac637b0cc88b6efffeaf9e7de21501f693f85846 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -32,7 +32,6 @@ CLEANFILES=   dhcpcd.conf.5 dhcpcd.8 dhcpcd-run-hooks.8
 SCRIPTS=       dhcpcd-run-hooks
 SCRIPTSDIR=    ${LIBEXECDIR}
 CLEANFILES+=   dhcpcd-run-hooks
-CLEANFILES+=   .depend
 
 FILES=         dhcpcd.conf
 FILESDIR=      ${SYSCONFDIR}
@@ -91,8 +90,8 @@ dhcpcd-embedded.c: genembedc dhcpcd-definitions.conf
 
 if-options.c: dhcpcd-embedded.h
 
-.depend: ${SRCS} ${COMPAT_SRCS}
-       ${CC} ${CPPFLAGS} -MM ${SRCS} ${COMPAT_SRCS} > .depend
+.depend: ${SRCS} ${COMPAT_SRCS} ${CRYPT_SRCS}
+       ${CC} ${CPPFLAGS} -MM ${SRCS} ${COMPAT_SRCS} ${CRYPT_SRCS} > .depend
 
 depend: .depend
 
index 1f97d8c4f8d8b4294069d398e40e9466286144b6..2e838d5e7283dde04ac494ed10c02fc05fd680e5 100644 (file)
@@ -1,2 +1,7 @@
-TOP?=  ..
-include ${TOP}/GNUmakefile
+# GNU Make does not automagically include .depend
+# Luckily it does read GNUmakefile over Makefile so we can work around it
+
+include Makefile
+ifneq ($(wildcard .depend), )
+include .depend
+endif
index 186e9c84f43c988947423b99453edd90e3319d00..e29a7cd77b2d3842b9e3548a6f4061461fa0aef5 100644 (file)
@@ -3,7 +3,7 @@ include ${TOP}/iconfig.mk
 
 PROG=          test
 SRCS=          test.c
-SRCS+=         test_hmac_md5.c hmac_md5.c ${MD5_SRC}
+SRCS+=         test_hmac_md5.c ../crypt/hmac_md5.c
 
 CFLAGS?=       -O2
 CSTD?=         c99
@@ -11,11 +11,9 @@ CFLAGS+=     -std=${CSTD}
 
 CPPFLAGS+=     -I../crypt
 
-.PATH:         ../crypt
-
-VPATH=         . ../crypt
-
-OBJS+=         ${SRCS:.c=.o}
+T_COMPAT_SRCS= ${COMPAT_SRCS:compat/%=../compat/%}
+T_MD5_SRC=     ${MD5_SRC:crypt/%=../crypt/%}
+OBJS+=         ${SRCS:.c=.o} ${T_COMPAT_SRCS:.c=.o} ${T_MD5_SRC:.c=.o}
 
 .c.o:
        ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
@@ -25,8 +23,11 @@ all: ${PROG}
 clean:
        rm -f ${OBJS} ${PROG} ${PROG}.core ${CLEANFILES}
 
-.depend: ${SRCS} ${COMPAT_SRCS}
-       ${CC} ${CPPFLAGS} -MM ${SRCS} ${COMPAT_SRCS} > .depend
+distclean: clean
+       rm -f .depend
+
+.depend: ${SRCS} ${T_COMPAT_SRCS} ${T_CRYPT_SRCS}
+       ${CC} ${CPPFLAGS} -MM ${SRCS} ${T_COMPAT_SRCS} ${T_CRYPT_SRCS} > .depend
 
 depend: .depend