]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Move the source files along with dev, crypt and comapt into src dir.
authorRoy Marples <roy@marples.name>
Wed, 15 Mar 2017 22:06:12 +0000 (22:06 +0000)
committerRoy Marples <roy@marples.name>
Wed, 15 Mar 2017 22:06:12 +0000 (22:06 +0000)
This makes the toplevel directory more manageable.

94 files changed:
.gitignore
Makefile
dhcpcd-hooks/GNUmakefile [deleted file]
dhcpcd-hooks/Makefile
src/GNUmakefile [moved from GNUmakefile with 97% similarity]
src/Makefile [new file with mode: 0644]
src/arp.c [moved from arp.c with 100% similarity]
src/arp.h [moved from arp.h with 100% similarity]
src/auth.c [moved from auth.c with 100% similarity]
src/auth.h [moved from auth.h with 100% similarity]
src/bpf.c [moved from bpf.c with 100% similarity]
src/bpf.h [moved from bpf.h with 100% similarity]
src/common.c [moved from common.c with 100% similarity]
src/common.h [moved from common.h with 100% similarity]
src/compat/arc4random.c [moved from compat/arc4random.c with 100% similarity]
src/compat/arc4random.h [moved from compat/arc4random.h with 100% similarity]
src/compat/arc4random_uniform.c [moved from compat/arc4random_uniform.c with 100% similarity]
src/compat/arc4random_uniform.h [moved from compat/arc4random_uniform.h with 100% similarity]
src/compat/bitops.h [moved from compat/bitops.h with 100% similarity]
src/compat/dprintf.c [moved from compat/dprintf.c with 100% similarity]
src/compat/dprintf.h [moved from compat/dprintf.h with 100% similarity]
src/compat/endian.h [moved from compat/endian.h with 100% similarity]
src/compat/getline.c [moved from compat/getline.c with 100% similarity]
src/compat/getline.h [moved from compat/getline.h with 100% similarity]
src/compat/pidfile.c [moved from compat/pidfile.c with 100% similarity]
src/compat/pidfile.h [moved from compat/pidfile.h with 100% similarity]
src/compat/posix_spawn.c [moved from compat/posix_spawn.c with 100% similarity]
src/compat/posix_spawn.h [moved from compat/posix_spawn.h with 100% similarity]
src/compat/queue.h [moved from compat/queue.h with 100% similarity]
src/compat/reallocarray.c [moved from compat/reallocarray.c with 100% similarity]
src/compat/reallocarray.h [moved from compat/reallocarray.h with 100% similarity]
src/compat/strlcpy.c [moved from compat/strlcpy.c with 100% similarity]
src/compat/strlcpy.h [moved from compat/strlcpy.h with 100% similarity]
src/compat/strtoi.c [moved from compat/strtoi.c with 100% similarity]
src/compat/strtoi.h [moved from compat/strtoi.h with 100% similarity]
src/control.c [moved from control.c with 100% similarity]
src/control.h [moved from control.h with 100% similarity]
src/crypt/crypt.h [moved from crypt/crypt.h with 100% similarity]
src/crypt/hmac_md5.c [moved from crypt/hmac_md5.c with 100% similarity]
src/crypt/md5.c [moved from crypt/md5.c with 100% similarity]
src/crypt/md5.h [moved from crypt/md5.h with 100% similarity]
src/crypt/sha256.c [moved from crypt/sha256.c with 100% similarity]
src/crypt/sha256.h [moved from crypt/sha256.h with 100% similarity]
src/defs.h [moved from defs.h with 100% similarity]
src/dev.c [moved from dev.c with 100% similarity]
src/dev.h [moved from dev.h with 100% similarity]
src/dev/Makefile [moved from dev/Makefile with 94% similarity]
src/dev/udev.c [moved from dev/udev.c with 100% similarity]
src/dhcp-common.c [moved from dhcp-common.c with 100% similarity]
src/dhcp-common.h [moved from dhcp-common.h with 100% similarity]
src/dhcp.c [moved from dhcp.c with 100% similarity]
src/dhcp.h [moved from dhcp.h with 100% similarity]
src/dhcp6.c [moved from dhcp6.c with 100% similarity]
src/dhcp6.h [moved from dhcp6.h with 100% similarity]
src/dhcpcd-definitions-small.conf [moved from dhcpcd-definitions-small.conf with 100% similarity]
src/dhcpcd-definitions.conf [moved from dhcpcd-definitions.conf with 100% similarity]
src/dhcpcd-embedded.c.in [moved from dhcpcd-embedded.c.in with 100% similarity]
src/dhcpcd-embedded.h.in [moved from dhcpcd-embedded.h.in with 100% similarity]
src/dhcpcd-run-hooks.8.in [moved from dhcpcd-run-hooks.8.in with 100% similarity]
src/dhcpcd-run-hooks.in [moved from dhcpcd-run-hooks.in with 100% similarity]
src/dhcpcd.8.in [moved from dhcpcd.8.in with 100% similarity]
src/dhcpcd.c [moved from dhcpcd.c with 100% similarity]
src/dhcpcd.conf [moved from dhcpcd.conf with 100% similarity]
src/dhcpcd.conf.5.in [moved from dhcpcd.conf.5.in with 100% similarity]
src/dhcpcd.h [moved from dhcpcd.h with 100% similarity]
src/duid.c [moved from duid.c with 100% similarity]
src/duid.h [moved from duid.h with 100% similarity]
src/eloop.c [moved from eloop.c with 100% similarity]
src/eloop.h [moved from eloop.h with 100% similarity]
src/genembedc [moved from genembedc with 100% similarity]
src/genembedh [moved from genembedh with 100% similarity]
src/if-bsd.c [moved from if-bsd.c with 100% similarity]
src/if-linux-wext.c [moved from if-linux-wext.c with 100% similarity]
src/if-linux.c [moved from if-linux.c with 100% similarity]
src/if-options.c [moved from if-options.c with 100% similarity]
src/if-options.h [moved from if-options.h with 100% similarity]
src/if-sun.c [moved from if-sun.c with 100% similarity]
src/if.c [moved from if.c with 100% similarity]
src/if.h [moved from if.h with 100% similarity]
src/ipv4.c [moved from ipv4.c with 100% similarity]
src/ipv4.h [moved from ipv4.h with 100% similarity]
src/ipv4ll.c [moved from ipv4ll.c with 100% similarity]
src/ipv4ll.h [moved from ipv4ll.h with 100% similarity]
src/ipv6.c [moved from ipv6.c with 100% similarity]
src/ipv6.h [moved from ipv6.h with 100% similarity]
src/ipv6nd.c [moved from ipv6nd.c with 100% similarity]
src/ipv6nd.h [moved from ipv6nd.h with 100% similarity]
src/route.c [moved from route.c with 100% similarity]
src/route.h [moved from route.h with 100% similarity]
src/sa.c [moved from sa.c with 100% similarity]
src/sa.h [moved from sa.h with 100% similarity]
src/script.c [moved from script.c with 100% similarity]
src/script.h [moved from script.h with 100% similarity]
test/Makefile

