diff options
author | schnetter <schnetter@83718e91-0e4f-0410-abf4-91180603181f> | 2005-05-29 14:03:38 +0000 |
---|---|---|
committer | schnetter <schnetter@83718e91-0e4f-0410-abf4-91180603181f> | 2005-05-29 14:03:38 +0000 |
commit | 08de25904f7d64a31d31ac8e70ca6df2d33ad004 (patch) | |
tree | bfc9f5bd664a0d3d8fc00e6898aafc8d85334f92 /src/make.configuration.deps | |
parent | 3996f4dec8488695fd5ab2a245b7b1ceec4651c5 (diff) |
Create a unique ID for each build
git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/Formaline/trunk@22 83718e91-0e4f-0410-abf4-91180603181f
Diffstat (limited to 'src/make.configuration.deps')
-rw-r--r-- | src/make.configuration.deps | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/make.configuration.deps b/src/make.configuration.deps index 2efcc08..5b694e6 100644 --- a/src/make.configuration.deps +++ b/src/make.configuration.deps @@ -14,7 +14,7 @@ CACTUSLIBLINKLINE += $(TARBALL_DIR)/cactus-source.a $(EXEDIR)$(DIRSEP)$(EXE): $(TARBALL_DIR)/cactus-source.a -$(TARBALL_DIR)/cactus-source.a: $(TARBALL_DIR)/cactus-meta-source.o $(TARBALL_DIR)/cactus-flesh-source.o $(patsubst %,$(TARBALL_DIR)/cactus-thorn-source-%.o,$(notdir $(THORNS))) +$(TARBALL_DIR)/cactus-source.a: $(TARBALL_DIR)/cactus-meta-source.o $(TARBALL_DIR)/build-id.o $(TARBALL_DIR)/cactus-flesh-source.o $(patsubst %,$(TARBALL_DIR)/cactus-thorn-source-%.o,$(notdir $(THORNS))) $(AR) $(ARFLAGS) $@ $^ @echo $(DIVIDER) @@ -26,6 +26,29 @@ $(TARBALL_DIR)/cactus-source.a: $(TARBALL_DIR)/cactus-meta-source.o $(TARBALL_DI +# Unique ID for the build +$(TARBALL_DIR)/build-id.o: $(TARBALL_DIR)/build-id.c + $(CC) $(CFLAGS) -c -o $@ $^ + +# (force a new to be created every time) +.PHONY: $(TARBALL_DIR)/build-id.c +$(TARBALL_DIR)/build-id.c: + { \ + echo '/* This is an auto-generated file -- do not edit */'; \ + hostname=`hostname`; \ + user="$$USER"; \ + timestamp=`date +%Y%m%d-%H%M%S`; \ + pid="$$$$"; \ + id="build-$$hostname-$$USER-$$timestamp-$$pid"; \ + echo 'static char const build_id[] = "'$id'";'; \ + echo 'char const * Formaline_BuildID (void)'; \ + echo '{'; \ + echo ' return build_id;'; \ + echo '}'; \ + } > $@ + + + # Meta information $(TARBALL_DIR)/cactus-meta-source.o: $(TARBALL_DIR)/cactus-meta-source.c $(CC) $(CFLAGS) -c -o $@ $^ |