]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Move VERSION from Makefile to config.h so that other Makefiles can be used instead...
authorRoy Marples <roy@marples.name>
Mon, 19 May 2008 13:36:06 +0000 (13:36 +0000)
committerRoy Marples <roy@marples.name>
Mon, 19 May 2008 13:36:06 +0000 (13:36 +0000)
Makefile
config.h
mk/dist.mk

index 7c85915381168f98716f3f40e782f5954150ce44..e766368f159584f0eeec2422d612b0d3adf70f21 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,8 +3,6 @@
 # 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}
@@ -22,7 +20,6 @@ SYSCONFDIR?=  ${PREFIX}/etc/${PROG}
 MK=            mk
 include ${MK}/prog.mk
 
-CFLAGS+=       -DVERSION=\"${VERSION}\"
 CFLAGS+=       -DSYSCONFDIR=\"${SYSCONFDIR}\"
 CFLAGS+=       -DDBDIR=\"${DBDIR}\"
 LDADD+=                ${LIBRT}
index 5ee756fc0e9c791d53f0497e285d3eb0abaf90cc..1dd3e0adb747af57506c9447b79a5d7d81f14988 100644 (file)
--- a/config.h
+++ b/config.h
@@ -27,6 +27,9 @@
 #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 */
@@ -56,9 +59,7 @@
 /* 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
index 1d3669da5a6a5c00f506cce6b81b7abeb138a6eb..5cab22222964aacd679982605677825e01dddc93 100644 (file)
@@ -7,5 +7,9 @@ DISTFILE?=      ${DISTPREFIX}.tar.bz2
 
 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}