index 02e29d157180cc255e85fce2acd3b2ff76b8bfca..a3fc9793651d4b8a365791b0937bdbdb63d544f3 100644 (file)
@@ -4,6 +4,7 @@ config.mk
 config.log
 
 # Ignore object files
+.depend
 *.o
 *.So
 *.so
index f18f8e020a630bad1afb54761326a227fc0a9e58..1e9a503f5bbf15a77de087e55c3be3266ef4d3b2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,55 +1,6 @@
-# dhcpcd Makefile
+SUBDIRS=       src dhcpcd-hooks
 
-PROG=          dhcpcd
-SRCS=          common.c control.c dhcpcd.c duid.c eloop.c
-SRCS+=         if.c if-options.c sa.c route.c
-SRCS+=         dhcp-common.c script.c
-
-CFLAGS?=       -O2
-MKDIRS=
-
-TOP?=          .
-include ${TOP}/iconfig.mk
-
-CSTD?=         c99
-CFLAGS+=       -std=${CSTD}
-CPPFLAGS+=     -I./crypt
-
-SRCS+=         ${DHCPCD_SRCS}
-DHCPCD_DEFS?=  dhcpcd-definitions.conf
-
-OBJS+=         ${SRCS:.c=.o} ${CRYPT_SRCS:.c=.o} ${COMPAT_SRCS:.c=.o}
-
-SCRIPT=                ${LIBEXECDIR}/dhcpcd-run-hooks
-HOOKDIR=       ${LIBEXECDIR}/dhcpcd-hooks
-
-MAN5=          dhcpcd.conf.5
-MAN8=          dhcpcd.8 dhcpcd-run-hooks.8
-CLEANFILES=    dhcpcd.conf.5 dhcpcd.8 dhcpcd-run-hooks.8
-
-SCRIPTS=       dhcpcd-run-hooks
-SCRIPTSDIR=    ${LIBEXECDIR}
-CLEANFILES+=   dhcpcd-run-hooks
-
-FILES=         dhcpcd.conf
-FILESDIR=      ${SYSCONFDIR}
-
-SUBDIRS=       dhcpcd-hooks ${MKDIRS}
-
-SED_RUNDIR=            -e 's:@RUNDIR@:${RUNDIR}:g'
-SED_DBDIR=             -e 's:@DBDIR@:${DBDIR}:g'
-SED_LIBDIR=            -e 's:@LIBDIR@:${LIBDIR}:g'
-SED_DATADIR=           -e 's:@DATADIR@:${DATADIR}:g'
-SED_HOOKDIR=           -e 's:@HOOKDIR@:${HOOKDIR}:g'
-SED_SERVICEEXISTS=     -e 's:@SERVICEEXISTS@:${SERVICEEXISTS}:g'
-SED_SERVICECMD=                -e 's:@SERVICECMD@:${SERVICECMD}:g'
-SED_SERVICESTATUS=     -e 's:@SERVICESTATUS@:${SERVICESTATUS}:g'
-SED_STATUSARG=         -e 's:@STATUSARG@:${STATUSARG}:g'
-SED_SCRIPT=            -e 's:@SCRIPT@:${SCRIPT}:g'
-SED_SYS=               -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g'
-
-DEPEND!=       test -e .depend && echo ".depend" || echo ""
-VERSION!=      sed -n 's/\#define VERSION[[:space:]]*"\(.*\)".*/\1/p' defs.h
+VERSION!=      sed -n 's/\#define VERSION[[:space:]]*"\(.*\)".*/\1/p' src/defs.h
 
 FOSSILID?=     current
 
