From: Roy Marples Date: Wed, 15 Mar 2017 22:06:12 +0000 (+0000) Subject: Move the source files along with dev, crypt and comapt into src dir. X-Git-Tag: v7.0.0-beta1~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a72e61f146dc0273da93b49b282d6e074f3fc6a6;p=thirdparty%2Fdhcpcd.git Move the source files along with dev, crypt and comapt into src dir. This makes the toplevel directory more manageable. --- diff --git a/.gitignore b/.gitignore index 02e29d15..a3fc9793 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ config.mk config.log # Ignore object files +.depend *.o *.So *.so diff --git a/Makefile b/Makefile index f18f8e02..1e9a503f 100644 --- 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 index 1f97d8c4..00000000 --- a/dhcpcd-hooks/GNUmakefile +++ /dev/null @@ -1,2 +0,0 @@ -TOP?= .. -include ${TOP}/GNUmakefile diff --git a/dhcpcd-hooks/Makefile b/dhcpcd-hooks/Makefile index 82fec461..92108dc5 100644 --- a/dhcpcd-hooks/Makefile +++ b/dhcpcd-hooks/Makefile @@ -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} diff --git a/GNUmakefile b/src/GNUmakefile similarity index 97% rename from GNUmakefile rename to src/GNUmakefile index 55652948..f66ad94c 100644 --- a/GNUmakefile +++ b/src/GNUmakefile @@ -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 index 00000000..cff6a078 --- /dev/null +++ b/src/Makefile @@ -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 diff --git a/auth.c b/src/auth.c similarity index 100% rename from auth.c rename to src/auth.c diff --git a/auth.h b/src/auth.h 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 diff --git a/common.c b/src/common.c similarity index 100% rename from common.c rename to src/common.c diff --git a/common.h b/src/common.h similarity index 100% rename from common.h rename to src/common.h diff --git a/compat/arc4random.c b/src/compat/arc4random.c similarity index 100% rename from compat/arc4random.c rename to src/compat/arc4random.c diff --git a/compat/arc4random.h b/src/compat/arc4random.h similarity index 100% rename from compat/arc4random.h rename to src/compat/arc4random.h diff --git a/compat/arc4random_uniform.c b/src/compat/arc4random_uniform.c similarity index 100% rename from compat/arc4random_uniform.c rename to src/compat/arc4random_uniform.c diff --git a/compat/arc4random_uniform.h b/src/compat/arc4random_uniform.h similarity index 100% rename from compat/arc4random_uniform.h rename to src/compat/arc4random_uniform.h diff --git a/compat/bitops.h b/src/compat/bitops.h similarity index 100% rename from compat/bitops.h rename to src/compat/bitops.h diff --git a/compat/dprintf.c b/src/compat/dprintf.c similarity index 100% rename from compat/dprintf.c rename to src/compat/dprintf.c diff --git a/compat/dprintf.h b/src/compat/dprintf.h similarity index 100% rename from compat/dprintf.h rename to src/compat/dprintf.h diff --git a/compat/endian.h b/src/compat/endian.h similarity index 100% rename from compat/endian.h rename to src/compat/endian.h diff --git a/compat/getline.c b/src/compat/getline.c similarity index 100% rename from compat/getline.c rename to src/compat/getline.c diff --git a/compat/getline.h b/src/compat/getline.h similarity index 100% rename from compat/getline.h rename to src/compat/getline.h diff --git a/compat/pidfile.c b/src/compat/pidfile.c similarity index 100% rename from compat/pidfile.c rename to src/compat/pidfile.c diff --git a/compat/pidfile.h b/src/compat/pidfile.h similarity index 100% rename from compat/pidfile.h rename to src/compat/pidfile.h diff --git a/compat/posix_spawn.c b/src/compat/posix_spawn.c similarity index 100% rename from compat/posix_spawn.c rename to src/compat/posix_spawn.c diff --git a/compat/posix_spawn.h b/src/compat/posix_spawn.h similarity index 100% rename from compat/posix_spawn.h rename to src/compat/posix_spawn.h diff --git a/compat/queue.h b/src/compat/queue.h similarity index 100% rename from compat/queue.h rename to src/compat/queue.h diff --git a/compat/reallocarray.c b/src/compat/reallocarray.c similarity index 100% rename from compat/reallocarray.c rename to src/compat/reallocarray.c diff --git a/compat/reallocarray.h b/src/compat/reallocarray.h similarity index 100% rename from compat/reallocarray.h rename to src/compat/reallocarray.h diff --git a/compat/strlcpy.c b/src/compat/strlcpy.c similarity index 100% rename from compat/strlcpy.c rename to src/compat/strlcpy.c diff --git a/compat/strlcpy.h b/src/compat/strlcpy.h similarity index 100% rename from compat/strlcpy.h rename to src/compat/strlcpy.h diff --git a/compat/strtoi.c b/src/compat/strtoi.c similarity index 100% rename from compat/strtoi.c rename to src/compat/strtoi.c diff --git a/compat/strtoi.h b/src/compat/strtoi.h similarity index 100% rename from compat/strtoi.h rename to src/compat/strtoi.h diff --git a/control.c b/src/control.c similarity index 100% rename from control.c rename to src/control.c diff --git a/control.h b/src/control.h similarity index 100% rename from control.h rename to src/control.h diff --git a/crypt/crypt.h b/src/crypt/crypt.h similarity index 100% rename from crypt/crypt.h rename to src/crypt/crypt.h diff --git a/crypt/hmac_md5.c b/src/crypt/hmac_md5.c similarity index 100% rename from crypt/hmac_md5.c rename to src/crypt/hmac_md5.c diff --git a/crypt/md5.c b/src/crypt/md5.c similarity index 100% rename from crypt/md5.c rename to src/crypt/md5.c diff --git a/crypt/md5.h b/src/crypt/md5.h similarity index 100% rename from crypt/md5.h rename to src/crypt/md5.h diff --git a/crypt/sha256.c b/src/crypt/sha256.c similarity index 100% rename from crypt/sha256.c rename to src/crypt/sha256.c diff --git a/crypt/sha256.h b/src/crypt/sha256.h similarity index 100% rename from crypt/sha256.h rename to src/crypt/sha256.h diff --git a/defs.h b/src/defs.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 diff --git a/dev/Makefile b/src/dev/Makefile similarity index 94% rename from dev/Makefile rename to src/dev/Makefile index 3e7c6366..13832b9e 100644 --- a/dev/Makefile +++ b/src/dev/Makefile @@ -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} diff --git a/dev/udev.c b/src/dev/udev.c similarity index 100% rename from dev/udev.c rename to src/dev/udev.c diff --git a/dhcp-common.c b/src/dhcp-common.c similarity index 100% rename from dhcp-common.c rename to src/dhcp-common.c diff --git a/dhcp-common.h b/src/dhcp-common.h similarity index 100% rename from dhcp-common.h rename to src/dhcp-common.h diff --git a/dhcp.c b/src/dhcp.c similarity index 100% rename from dhcp.c rename to src/dhcp.c diff --git a/dhcp.h b/src/dhcp.h similarity index 100% rename from dhcp.h rename to src/dhcp.h diff --git a/dhcp6.c b/src/dhcp6.c similarity index 100% rename from dhcp6.c rename to src/dhcp6.c diff --git a/dhcp6.h b/src/dhcp6.h similarity index 100% rename from dhcp6.h rename to src/dhcp6.h diff --git a/dhcpcd-definitions-small.conf b/src/dhcpcd-definitions-small.conf similarity index 100% rename from dhcpcd-definitions-small.conf rename to src/dhcpcd-definitions-small.conf diff --git a/dhcpcd-definitions.conf b/src/dhcpcd-definitions.conf similarity index 100% rename from dhcpcd-definitions.conf rename to src/dhcpcd-definitions.conf diff --git a/dhcpcd-embedded.c.in b/src/dhcpcd-embedded.c.in similarity index 100% rename from dhcpcd-embedded.c.in rename to src/dhcpcd-embedded.c.in diff --git a/dhcpcd-embedded.h.in b/src/dhcpcd-embedded.h.in similarity index 100% rename from dhcpcd-embedded.h.in rename to src/dhcpcd-embedded.h.in diff --git a/dhcpcd-run-hooks.8.in b/src/dhcpcd-run-hooks.8.in similarity index 100% rename from dhcpcd-run-hooks.8.in rename to src/dhcpcd-run-hooks.8.in diff --git a/dhcpcd-run-hooks.in b/src/dhcpcd-run-hooks.in similarity index 100% rename from dhcpcd-run-hooks.in rename to src/dhcpcd-run-hooks.in diff --git a/dhcpcd.8.in b/src/dhcpcd.8.in similarity index 100% rename from dhcpcd.8.in rename to src/dhcpcd.8.in diff --git a/dhcpcd.c b/src/dhcpcd.c similarity index 100% rename from dhcpcd.c rename to src/dhcpcd.c diff --git a/dhcpcd.conf b/src/dhcpcd.conf similarity index 100% rename from dhcpcd.conf rename to src/dhcpcd.conf diff --git a/dhcpcd.conf.5.in b/src/dhcpcd.conf.5.in similarity index 100% rename from dhcpcd.conf.5.in rename to src/dhcpcd.conf.5.in diff --git a/dhcpcd.h b/src/dhcpcd.h similarity index 100% rename from dhcpcd.h rename to src/dhcpcd.h diff --git a/duid.c b/src/duid.c similarity index 100% rename from duid.c rename to src/duid.c diff --git a/duid.h b/src/duid.h similarity index 100% rename from duid.h rename to src/duid.h diff --git a/eloop.c b/src/eloop.c similarity index 100% rename from eloop.c rename to src/eloop.c diff --git a/eloop.h b/src/eloop.h similarity index 100% rename from eloop.h rename to src/eloop.h diff --git a/genembedc b/src/genembedc similarity index 100% rename from genembedc rename to src/genembedc diff --git a/genembedh b/src/genembedh similarity index 100% rename from genembedh rename to src/genembedh diff --git a/if-bsd.c b/src/if-bsd.c similarity index 100% rename from if-bsd.c rename to src/if-bsd.c diff --git a/if-linux-wext.c b/src/if-linux-wext.c similarity index 100% rename from if-linux-wext.c rename to src/if-linux-wext.c diff --git a/if-linux.c b/src/if-linux.c similarity index 100% rename from if-linux.c rename to src/if-linux.c diff --git a/if-options.c b/src/if-options.c similarity index 100% rename from if-options.c rename to src/if-options.c diff --git a/if-options.h b/src/if-options.h similarity index 100% rename from if-options.h rename to src/if-options.h diff --git a/if-sun.c b/src/if-sun.c 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 diff --git a/ipv4.c b/src/ipv4.c similarity index 100% rename from ipv4.c rename to src/ipv4.c diff --git a/ipv4.h b/src/ipv4.h similarity index 100% rename from ipv4.h rename to src/ipv4.h diff --git a/ipv4ll.c b/src/ipv4ll.c similarity index 100% rename from ipv4ll.c rename to src/ipv4ll.c diff --git a/ipv4ll.h b/src/ipv4ll.h similarity index 100% rename from ipv4ll.h rename to src/ipv4ll.h diff --git a/ipv6.c b/src/ipv6.c similarity index 100% rename from ipv6.c rename to src/ipv6.c diff --git a/ipv6.h b/src/ipv6.h similarity index 100% rename from ipv6.h rename to src/ipv6.h diff --git a/ipv6nd.c b/src/ipv6nd.c similarity index 100% rename from ipv6nd.c rename to src/ipv6nd.c diff --git a/ipv6nd.h b/src/ipv6nd.h similarity index 100% rename from ipv6nd.h rename to src/ipv6nd.h diff --git a/route.c b/src/route.c similarity index 100% rename from route.c rename to src/route.c diff --git a/route.h b/src/route.h 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 diff --git a/script.c b/src/script.c similarity index 100% rename from script.c rename to src/script.c diff --git a/script.h b/src/script.h similarity index 100% rename from script.h rename to src/script.h diff --git a/test/Makefile b/test/Makefile index e29a7cd7..fcd0fd72 100644 --- a/test/Makefile +++ b/test/Makefile @@ -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: