# Copyright 2008 Roy Marples <roy@marples.name>
PROG= dhcpcd
-VERSION= 4.0.0-beta3
-
SRCS= common.c dhcp.c dhcpcd.c logger.c net.c signals.c
SRCS+= configure.c client.c
SRCS+= ${SRC_IF} ${SRC_SOCKET}
MK= mk
include ${MK}/prog.mk
-CFLAGS+= -DVERSION=\"${VERSION}\"
CFLAGS+= -DSYSCONFDIR=\"${SYSCONFDIR}\"
CFLAGS+= -DDBDIR=\"${DBDIR}\"
LDADD+= ${LIBRT}
#ifndef CONFIG_H
#define CONFIG_H
+#define PACKAGE "dhcpcd"
+#define VERSION "4.0.0-beta4"
+
/* You can enable/disable various chunks of optional code here.
* You would only do this to try and shrink the end binary if dhcpcd
* was running on a low memory device */
/* Some systems do not have a working fork. */
/* #define THERE_IS_NO_FORK */
-/* Packname name and pathname definitions. */
-#define PACKAGE "dhcpcd"
-
+/* Paths to things */
#ifndef SYSCONFDIR
# define SYSCONFDIR "/etc/" PACKAGE
#endif
CLEANFILES+= ${DISTFILE}
+_VERSION_SH= sed -n 's/\#define VERSION[[:space:]]*"\(.*\)".*/\1/p' config.h
+_VERSION!= ${_VERSION_SH}
+VERSION= ${_VERSION}$(shell ${_VERSION_SH})
+
dist:
git archive --prefix=${DISTPREFIX}/ ${GITREF} | bzip2 > ${DISTFILE}