@@ -65,115 +16,33 @@ HOST_SH?=  /bin/sh
 
 CLEANFILES+=   *.tar.xz
 
-.PHONY:                import import-bsd dev test
+.PHONY:                import import-bsd test
 
 .SUFFIXES:     .in
 
-.in: Makefile config.mk
-       ${SED} ${SED_RUNDIR} ${SED_DBDIR} ${SED_LIBDIR} ${SED_HOOKDIR} \
-               ${SED_SYS} ${SED_SCRIPT} ${SED_DATADIR} \
-               ${SED_SERVICEEXISTS} ${SED_SERVICECMD} ${SED_SERVICESTATUS} \
-               ${SED_STATUSARG} \
-               $< > $@
-
-all: config.h ${PROG} ${SCRIPTS} ${MAN5} ${MAN8}
+all: config.h
        for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
 
-dev:
-       cd dev && ${MAKE}
-
-.c.o: Makefile config.mk
-       ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
-
-CLEANFILES+=   dhcpcd-embedded.h dhcpcd-embedded.c
-
-dhcpcd-embedded.h: genembedh ${DHCPCD_DEFS} dhcpcd-embedded.h.in
-       ${HOST_SH} ${.ALLSRC} $^ > $@
-
-dhcpcd-embedded.c: genembedc ${DHCPCD_DEFS} dhcpcd-embedded.c.in
-       ${HOST_SH} ${.ALLSRC} $^ > $@
-
-if-options.c: dhcpcd-embedded.h
-
-.depend: ${SRCS} ${COMPAT_SRCS} ${CRYPT_SRCS}
-       ${CC} ${CPPFLAGS} -MM ${SRCS} ${COMPAT_SRCS} ${CRYPT_SRCS} > .depend
-
-depend: .depend
-
-${PROG}: ${DEPEND} ${OBJS}
-       ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LDADD}
+depend: config.h
+       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
 
 test:
        cd $@; ${MAKE} $@; ./$@
 
