Move VERSION from Makefile to config.h so that other Makefiles can be used instead of our own.

This commit is contained in:
Roy Marples 2008-05-19 13:36:06 +00:00
parent 0788461c46
commit 7b15d336d9
3 changed files with 8 additions and 6 deletions

View File

@ -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}

View File

@ -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

View 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}