mirror of
https://github.com/matrix-construct/construct
synced 2024-11-17 07:20:55 +01:00
Generate include/serno.h from the hg revision data.
The code is inspired by the code in atheme-services, but * it uses 'hg parents' instead of 'hg tip' so it will also work if the working directory is not updated to the latest version in the local repository * the format is different (date-shorthash instead of revnum:shorthash) * some sort of serno.h is always generated, be it "unknown" only
This commit is contained in:
parent
7478545cb2
commit
014e2aa049
2 changed files with 6 additions and 1 deletions
|
@ -66,6 +66,11 @@ build:
|
||||||
echo "Doing so now."; \
|
echo "Doing so now."; \
|
||||||
sh configure; \
|
sh configure; \
|
||||||
fi
|
fi
|
||||||
|
@if [ -d .hg ] ; then \
|
||||||
|
revh=`hg parents --template '#date|shortdate#_#node|short#' 2>/dev/null | sed -e s/-//g -e s/_/-/`;\
|
||||||
|
[ -z "$$revh" ] || echo '#define SERNO "'$$revh'"' >include/serno.h ; \
|
||||||
|
fi
|
||||||
|
@[ -f include/serno.h ] || echo '#define SERNO "unknown"' >include/serno.h
|
||||||
@for i in $(SUBDIRS); do \
|
@for i in $(SUBDIRS); do \
|
||||||
echo "build ==> $$i";\
|
echo "build ==> $$i";\
|
||||||
cd $$i;\
|
cd $$i;\
|
||||||
|
@ -94,6 +99,7 @@ distclean:
|
||||||
done
|
done
|
||||||
|
|
||||||
depend:
|
depend:
|
||||||
|
@[ -f include/serno.h ] || echo '#define SERNO "unknown"' >include/serno.h
|
||||||
@for i in $(SUBDIRS); do \
|
@for i in $(SUBDIRS); do \
|
||||||
echo "depend ==> $$i";\
|
echo "depend ==> $$i";\
|
||||||
cd $$i;\
|
cd $$i;\
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
#define SERNO "20071120-3584"
|
|
Loading…
Reference in a new issue