]> git.ipfire.org Git - oddments/ipfire-netboot.git/blobdiff - Makefile
Use our own versioning field to make upgrades easier
[oddments/ipfire-netboot.git] / Makefile
index a0af61d66455e9115fb6f0c1fa9d450a78d88387..cfc3d1849fbf1e04bd00842cfbde23d1e32e487c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,22 +1,35 @@
 
-SCRIPTS = $(CURDIR)/ipfireboot.gpxe
+VERSION = 2.0
 
-TARGETS = bin/gpxe.iso bin/gpxe.kpxe bin/undionly.kpxe bin/gpxe.dsk \
-       bin/gpxe.usb bin/gpxe.lkrn
+SCRIPTS = $(CURDIR)/ipfireboot.ipxe
+MACHINE = $(shell uname -m)
 
+TARGETS = bin/ipxe.iso bin/ipxe.kpxe bin/undionly.kpxe bin/ipxe.dsk \
+       bin/ipxe.usb bin/ipxe.lkrn
+
+ifeq "$(MACHINE)" "x86_64"
+       TARGETS += bin-x86_64-efi/ipxe.efi
+endif
+
+.PHONY: all
 all: $(TARGETS)
 
 clean:
-       rm -rfv $(TARGETS)
-       make -C gpxe/src clean
+       rm -rfv $(SCRIPTS) $(TARGETS)
+       make -C ipxe/src clean veryclean
+
+%: %.in
+       sed -e "s/@VERSION@/$(VERSION)/g" \
+               < $< > $@
 
-$(TARGETS):
+$(TARGETS): $(SCRIPTS) config/branding.h config/general.h
        # Copy our configuration to the gPXE submodule
-       cp -uvf config/* gpxe/src/config/local/
+       cp -vf config/* ipxe/src/config/local/
 
        # Build the image
-       make -C gpxe/src EMBEDDED_IMAGE=$(SCRIPTS) $@
+       make -C ipxe/src EMBED=$(SCRIPTS) NO_WERROR=1 \
+               ISOLINUX_BIN=/usr/share/syslinux/isolinux.bin $@
 
        # Copy the image to bin/
        -mkdir -pv $$(dirname $@)
-       cp -vf gpxe/src/$@ $@
+       cp -vf ipxe/src/$@ $@