-_embeddedinstall: ${DHCPCD_DEFS}
-       ${INSTALL} -d ${DESTDIR}${SCRIPTSDIR}
-       ${INSTALL} -m ${CONFMODE} ${DHCPCD_DEFS} ${DESTDIR}${SCRIPTSDIR}
-
-_proginstall: ${PROG}
-       ${INSTALL} -d ${DESTDIR}${SBINDIR}
-       ${INSTALL} -m ${BINMODE} ${PROG} ${DESTDIR}${SBINDIR}
-       ${INSTALL} -d ${DESTDIR}${DBDIR}
-
-_scriptsinstall: ${SCRIPTS}
-       ${INSTALL} -d ${DESTDIR}${SCRIPTSDIR}
-       ${INSTALL} -m ${BINMODE} ${SCRIPTS} ${DESTDIR}${SCRIPTSDIR}
-
-proginstall: _proginstall _scriptsinstall ${EMBEDDEDINSTALL}
-       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
-
-_maninstall: ${MAN5} ${MAN8}
-       ${INSTALL} -d ${DESTDIR}${MANDIR}/man5
-       ${INSTALL} -m ${MANMODE} ${MAN5} ${DESTDIR}${MANDIR}/man5
-       ${INSTALL} -d ${DESTDIR}${MANDIR}/man8
-       ${INSTALL} -m ${MANMODE} ${MAN8} ${DESTDIR}${MANDIR}/man8
-
-_confinstall:
-       ${INSTALL} -d ${DESTDIR}${SYSCONFDIR}
-       # Install a new default config if not present
-       test -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.conf || \
-               ${INSTALL} -m ${CONFMODE} dhcpcd.conf ${DESTDIR}${SYSCONFDIR}
-       # Attempt to move files from sysconfig to dbdir
-       if [ ! -e ${DESTDIR}${DBDIR}/duid -a \
-           -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.duid ]; \
-       then \
-               mv ${DESTDIR}${SYSCONFDIR}/dhcpcd.duid \
-                       ${DESTDIR}${DBDIR}/duid; \
-       fi
-       if [ ! -e ${DESTDIR}${DBDIR}/secret -a \
-           -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.secret ]; \
-       then \
-               mv ${DESTDIR}${SYSCONFDIR}/dhcpcd.secret \
-                       ${DESTDIR}${DBDIR}/secret; \
-       fi
-       # Move leases to new location
-       for lease in ${DESTDIR}${DBDIR}/../dhcpcd-*.lease*; do \
-               [ -f "$$lease" ] || continue; \
-               newlease=$$(basename "$$lease" | ${SED} -e "s/dhcpcd-//"); \
-               mv "$$lease" ${DESTDIR}${DBDIR}/"$$newlease"; \
-       done
-       # Move RDM monotonic to new location
-       if [ ! -e ${DESTDIR}${DBDIR}/rdm_monotonic -a \
-           -e ${DESTDIR}${DBDIR}/../dhcpcd-rdm.monotonic ]; \
-       then \
-               mv ${DESTDIR}${DBDIR}/../dhcpcd-rdm.monotonic \
-                       ${DESTDIR}${DBDIR}/rdm_monotonic; \
-       fi
-       
 hooks:
        cd dhcpcd-hooks; ${MAKE}; cd ..; done
 
 eginstall:
        for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
 
-install: proginstall _maninstall _confinstall eginstall
+install:
+       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
 
 clean:
-       rm -f ${OBJS} ${PROG} ${PROG}.core ${CLEANFILES}
        for x in ${SUBDIRS} test; do cd $$x; ${MAKE} $@; cd ..; done
 
 distclean: clean
-       rm -f .depend config.h config.mk config.log \
+       rm -f config.h config.mk config.log \
                ${DISTFILE} ${DISTFILEGZ} ${DISTINFO} ${DISTINFOSIGN}
 
 dist:
diff --git a/dhcpcd-hooks/GNUmakefile b/dhcpcd-hooks/GNUmakefile
deleted file mode 100644 (file)
index 1f97d8c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-TOP?=  ..
-include ${TOP}/GNUmakefile
index 82fec4612676beb74a4adc6891dc5c1413d454ab..92108dc554b7051ea716f5cee53bdafd28c143d8 100644 (file)
@@ -15,17 +15,19 @@ FILES+=             15-timezone
 FILES+=                29-lookup-hostname
 FILES+=                ${EGHOOKSCRIPTS}
 
+all: ${HOOKSCRIPTS} ${EGHOOKSCRIPTS}
+
 50-ypbind: 50-ypbind.in
        ${SED} \
                -e 's:@YPDOMAIN_DIR@:${YPDOMAIN_DIR}:g' \
                -e 's:@YPDOMAIN_SUFFIX@:${YPDOMAIN_SUFFIX}:g' \
                50-ypbind.in > $@
 
-all: ${HOOKSCRIPTS} ${EGHOOKSCRIPTS}
-
 clean:
        rm -f 50-ypbind
 
