From: Roy Marples Date: Thu, 8 Oct 2009 20:21:23 +0000 (+0000) Subject: Improve import so it's more generic. X-Git-Tag: v5.1.2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26fbb9ed3d5dc7f4086416b28b0b534accb029b4;p=thirdparty%2Fdhcpcd.git Improve import so it's more generic. --- diff --git a/Makefile b/Makefile index 5a5d17d2..150acf51 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ CSTD?= c99 CFLAGS+= -std=${CSTD} include config.mk -OBJS+= ${SRCS:.c=.o} +OBJS+= ${SRCS:.c=.o} ${COMPAT_SRCS:.c=.o} SCRIPT= ${LIBEXECDIR}/dhcpcd-run-hooks HOOKDIR= ${LIBEXECDIR}/dhcpcd-hooks @@ -62,8 +62,8 @@ all: ${PROG} ${SCRIPTS} ${MAN5} ${MAN8} .c.o: ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@ -.depend: ${SRCS} - ${CC} ${CPPFLAGS} -MM ${SRCS} > .depend +.depend: ${SRCS} ${COMPAT_SRCS} + ${CC} ${CPPFLAGS} -MM ${SRCS} ${COMPAT_SRCS} > .depend depend: .depend @@ -99,16 +99,22 @@ clean: dist: git archive --prefix=${DISTPREFIX}/ ${GITREF} | bzip2 > ${DISTFILE} -import-bsd: +import: rm -rf /tmp/${DISTPREFIX} ${INSTALL} -d /tmp/${DISTPREFIX} - cp ${SRCS} *.in /tmp/${DISTPREFIX} + cp ${SRCS} dhcpcd.conf *.in /tmp/${DISTPREFIX} cp $$(${CC} ${CPPFLAGS} -MM ${SRCS} | \ sed -e 's/^.*c //g' -e 's/\\//g' | \ tr ' ' '\n' | \ sort -u) /tmp/${DISTPREFIX} + if test -n "${COMPAT_SRCS}"; then \ + ${INSTALL} -d /tmp/${DISTPREFIX}/compat; \ + cp ${COMPAT_SRCS} /tmp/${DISTPREFIX}/compat; \ + cp $$(${CC} ${CPPFLAGS} -MM ${COMPAT_SRCS} | \ + sed -e 's/^.*c //g' -e 's/\\//g' | \ + tr ' ' '\n' | \ + sort -u) /tmp/${DISTPREFIX}/compat; \ + fi; cd dhcpcd-hooks; ${MAKE} DISTPREFIX=${DISTPREFIX} $@ -import: import-bsd - include Makefile.inc diff --git a/configure b/configure index 590eb1b2..5430bf29 100755 --- a/configure +++ b/configure @@ -205,7 +205,7 @@ if $XCC _arc4random.c -o _arc4random 2>/dev/null; then echo "yes" else echo "no" - echo "SRCS+= compat/arc4random.c" >>$CONFIG_MK + echo "COMPAT_SRCS+= compat/arc4random.c" >>$CONFIG_MK echo "#include \"compat/arc4random.h\"" >>$CONFIG_H fi rm -f _arc4random.c _arc4random @@ -222,7 +222,7 @@ if $XCC _closefrom.c -o _closefrom 2>/dev/null; then echo "yes" else echo "no" - echo "SRCS+= compat/closefrom.c" >>$CONFIG_MK + echo "COMPAT_SRCS+= compat/closefrom.c" >>$CONFIG_MK echo "#include \"compat/closefrom.h\"" >>$CONFIG_H fi rm -f _closefrom.c _closefrom @@ -242,7 +242,7 @@ if $XCC _getline.c -o _getline 2>/dev/null; then echo "yes" else echo "no" - echo "SRCS+= compat/getline.c" >>$CONFIG_MK + echo "COMPAT_SRCS+= compat/getline.c" >>$CONFIG_MK echo "#include \"compat/getline.h\"" >>$CONFIG_H fi rm -f _getline.c _getline @@ -261,7 +261,7 @@ if $XCC _strlcpy.c -o _strlcpy 2>/dev/null; then echo "yes" else echo "no" - echo "SRCS+= compat/strlcpy.c" >>$CONFIG_MK + echo "COMPAT_SRCS+= compat/strlcpy.c" >>$CONFIG_MK echo "#include \"compat/strlcpy.h\"" >>$CONFIG_H fi rm -f _strlcpy.c _strlcpy diff --git a/dhcpcd-hooks/Makefile b/dhcpcd-hooks/Makefile index 4a48a306..fc6a3171 100644 --- a/dhcpcd-hooks/Makefile +++ b/dhcpcd-hooks/Makefile @@ -12,6 +12,6 @@ install: ${INSTALL} -d ${DESTDIR}${SCRIPTSDIR} ${INSTALL} -m ${NONBINMODE} ${SCRIPTS} ${DESTDIR}${SCRIPTSDIR} -import-bsd: +import: ${INSTALL} -d /tmp/${DISTPREFIX}/dhcpcd-hooks cp ${SCRIPTS} 50-ntp.conf /tmp/${DISTPREFIX}/dhcpcd-hooks