summaryrefslogtreecommitdiffstats
path: root/src/Makefile.housekeeping
diff options
context:
space:
mode:
authorMichael Brown2014-06-26 17:25:18 +0200
committerMichael Brown2014-06-26 17:43:59 +0200
commitc2f0769338486cfbca0ed545b84bc1f516e1844e (patch)
treeff5de728473d9d06be1aa6fe8f49fe88a1b8b464 /src/Makefile.housekeeping
parent[efi] Restructure EFI driver model (diff)
downloadipxe-c2f0769338486cfbca0ed545b84bc1f516e1844e.tar.gz
ipxe-c2f0769338486cfbca0ed545b84bc1f516e1844e.tar.xz
ipxe-c2f0769338486cfbca0ed545b84bc1f516e1844e.zip
[build] Fix erroneous object name in version object
Commit 8290a95 ("[build] Expose build timestamp, build name, and product names") introduced a regression in the build process which resulted in broken final binaries which had names based on object files (e.g. "undionly.kpxe" or "intel.rom") rather than on device IDs (e.g. "8086100e.mrom"). The underlying problem is the -DOBJECT=<name> macro which is used to generate the obj_<name> symbols used to select objects required for the final binary. The macro definition is derived from the initial portion (up to the first dot) of the object being built. In the case of e.g. undionly.kpxe.version.o, this gives -DOBJECT=undionly. This results in undionly.kpxe.version.o claiming to be the "undionly" object; the real "undionly" object will therefore never get dragged in to the build. Fix by renaming $(BIN)/%.version.o to $(BIN)/version.%.o, so that the object is always built with -DOBJECT=version (as might be expected, since it is built from core/version.c). Final binaries which have names based on device IDs (such as "8086100e.mrom") are not affected by this problem, since the object name "8086100e" will not conflict with that of the underlying "intel" object. This problem was not detected by the per-commit smoke testing procedure, which happens to use the binary bin/8086100e.mrom. Reported-by: Christian Hesse <list@eworm.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/Makefile.housekeeping')
-rw-r--r--src/Makefile.housekeeping4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
index 1b2a9b97..0dce8d06 100644
--- a/src/Makefile.housekeeping
+++ b/src/Makefile.housekeeping
@@ -998,7 +998,7 @@ BUILD_TIMESTAMP := $(shell date +%s)
# Build version
#
GIT_INDEX := $(if $(GITVERSION),$(if $(wildcard ../.git/index),../.git/index))
-$(BIN)/%.version.o : core/version.c $(MAKEDEPS) $(GIT_INDEX)
+$(BIN)/version.%.o : core/version.c $(MAKEDEPS) $(GIT_INDEX)
$(QM)$(ECHO) " [VERSION] $@"
$(Q)$(COMPILE_c) -DBUILD_NAME="\"$*\"" \
-DVERSION_MAJOR=$(VERSION_MAJOR) \
@@ -1010,7 +1010,7 @@ $(BIN)/%.version.o : core/version.c $(MAKEDEPS) $(GIT_INDEX)
# Build an intermediate object file from the objects required for the
# specified target.
#
-$(BIN)/%.tmp : $(BIN)/%.version.o $(BLIB) $(MAKEDEPS) $(LDSCRIPT)
+$(BIN)/%.tmp : $(BIN)/version.%.o $(BLIB) $(MAKEDEPS) $(LDSCRIPT)
$(QM)$(ECHO) " [LD] $@"
$(Q)$(LD) $(LDFLAGS) -T $(LDSCRIPT) $(TGT_LD_FLAGS) $< $(BLIB) -o $@ \
--defsym _build_id=`$(BUILD_ID_CMD)` \