+depend:
+
 proginstall: ${HOOKSCRIPTS}
        ${INSTALL} -d ${DESTDIR}${SCRIPTSDIR}
        ${INSTALL} -m ${NONBINMODE} ${SCRIPTS} ${DESTDIR}${SCRIPTSDIR}
similarity index 97%
rename from GNUmakefile
rename to src/GNUmakefile
index 55652948827fd49f22a1f4fd36bc23344423be37..f66ad94c6e0ef21ae8fa55ad77d07d051da5fb6e 100644 (file)
@@ -2,7 +2,7 @@
 # Luckily it does read GNUmakefile over Makefile so we can work around it
 
 # Nasty hack so that make clean works without configure being run
-TOP?=          .
+TOP?=          ..
 CONFIG_MK?=    $(shell test -e ${TOP}/config.mk && \
                    echo config.mk || echo config-null.mk)
 
diff --git a/src/Makefile b/src/Makefile
new file mode 100644 (file)
index 0000000..cff6a07
--- /dev/null
@@ -0,0 +1,164 @@
+# dhcpcd Makefile
+
+PROG=          dhcpcd
+SRCS=          common.c control.c dhcpcd.c duid.c eloop.c
+SRCS+=         if.c if-options.c sa.c route.c
+SRCS+=         dhcp-common.c script.c
+
+CFLAGS?=       -O2
+MKDIRS=
+
+TOP?=          ..
+include ${TOP}/iconfig.mk
+
+CSTD?=         c99
+CFLAGS+=       -std=${CSTD}
+CPPFLAGS+=     -I${TOP} -I./crypt -I./
+
+SRCS+=         ${DHCPCD_SRCS}
+DHCPCD_DEFS?=  dhcpcd-definitions.conf
+
+OBJS+=         ${SRCS:.c=.o} ${CRYPT_SRCS:.c=.o} ${COMPAT_SRCS:.c=.o}
+
+SCRIPT=                ${LIBEXECDIR}/dhcpcd-run-hooks
+HOOKDIR=       ${LIBEXECDIR}/dhcpcd-hooks
+
+MAN5=          dhcpcd.conf.5
+MAN8=          dhcpcd.8 dhcpcd-run-hooks.8
+CLEANFILES=    dhcpcd.conf.5 dhcpcd.8 dhcpcd-run-hooks.8
+
+SCRIPTS=       dhcpcd-run-hooks
+SCRIPTSDIR=    ${LIBEXECDIR}
+CLEANFILES+=   dhcpcd-run-hooks
+
+FILES=         dhcpcd.conf
+FILESDIR=      ${SYSCONFDIR}
+
+SUBDIRS=       ${MKDIRS}
+
+SED_RUNDIR=            -e 's:@RUNDIR@:${RUNDIR}:g'
+SED_DBDIR=             -e 's:@DBDIR@:${DBDIR}:g'
+SED_LIBDIR=            -e 's:@LIBDIR@:${LIBDIR}:g'
+SED_DATADIR=           -e 's:@DATADIR@:${DATADIR}:g'
+SED_HOOKDIR=           -e 's:@HOOKDIR@:${HOOKDIR}:g'
+SED_SERVICEEXISTS=     -e 's:@SERVICEEXISTS@:${SERVICEEXISTS}:g'
+SED_SERVICECMD=                -e 's:@SERVICECMD@:${SERVICECMD}:g'
+SED_SERVICESTATUS=     -e 's:@SERVICESTATUS@:${SERVICESTATUS}:g'
+SED_STATUSARG=         -e 's:@STATUSARG@:${STATUSARG}:g'
+SED_SCRIPT=            -e 's:@SCRIPT@:${SCRIPT}:g'
+SED_SYS=               -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g'
+
+DEPEND!=       test -e .depend && echo ".depend" || echo ""
+
+HOST_SH?=      /bin/sh
+
+CLEANFILES+=   *.tar.xz
+
+.PHONY:                import import-bsd dev test
+
+.SUFFIXES:     .in
+
+.in: Makefile ${TOP}/config.mk
+       ${SED} ${SED_RUNDIR} ${SED_DBDIR} ${SED_LIBDIR} ${SED_HOOKDIR} \
+               ${SED_SYS} ${SED_SCRIPT} ${SED_DATADIR} \
+               ${SED_SERVICEEXISTS} ${SED_SERVICECMD} ${SED_SERVICESTATUS} \
+               ${SED_STATUSARG} \
+               $< > $@
+
+all: ${TOP}/config.h ${PROG} ${SCRIPTS} ${MAN5} ${MAN8}
+       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
+
+dev:
+       cd dev && ${MAKE}
+
+.c.o: Makefile ${TOP}/config.mk
+       ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
+
+CLEANFILES+=   dhcpcd-embedded.h dhcpcd-embedded.c
+
+dhcpcd-embedded.h: genembedh ${DHCPCD_DEFS} dhcpcd-embedded.h.in
+       ${HOST_SH} ${.ALLSRC} $^ > $@
+
+dhcpcd-embedded.c: genembedc ${DHCPCD_DEFS} dhcpcd-embedded.c.in
+       ${HOST_SH} ${.ALLSRC} $^ > $@
+
+if-options.c: dhcpcd-embedded.h
+
+.depend: ${SRCS} ${COMPAT_SRCS} ${CRYPT_SRCS}
+       ${CC} ${CPPFLAGS} -MM ${SRCS} ${COMPAT_SRCS} ${CRYPT_SRCS} > .depend
+
+depend: .depend
+
+${PROG}: ${DEPEND} ${OBJS}
+       ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LDADD}
+
+_embeddedinstall: ${DHCPCD_DEFS}
+       ${INSTALL} -d ${DESTDIR}${SCRIPTSDIR}
+       ${INSTALL} -m ${CONFMODE} ${DHCPCD_DEFS} ${DESTDIR}${SCRIPTSDIR}
+
+_proginstall: ${PROG}
+       ${INSTALL} -d ${DESTDIR}${SBINDIR}
+       ${INSTALL} -m ${BINMODE} ${PROG} ${DESTDIR}${SBINDIR}
+       ${INSTALL} -d ${DESTDIR}${DBDIR}
+
+_scriptsinstall: ${SCRIPTS}
+       ${INSTALL} -d ${DESTDIR}${SCRIPTSDIR}
+       ${INSTALL} -m ${BINMODE} ${SCRIPTS} ${DESTDIR}${SCRIPTSDIR}
+
+proginstall: _proginstall _scriptsinstall ${EMBEDDEDINSTALL}
+       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
+
+_maninstall: ${MAN5} ${MAN8}
+       ${INSTALL} -d ${DESTDIR}${MANDIR}/man5
+       ${INSTALL} -m ${MANMODE} ${MAN5} ${DESTDIR}${MANDIR}/man5
+       ${INSTALL} -d ${DESTDIR}${MANDIR}/man8
+       ${INSTALL} -m ${MANMODE} ${MAN8} ${DESTDIR}${MANDIR}/man8
+
+_confinstall:
+       ${INSTALL} -d ${DESTDIR}${SYSCONFDIR}
+       # Install a new default config if not present
+       test -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.conf || \
+               ${INSTALL} -m ${CONFMODE} dhcpcd.conf ${DESTDIR}${SYSCONFDIR}
+       # Attempt to move files from sysconfig to dbdir
+       if [ ! -e ${DESTDIR}${DBDIR}/duid -a \
+           -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.duid ]; \
+       then \
+               mv ${DESTDIR}${SYSCONFDIR}/dhcpcd.duid \
+                       ${DESTDIR}${DBDIR}/duid; \
+       fi
+       if [ ! -e ${DESTDIR}${DBDIR}/secret -a \
+           -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.secret ]; \
+       then \
+               mv ${DESTDIR}${SYSCONFDIR}/dhcpcd.secret \
+                       ${DESTDIR}${DBDIR}/secret; \
+       fi
+       # Move leases to new location
+       for lease in ${DESTDIR}${DBDIR}/../dhcpcd-*.lease*; do \
+               [ -f "$$lease" ] || continue; \
+               newlease=$$(basename "$$lease" | ${SED} -e "s/dhcpcd-//"); \
+               mv "$$lease" ${DESTDIR}${DBDIR}/"$$newlease"; \
+       done
+       # Move RDM monotonic to new location
+       if [ ! -e ${DESTDIR}${DBDIR}/rdm_monotonic -a \
+           -e ${DESTDIR}${DBDIR}/../dhcpcd-rdm.monotonic ]; \
+       then \
+               mv ${DESTDIR}${DBDIR}/../dhcpcd-rdm.monotonic \
+                       ${DESTDIR}${DBDIR}/rdm_monotonic; \
+       fi
+       
+hooks:
+       cd dhcpcd-hooks; ${MAKE}; cd ..; done
+
+eginstall:
+       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
+
+install: proginstall _maninstall _confinstall eginstall
+
+clean:
+       rm -f ${OBJS} ${PROG} ${PROG}.core ${CLEANFILES}
+       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
+
+distclean: clean
+       rm -f .depend
+
+include ${TOP}/Makefile.inc
diff --git a/arp.c b/src/arp.c
similarity index 100%
rename from arp.c
rename to src/arp.c
diff --git a/arp.h b/src/arp.h
similarity index 100%
rename from arp.h
rename to src/arp.h
similarity index 100%
rename from auth.c
rename to src/auth.c
similarity index 100%
rename from auth.h
rename to src/auth.h
diff --git a/bpf.c b/src/bpf.c
similarity index 100%
rename from bpf.c
rename to src/bpf.c
diff --git a/bpf.h b/src/bpf.h
similarity index 100%
rename from bpf.h
rename to src/bpf.h
similarity index 100%
rename from common.c
rename to src/common.c
similarity index 100%
rename from common.h
rename to src/common.h
similarity index 100%
rename from compat/arc4random.c
rename to src/compat/arc4random.c
similarity index 100%
rename from compat/arc4random.h
rename to src/compat/arc4random.h
similarity index 100%
rename from compat/bitops.h
rename to src/compat/bitops.h
similarity index 100%
rename from compat/dprintf.c
rename to src/compat/dprintf.c
similarity index 100%
rename from compat/dprintf.h
rename to src/compat/dprintf.h
similarity index 100%
rename from compat/endian.h
rename to src/compat/endian.h
similarity index 100%
rename from compat/getline.c
rename to src/compat/getline.c
similarity index 100%
rename from compat/getline.h
rename to src/compat/getline.h
similarity index 100%
rename from compat/pidfile.c
rename to src/compat/pidfile.c
similarity index 100%
rename from compat/pidfile.h
rename to src/compat/pidfile.h
similarity index 100%
rename from compat/queue.h
rename to src/compat/queue.h
similarity index 100%
rename from compat/strlcpy.c
rename to src/compat/strlcpy.c
similarity index 100%
rename from compat/strlcpy.h
rename to src/compat/strlcpy.h
similarity index 100%
rename from compat/strtoi.c
rename to src/compat/strtoi.c
similarity index 100%
rename from compat/strtoi.h
rename to src/compat/strtoi.h
similarity index 100%
rename from control.c
rename to src/control.c
similarity index 100%
rename from control.h
rename to src/control.h
similarity index 100%
rename from crypt/crypt.h
rename to src/crypt/crypt.h
similarity index 100%
rename from crypt/hmac_md5.c
rename to src/crypt/hmac_md5.c
similarity index 100%
rename from crypt/md5.c
rename to src/crypt/md5.c
similarity index 100%
rename from crypt/md5.h
rename to src/crypt/md5.h
similarity index 100%
rename from crypt/sha256.c
rename to src/crypt/sha256.c
similarity index 100%
rename from crypt/sha256.h
rename to src/crypt/sha256.h
similarity index 100%
rename from defs.h
rename to src/defs.h
diff --git a/dev.c b/src/dev.c
similarity index 100%
rename from dev.c
rename to src/dev.c
diff --git a/dev.h b/src/dev.h
similarity index 100%
rename from dev.h
rename to src/dev.h
similarity index 94%
rename from dev/Makefile
rename to src/dev/Makefile
index 3e7c6366468a91fc4080eace964699b64184db62..13832b9e743d96455a70bfd5a8279ebc5ebbb4e4 100644 (file)
@@ -1,10 +1,11 @@
-TOP?=  ../
+TOP?=  ../../
 include ${TOP}/Makefile.inc
 include ${TOP}/config.mk
 
 CFLAGS?=       -O2
 CSTD?=         c99
 CFLAGS+=       -std=${CSTD}
