summaryrefslogtreecommitdiffstats
path: root/src/Makefile.housekeeping
diff options
context:
space:
mode:
authorMichael Brown2010-04-24 20:15:51 +0200
committerMichael Brown2010-04-25 02:50:46 +0200
commit58f6e553625c90d928ddd54b8f31634a5b26f05e (patch)
tree6f454e053a5788834546e73de8a15deee218d816 /src/Makefile.housekeeping
parent[romprefix] Provide indication of successful call to install_prealloc (diff)
downloadipxe-58f6e553625c90d928ddd54b8f31634a5b26f05e.tar.gz
ipxe-58f6e553625c90d928ddd54b8f31634a5b26f05e.tar.xz
ipxe-58f6e553625c90d928ddd54b8f31634a5b26f05e.zip
[build] Generate random build identifier
Randomly generate a 32-bit build identifier that can be used to identify identical iPXE ROMs when multiple such ROMs are present in a system (e.g. when a multi-function NIC exposes the same iPXE ROM image via each function's expansion ROM BAR). Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/Makefile.housekeeping')
-rw-r--r--src/Makefile.housekeeping9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
index a7162e6f..685b6d6e 100644
--- a/src/Makefile.housekeeping
+++ b/src/Makefile.housekeeping
@@ -686,13 +686,18 @@ $(BLIB) : $(BLIB_OBJS) $(BLIB_LIST) $(MAKEDEPS)
$(Q)$(RANLIB) $@
blib : $(BLIB)
+# Command to generate build ID. Must be unique for each $(BIN)/%.tmp,
+# even within the same build run.
+#
+BUILD_ID_CMD := perl -e 'printf "0x%08x", int ( rand ( 0xffffffff ) );'
+
# Build an intermediate object file from the objects required for the
# specified target.
#
-$(BIN)/%.tmp : $(BLIB) $(MAKEDEPS) $(LDSCRIPT)
+$(BIN)/%.tmp : $(BLIB) $(MAKEDEPS) $(LDSCRIPT)
$(QM)$(ECHO) " [LD] $@"
$(Q)$(LD) $(LDFLAGS) -T $(LDSCRIPT) $(TGT_LD_FLAGS) $(BLIB) -o $@ \
- -Map $(BIN)/$*.tmp.map
+ --defsym _build_id=`$(BUILD_ID_CMD)` -Map $(BIN)/$*.tmp.map
$(Q)$(OBJDUMP) -ht $@ | $(SORTOBJDUMP) >> $(BIN)/$*.tmp.map
# Keep intermediate object file (useful for debugging)