diff options
| author | Niklas | 2011-08-29 15:08:23 +0200 |
|---|---|---|
| committer | Niklas | 2011-08-29 15:08:23 +0200 |
| commit | 4f713dfa2728b5727481604ad7249e9c71a6487d (patch) | |
| tree | 28ec09bf9d97b75e48cce6a388d5fd032b699d59 /workspace/customdhcpcd | |
| parent | added to dialogs. one for the critical error case (abot boot dialog), one for... (diff) | |
| download | fbgui-4f713dfa2728b5727481604ad7249e9c71a6487d.tar.gz fbgui-4f713dfa2728b5727481604ad7249e9c71a6487d.tar.xz fbgui-4f713dfa2728b5727481604ad7249e9c71a6487d.zip | |
added makefiles
Diffstat (limited to 'workspace/customdhcpcd')
24 files changed, 519 insertions, 3 deletions
diff --git a/workspace/customdhcpcd/Debug/customdhcpcd b/workspace/customdhcpcd/Debug/customdhcpcd Binary files differdeleted file mode 100755 index 6212e3b..0000000 --- a/workspace/customdhcpcd/Debug/customdhcpcd +++ /dev/null diff --git a/workspace/customdhcpcd/Debug/src/arp.d b/workspace/customdhcpcd/Debug/src/arp.d new file mode 100644 index 0000000..e639f20 --- /dev/null +++ b/workspace/customdhcpcd/Debug/src/arp.d @@ -0,0 +1,21 @@ +src/arp.d src/arp.o: ../src/arp.c ../src/config.h ../src/common.h \ + ../src/arp.h ../src/interface.h ../src/logger.h ../src/signal.h \ + ../src/socket.h ../src/dhcp.h ../src/dhcpcd.h + +../src/config.h: + +../src/common.h: + +../src/arp.h: + +../src/interface.h: + +../src/logger.h: + +../src/signal.h: + +../src/socket.h: + +../src/dhcp.h: + +../src/dhcpcd.h: diff --git a/workspace/customdhcpcd/Debug/src/client.d b/workspace/customdhcpcd/Debug/src/client.d new file mode 100644 index 0000000..585c535 --- /dev/null +++ b/workspace/customdhcpcd/Debug/src/client.d @@ -0,0 +1,37 @@ +src/client.d src/client.o: ../src/client.c ../src/config.h \ + ../src/common.h ../src/arp.h ../src/interface.h ../src/client.h \ + ../src/dhcpcd.h ../src/configure.h ../src/dhcp.h ../src/info.h \ + ../src/ipv4ll.h ../src/logger.h ../src/signal.h ../src/socket.h \ + ../src/logwriter.h ../src/status.h ../src/duid.h + +../src/config.h: + +../src/common.h: + +../src/arp.h: + +../src/interface.h: + +../src/client.h: + +../src/dhcpcd.h: + +../src/configure.h: + +../src/dhcp.h: + +../src/info.h: + +../src/ipv4ll.h: + +../src/logger.h: + +../src/signal.h: + +../src/socket.h: + +../src/logwriter.h: + +../src/status.h: + +../src/duid.h: diff --git a/workspace/customdhcpcd/Debug/src/common.d b/workspace/customdhcpcd/Debug/src/common.d new file mode 100644 index 0000000..235fc5e --- /dev/null +++ b/workspace/customdhcpcd/Debug/src/common.d @@ -0,0 +1,6 @@ +src/common.d src/common.o: ../src/common.c ../src/common.h \ + ../src/logger.h + +../src/common.h: + +../src/logger.h: diff --git a/workspace/customdhcpcd/Debug/src/configure.d b/workspace/customdhcpcd/Debug/src/configure.d new file mode 100644 index 0000000..16416f6 --- /dev/null +++ b/workspace/customdhcpcd/Debug/src/configure.d @@ -0,0 +1,28 @@ +src/configure.d src/configure.o: ../src/configure.c ../src/config.h \ + ../src/common.h ../src/configure.h ../src/dhcpcd.h ../src/interface.h \ + ../src/dhcp.h ../src/info.h ../src/logger.h ../src/signal.h \ + ../src/socket.h ../src/status.h ../src/logwriter.h + +../src/config.h: + +../src/common.h: + +../src/configure.h: + +../src/dhcpcd.h: + +../src/interface.h: + +../src/dhcp.h: + +../src/info.h: + +../src/logger.h: + +../src/signal.h: + +../src/socket.h: + +../src/status.h: + +../src/logwriter.h: diff --git a/workspace/customdhcpcd/Debug/src/dhcp.d b/workspace/customdhcpcd/Debug/src/dhcp.d new file mode 100644 index 0000000..82e54dd --- /dev/null +++ b/workspace/customdhcpcd/Debug/src/dhcp.d @@ -0,0 +1,17 @@ +src/dhcp.d src/dhcp.o: ../src/dhcp.c ../src/config.h ../src/common.h \ + ../src/dhcpcd.h ../src/dhcp.h ../src/interface.h ../src/logger.h \ + ../src/socket.h + +../src/config.h: + +../src/common.h: + +../src/dhcpcd.h: + +../src/dhcp.h: + +../src/interface.h: + +../src/logger.h: + +../src/socket.h: diff --git a/workspace/customdhcpcd/Debug/src/dhcpcd.d b/workspace/customdhcpcd/Debug/src/dhcpcd.d new file mode 100644 index 0000000..05c8d7e --- /dev/null +++ b/workspace/customdhcpcd/Debug/src/dhcpcd.d @@ -0,0 +1,26 @@ +src/dhcpcd.d src/dhcpcd.o: ../src/dhcpcd.c ../src/config.h \ + ../src/client.h ../src/dhcpcd.h ../src/common.h ../src/dhcp.h \ + ../src/interface.h ../src/logger.h ../src/socket.h ../src/version.h \ + ../src/logwriter.h ../src/status.h + +../src/config.h: + +../src/client.h: + +../src/dhcpcd.h: + +../src/common.h: + +../src/dhcp.h: + +../src/interface.h: + +../src/logger.h: + +../src/socket.h: + +../src/version.h: + +../src/logwriter.h: + +../src/status.h: diff --git a/workspace/customdhcpcd/Debug/src/discover.d b/workspace/customdhcpcd/Debug/src/discover.d new file mode 100644 index 0000000..9188993 --- /dev/null +++ b/workspace/customdhcpcd/Debug/src/discover.d @@ -0,0 +1 @@ +src/discover.d src/discover.o: ../src/discover.c diff --git a/workspace/customdhcpcd/Debug/src/duid.d b/workspace/customdhcpcd/Debug/src/duid.d new file mode 100644 index 0000000..1434db7 --- /dev/null +++ b/workspace/customdhcpcd/Debug/src/duid.d @@ -0,0 +1,12 @@ +src/duid.d src/duid.o: ../src/duid.c ../src/config.h ../src/common.h \ + ../src/duid.h ../src/interface.h ../src/logger.h + +../src/config.h: + +../src/common.h: + +../src/duid.h: + +../src/interface.h: + +../src/logger.h: diff --git a/workspace/customdhcpcd/Debug/src/info.d b/workspace/customdhcpcd/Debug/src/info.d new file mode 100644 index 0000000..0a3490d --- /dev/null +++ b/workspace/customdhcpcd/Debug/src/info.d @@ -0,0 +1,17 @@ +src/info.d src/info.o: ../src/info.c ../src/config.h ../src/common.h \ + ../src/dhcp.h ../src/dhcpcd.h ../src/interface.h ../src/logger.h \ + ../src/info.h + +../src/config.h: + +../src/common.h: + +../src/dhcp.h: + +../src/dhcpcd.h: + +../src/interface.h: + +../src/logger.h: + +../src/info.h: diff --git a/workspace/customdhcpcd/Debug/src/interface.d b/workspace/customdhcpcd/Debug/src/interface.d new file mode 100644 index 0000000..581c831 --- /dev/null +++ b/workspace/customdhcpcd/Debug/src/interface.d @@ -0,0 +1,15 @@ +src/interface.d src/interface.o: ../src/interface.c ../src/config.h \ + ../src/common.h ../src/dhcp.h ../src/dhcpcd.h ../src/interface.h \ + ../src/logger.h + +../src/config.h: + +../src/common.h: + +../src/dhcp.h: + +../src/dhcpcd.h: + +../src/interface.h: + +../src/logger.h: diff --git a/workspace/customdhcpcd/Debug/src/ipv4ll.d b/workspace/customdhcpcd/Debug/src/ipv4ll.d new file mode 100644 index 0000000..7d02ead --- /dev/null +++ b/workspace/customdhcpcd/Debug/src/ipv4ll.d @@ -0,0 +1,17 @@ +src/ipv4ll.d src/ipv4ll.o: ../src/ipv4ll.c ../src/config.h ../src/arp.h \ + ../src/interface.h ../src/ipv4ll.h ../src/dhcp.h ../src/dhcpcd.h \ + ../src/common.h + +../src/config.h: + +../src/arp.h: + +../src/interface.h: + +../src/ipv4ll.h: + +../src/dhcp.h: + +../src/dhcpcd.h: + +../src/common.h: diff --git a/workspace/customdhcpcd/Debug/src/logger.d b/workspace/customdhcpcd/Debug/src/logger.d new file mode 100644 index 0000000..bbf1cf8 --- /dev/null +++ b/workspace/customdhcpcd/Debug/src/logger.d @@ -0,0 +1,10 @@ +src/logger.d src/logger.o: ../src/logger.c ../src/common.h \ + ../src/logger.h ../src/logwriter.h ../src/dhcpcd.h + +../src/common.h: + +../src/logger.h: + +../src/logwriter.h: + +../src/dhcpcd.h: diff --git a/workspace/customdhcpcd/Debug/src/logwriter.d b/workspace/customdhcpcd/Debug/src/logwriter.d new file mode 100644 index 0000000..83dc4b5 --- /dev/null +++ b/workspace/customdhcpcd/Debug/src/logwriter.d @@ -0,0 +1,19 @@ +src/logwriter.d src/logwriter.o: ../src/logwriter.c ../src/common.h \ + ../src/dhcp.h ../src/dhcpcd.h ../src/interface.h ../src/config.h \ + ../src/logger.h ../src/logwriter.h ../src/status.h + +../src/common.h: + +../src/dhcp.h: + +../src/dhcpcd.h: + +../src/interface.h: + +../src/config.h: + +../src/logger.h: + +../src/logwriter.h: + +../src/status.h: diff --git a/workspace/customdhcpcd/Debug/src/signal.d b/workspace/customdhcpcd/Debug/src/signal.d new file mode 100644 index 0000000..0185fc3 --- /dev/null +++ b/workspace/customdhcpcd/Debug/src/signal.d @@ -0,0 +1,8 @@ +src/signal.d src/signal.o: ../src/signal.c ../src/common.h \ + ../src/logger.h ../src/signal.h + +../src/common.h: + +../src/logger.h: + +../src/signal.h: diff --git a/workspace/customdhcpcd/Debug/src/socket.d b/workspace/customdhcpcd/Debug/src/socket.d new file mode 100644 index 0000000..785c170 --- /dev/null +++ b/workspace/customdhcpcd/Debug/src/socket.d @@ -0,0 +1,17 @@ +src/socket.d src/socket.o: ../src/socket.c ../src/config.h ../src/dhcp.h \ + ../src/dhcpcd.h ../src/common.h ../src/interface.h ../src/logger.h \ + ../src/socket.h + +../src/config.h: + +../src/dhcp.h: + +../src/dhcpcd.h: + +../src/common.h: + +../src/interface.h: + +../src/logger.h: + +../src/socket.h: diff --git a/workspace/customdhcpcd/Debug/src/subdir.mk b/workspace/customdhcpcd/Debug/src/subdir.mk index 86fb69b..38890b3 100644 --- a/workspace/customdhcpcd/Debug/src/subdir.mk +++ b/workspace/customdhcpcd/Debug/src/subdir.mk @@ -3,14 +3,75 @@ ################################################################################ # Add inputs and outputs from these tool invocations to the build variables +O_SRCS += \ +../src/arp.o \ +../src/client.o \ +../src/common.o \ +../src/configure.o \ +../src/dhcp.o \ +../src/dhcpcd.o \ +../src/duid.o \ +../src/info.o \ +../src/interface.o \ +../src/ipv4ll.o \ +../src/logger.o \ +../src/logwriter.o \ +../src/signal.o \ +../src/socket.o + C_SRCS += \ -../src/customdhcpcd.c +../src/arp.c \ +../src/client.c \ +../src/common.c \ +../src/configure.c \ +../src/customdhcpcd.c \ +../src/dhcp.c \ +../src/dhcpcd.c \ +../src/discover.c \ +../src/duid.c \ +../src/info.c \ +../src/interface.c \ +../src/ipv4ll.c \ +../src/logger.c \ +../src/logwriter.c \ +../src/signal.c \ +../src/socket.c OBJS += \ -./src/customdhcpcd.o +./src/arp.o \ +./src/client.o \ +./src/common.o \ +./src/configure.o \ +./src/customdhcpcd.o \ +./src/dhcp.o \ +./src/dhcpcd.o \ +./src/discover.o \ +./src/duid.o \ +./src/info.o \ +./src/interface.o \ +./src/ipv4ll.o \ +./src/logger.o \ +./src/logwriter.o \ +./src/signal.o \ +./src/socket.o C_DEPS += \ -./src/customdhcpcd.d +./src/arp.d \ +./src/client.d \ +./src/common.d \ +./src/configure.d \ +./src/customdhcpcd.d \ +./src/dhcp.d \ +./src/dhcpcd.d \ +./src/discover.d \ +./src/duid.d \ +./src/info.d \ +./src/interface.d \ +./src/ipv4ll.d \ +./src/logger.d \ +./src/logwriter.d \ +./src/signal.d \ +./src/socket.d # Each subdirectory must supply rules for building sources it contributes diff --git a/workspace/customdhcpcd/src/Makefile b/workspace/customdhcpcd/src/Makefile new file mode 100644 index 0000000..13d9f28 --- /dev/null +++ b/workspace/customdhcpcd/src/Makefile @@ -0,0 +1,34 @@ +# Makefile based on BSD's pmake. +# Our mk stubs also work with GNU make. +# Copyright 2008 Roy Marples <roy@marples.name> + +PROG= dhcpcd +SRCS= arp.c client.c common.c configure.c dhcp.c dhcpcd.c duid.c \ + info.c interface.c ipv4ll.c logger.c logwriter.c signal.c socket.c +MAN= dhcpcd.8 + +VERSION= 3.2.3 +CLEANFILES= version.h dhcpcd.8 + +BINDIR= ${PREFIX}/sbin + +.SUFFIXES: .in + +MK= mk +include ${MK}/os.mk +include ${MK}/cc.mk +include ${MK}/prog.mk + +# os.mk should define this, but heh +INFOD?= /var/db + +LDADD+= ${LIBRESOLV} ${LIBRT} +CFLAGS+= -g -Wall -DINFODIR=\"${INFOD}\" ${FORK} ${RC} + +# As version.h is generated by us, hardcode the depend correctly. +${SRCS}: version.h +version.h: + echo "#define VERSION \"${VERSION}\""> version.h + +.in: + sed 's:@PREFIX@:${PREFIX}:g; s:@INFODIR@:${INFOD}:g' $< > $@ diff --git a/workspace/customdhcpcd/src/mk/cc.mk b/workspace/customdhcpcd/src/mk/cc.mk new file mode 100644 index 0000000..d52597b --- /dev/null +++ b/workspace/customdhcpcd/src/mk/cc.mk @@ -0,0 +1,23 @@ +# Copyright 2008 Roy Marples <roy@marples.name> + +# Setup some good default CFLAGS +CFLAGS?= -O2 + +# Default to using the C99 standard +CSTD?= c99 +_CSTD_SH= if test -n "${CSTD}"; then echo "-std=${CSTD}"; else echo ""; fi +_CSTD!= ${_CSTD_SH} +CFLAGS+= ${_CSTD}$(shell ${_CSTD_SH}) + +# Try and use some good cc flags +_CC_FLAGS= -pedantic -Wall -Wunused -Wimplicit -Wshadow -Wformat=2 \ + -Wmissing-declarations -Wno-missing-prototypes -Wwrite-strings \ + -Wbad-function-cast -Wnested-externs -Wcomment -Winline \ + -Wchar-subscripts -Wcast-align -Wno-format-nonliteral \ + -Wdeclaration-after-statement -Wsequence-point -Wextra +_CC_FLAGS_SH= for f in ${_CC_FLAGS}; do \ + if ${CC} $$f -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \ + then printf "%s" "$$f "; fi \ + done +_CC_FLAGS!= ${_CC_FLAGS_SH} +CFLAGS+= ${_CC_FLAGS}$(shell ${CC_FLAGS_SH}) diff --git a/workspace/customdhcpcd/src/mk/depend.mk b/workspace/customdhcpcd/src/mk/depend.mk new file mode 100644 index 0000000..a4d717a --- /dev/null +++ b/workspace/customdhcpcd/src/mk/depend.mk @@ -0,0 +1,11 @@ +# This only works for make implementations that always include a .depend if +# it exists. Only GNU make does not do this. + +# Copyright 2008 Roy Marples <roy@marples.name> + +CLEANFILES+= .depend + +.depend: ${SRCS} + ${CC} ${CFLAGS} -MM ${SRCS} > .depend + +depend: .depend diff --git a/workspace/customdhcpcd/src/mk/dist.mk b/workspace/customdhcpcd/src/mk/dist.mk new file mode 100644 index 0000000..1d3669d --- /dev/null +++ b/workspace/customdhcpcd/src/mk/dist.mk @@ -0,0 +1,11 @@ +# rules to make a distribution tarball from a git repo +# Copyright 2008 Roy Marples <roy@marples.name> + +GITREF?= HEAD +DISTPREFIX?= ${PROG}-${VERSION} +DISTFILE?= ${DISTPREFIX}.tar.bz2 + +CLEANFILES+= ${DISTFILE} + +dist: + git archive --prefix=${DISTPREFIX}/ ${GITREF} | bzip2 > ${DISTFILE} diff --git a/workspace/customdhcpcd/src/mk/man.mk b/workspace/customdhcpcd/src/mk/man.mk new file mode 100644 index 0000000..5d9bf26 --- /dev/null +++ b/workspace/customdhcpcd/src/mk/man.mk @@ -0,0 +1,14 @@ +# rules to install manpages +# Copyright 2008 Roy Marples <roy@marples.name> + +MANPREFIX?= /usr/share +MANDIR?= ${MANPREFIX}/man/man +MANMODE?= 0444 +MINSTALL?= ${INSTALL} -m ${MANMODE} + +man: ${MAN} + +# We cheat as all our pages go into section 8 +maninstall: man + ${INSTALL} -d ${DESTDIR}${MANDIR}8 + for man in ${MAN}; do ${MINSTALL} $$man ${DESTDIR}${MANDIR}8; done diff --git a/workspace/customdhcpcd/src/mk/os.mk b/workspace/customdhcpcd/src/mk/os.mk new file mode 100644 index 0000000..af173fc --- /dev/null +++ b/workspace/customdhcpcd/src/mk/os.mk @@ -0,0 +1,77 @@ +# Setup OS specific variables +# Copyright 2008 Roy Marples <roy@marples.name> + +# Work out if we need -lresolv or not +_LIBRESOLV_SH= printf '\#include <netinet/in.h>\n\#include <resolv.h>\nint main (void) { return (res_init ()); }\n' > .res_init.c; \ + if ${CC} .res_init.c -o .res_init >/dev/null 2>&1; then \ + echo ""; \ + elif ${CC} .res_init.c -lresolv -o .res_init >/dev/null 2>&1; then \ + echo "-lresolv"; \ + else \ + echo "Cannot work out how to get res_init to link" >&2; \ + rm -f .res_init.c .res_init; \ + exit 1; \ + fi; \ + rm -f .res_init.c .res_init +_LIBRESOLV!= ${_LIBRESOLV_SH} +LIBRESOLV= ${_LIBRESOLV}$(shell ${_LIBRESOLV_SH}) + +# Work out if we need -lrt or not +_LIBRT_SH= printf '\#include <time.h>\n\#include <unistd.h>\n\nint main (void) { struct timespec ts;\n\#if defined(_POSIX_MONOTONIC_CLOCK) && defined(CLOCK_MONOTONIC)\nreturn (clock_gettime (CLOCK_MONOTONIC, &ts));\n\#else\nreturn -1;\n\#endif\n}\n' > .clock_gettime.c; \ + if ${CC} .clock_gettime.c -o .clock_gettime >/dev/null 2>&1; then \ + echo ""; \ + elif ${CC} .clock_gettime.c -lrt -o .clock_gettime >/dev/null 2>&1; then \ + echo "-lrt"; \ + else \ + echo ""; \ + fi; \ + rm -f .clock_gettime.c .clock_gettime +_LIBRT!= ${_LIBRT_SH} +LIBRT= ${_LIBRT}$(shell ${_LIBRT_SH}) + +# Work out if our fork() works or not +_HAVE_FORK_SH= if test "${HAVE_FORK}" = "yes"; then \ + echo ""; \ + elif test -n "${HAVE_FORK}"; then \ + echo "-DTHERE_IS_NO_FORK"; \ + else \ + printf '\#include <stdlib.h>\n\#include <unistd.h>\nint main (void) { pid_t pid = fork(); if (pid == -1) exit (-1); exit (0); }\n' > .fork.c; \ + ${CC} .fork.c -o .fork >/dev/null 2>&1; \ + if ./.fork; then \ + echo ""; \ + else \ + echo "-DTHERE_IS_NO_FORK"; \ + fi; \ + rm -f .fork.c .fork; \ + fi; +_HAVE_FORK!= ${_HAVE_FORK_SH} +FORK= ${_HAVE_FORK}$(shell ${_HAVE_FORK_SH}) + +# info dir defaults to /var/lib/dhcpcd on Linux and /var/db elsewhere +_INFODIR_SH= if test -n "${INFODIR}"; then \ + echo "${INFODIR}"; \ + else \ + case `uname -s` in \ + Linux) echo "/var/lib/dhcpcd";; \ + *) echo "/var/db";; \ + esac \ + fi +_INFODIR!= ${_INFODIR_SH} +INFOD?= ${_INFODIR}$(shell ${_INFODIR_SH}) + +# Work out how to restart services +_RC_SH= if test -n "${HAVE_INIT}"; then \ + test "${HAVE_INIT}" = "no" || echo "-DENABLE_${HAVE_INIT}"; \ + elif test -x /sbin/runscript; then echo "-DENABLE_OPENRC"; \ + elif test -x /sbin/service; then echo "-DENABLE_SERVICE"; \ + elif test -x /etc/rc.d/rc.S -a -x /etc/rc.d/rc.M; then echo "-DENABLE_SLACKRC"; \ + elif test -d /etc/rc.d; then echo "-DENABLE_BSDRC"; \ + elif test -d /etc/init.d; then echo "-DENABLE_SYSV"; \ + fi +_RC!= ${_RC_SH} +RC= ${_RC}$(shell ${_RC_SH}) + +# glibc requires _BSD_SOURCE and _XOPEN_SOURCE +_DEF_SH= case `uname -s` in Linux) echo "-D_BSD_SOURCE -D_XOPEN_SOURCE=600";; *) echo;; esac +_DEF!= ${_DEF_SH} +CFLAGS+= ${_DEF}$(shell ${_DEF_SH}) diff --git a/workspace/customdhcpcd/src/mk/prog.mk b/workspace/customdhcpcd/src/mk/prog.mk new file mode 100644 index 0000000..6f2560c --- /dev/null +++ b/workspace/customdhcpcd/src/mk/prog.mk @@ -0,0 +1,34 @@ +# rules to build a program +# based on FreeBSD's bsd.prog.mk + +# Copyright 2008 Roy Marples <roy@marples.name> + +BINDIR?= ${PREFIX}/usr/bin +BINMODE?= 0755 +OBJS+= ${SRCS:.c=.o} + +INSTALL?= install + +all: ${PROG} ${MAN} + +${PROG}: ${SCRIPTS} ${OBJS} + ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LDADD} + +_proginstall: ${PROG} + ${INSTALL} -d ${DESTDIR}${BINDIR} + ${INSTALL} -m ${BINMODE} ${PROG} ${DESTDIR}${BINDIR} + +include ${MK}/depend.mk +include ${MK}/man.mk +include ${MK}/dist.mk + +install: _proginstall maninstall + +clean: + rm -f ${OBJS} ${PROG} ${CLEANFILES} + +LINTFLAGS?= -hx +LINTFLAGS+= -X 159,247,352 + +lint: ${SRCS:.c=.c} + ${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU]*} $^ ${.ALLSRC} |