+CPPFLAGS+=     -I${TOP} -I${TOP}/src
 
 DEVDIR=                ${LIBDIR}/dhcpcd/dev
 DSRC=          ${DEV_PLUGINS:=.c}
similarity index 100%
rename from dev/udev.c
rename to src/dev/udev.c
similarity index 100%
rename from dhcp-common.c
rename to src/dhcp-common.c
similarity index 100%
rename from dhcp-common.h
rename to src/dhcp-common.h
similarity index 100%
rename from dhcp.c
rename to src/dhcp.c
similarity index 100%
rename from dhcp.h
rename to src/dhcp.h
similarity index 100%
rename from dhcp6.c
rename to src/dhcp6.c
similarity index 100%
rename from dhcp6.h
rename to src/dhcp6.h
similarity index 100%
rename from dhcpcd-run-hooks.in
rename to src/dhcpcd-run-hooks.in
similarity index 100%
rename from dhcpcd.8.in
rename to src/dhcpcd.8.in
similarity index 100%
rename from dhcpcd.c
rename to src/dhcpcd.c
similarity index 100%
rename from dhcpcd.conf
rename to src/dhcpcd.conf
similarity index 100%
rename from dhcpcd.conf.5.in
rename to src/dhcpcd.conf.5.in
similarity index 100%
rename from dhcpcd.h
rename to src/dhcpcd.h
similarity index 100%
rename from duid.c
rename to src/duid.c
similarity index 100%
rename from duid.h
rename to src/duid.h
similarity index 100%
rename from eloop.c
rename to src/eloop.c
similarity index 100%
rename from eloop.h
rename to src/eloop.h
similarity index 100%
rename from genembedc
rename to src/genembedc
similarity index 100%
rename from genembedh
rename to src/genembedh
similarity index 100%
rename from if-bsd.c
rename to src/if-bsd.c
similarity index 100%
rename from if-linux-wext.c
rename to src/if-linux-wext.c
similarity index 100%
rename from if-linux.c
rename to src/if-linux.c
similarity index 100%
rename from if-options.c
rename to src/if-options.c
similarity index 100%
rename from if-options.h
rename to src/if-options.h
similarity index 100%
rename from if-sun.c
rename to src/if-sun.c
diff --git a/if.c b/src/if.c
similarity index 100%
rename from if.c
rename to src/if.c
diff --git a/if.h b/src/if.h
similarity index 100%
rename from if.h
rename to src/if.h
similarity index 100%
rename from ipv4.c
rename to src/ipv4.c
similarity index 100%
rename from ipv4.h
rename to src/ipv4.h
similarity index 100%
rename from ipv4ll.c
rename to src/ipv4ll.c
similarity index 100%
rename from ipv4ll.h
rename to src/ipv4ll.h
similarity index 100%
rename from ipv6.c
rename to src/ipv6.c
similarity index 100%
rename from ipv6.h
rename to src/ipv6.h
similarity index 100%
rename from ipv6nd.c
rename to src/ipv6nd.c
similarity index 100%
rename from ipv6nd.h
rename to src/ipv6nd.h
similarity index 100%
rename from route.c
rename to src/route.c
similarity index 100%
rename from route.h
rename to src/route.h
diff --git a/sa.c b/src/sa.c
similarity index 100%
rename from sa.c
rename to src/sa.c
diff --git a/sa.h b/src/sa.h
similarity index 100%
rename from sa.h
rename to src/sa.h
similarity index 100%
rename from script.c
rename to src/script.c
similarity index 100%
rename from script.h
rename to src/script.h
index e29a7cd77b2d3842b9e3548a6f4061461fa0aef5..fcd0fd725f7d290291db121a800b5994303598b3 100644 (file)
@@ -3,16 +3,16 @@ include ${TOP}/iconfig.mk
 
 PROG=          test
 SRCS=          test.c
-SRCS+=         test_hmac_md5.c ../crypt/hmac_md5.c
+SRCS+=         test_hmac_md5.c ${TOP}/src/crypt/hmac_md5.c
 
 CFLAGS?=       -O2
 CSTD?=         c99
 CFLAGS+=       -std=${CSTD}
 
-CPPFLAGS+=     -I../crypt
+CPPFLAGS+=     -I${TOP}/src/crypt
 
-T_COMPAT_SRCS= ${COMPAT_SRCS:compat/%=../compat/%}
-T_MD5_SRC=     ${MD5_SRC:crypt/%=../crypt/%}
+T_COMPAT_SRCS= ${COMPAT_SRCS:compat/%=${TOP}/src/compat/%}
+T_MD5_SRC=     ${MD5_SRC:crypt/%=${TOP}/src/crypt/%}
 OBJS+=         ${SRCS:.c=.o} ${T_COMPAT_SRCS:.c=.o} ${T_MD5_SRC:.c=.o}
 
 .c.o: