]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Redo BUILDID stuff for pmake.
authorChris Porter <redacted>
Sun, 16 Mar 2008 21:37:08 +0000 (21:37 +0000)
committerChris Porter <redacted>
Sun, 16 Mar 2008 21:37:08 +0000 (21:37 +0000)
build.mk.in
lib/version.h

index d2e335cc7de1173c42767d1b87baaa556ed33a09..e15ef6a46f32082c5a1cf5a54d3570f1e174378a 100644 (file)
@@ -1,16 +1,13 @@
-ifeq ($(INCPATH),)
+@ifndef@ INCPATH
 INCPATH=../
-endif
+@endif@
 
 @include@ @includel@$(INCPATH)configure.mk@includel@
 @sinclude@ @includel@$(INCPATH)settings.mk@includel@
 
-ifeq ($(BUILDID),)
-BUILDID := \"$(shell (hg id || echo "unknown") | sed -e "s/ /-/;s/+-/-/")\"
-export BUILDID
-endif
+@ifndef@ BUILDID
+BUILDID @shell@ (hg id || echo "unknown") | sed -e "s/+ /-/" @shellend@
+@endif@
 
 CC=gcc
-CFLAGS+=-Wall -g -fPIC -export-dynamic -finline-functions -funroll-loops -std=c99 -I./ -DBUILDID=${BUILDID}
-
-export CC CFLAGS
+CFLAGS+=-Wall -g -fPIC -export-dynamic -finline-functions -funroll-loops -std=c99 -I./ -DBUILDID=$(BUILDID)
index 532b4226aae23b8b34478f8448b97d846abc0ff7..582ec971fc12c13e4d38a2013c38c64c68f1f8a1 100644 (file)
@@ -3,9 +3,11 @@
 #define __VERSION_H
 
 #ifndef BUILDID
-#define BUILDID "unknown"
+#define _BUILDID "unknown"
+#else
+#define _BUILDID "BUILDID"
 #endif
 
-#define MODULE_VERSION(id) const char *_version(void) { return (id[0]=='\0')?BUILDID:(id "/" BUILDID); };
+#define MODULE_VERSION(id) const char *_version(void) { return (id[0]=='\0')?_BUILDID:(id "/" _BUILDID); };
 
 #endif