pxeknife/boot_managers/Makefile
John 'Warthog9' Hawley cac4156140 Menuing / Makefiles / Configuration - Work to flip over to using menu include instead of recalling menu
This is pretty self explanitory - flipping over to using menu include directive
instead of re-calling and re-downloading everything for vesamenu.c32
2015-03-18 23:29:21 -07:00

59 lines
1.5 KiB
Makefile

SHELL = /bin/bash
.SILENT:
ifdef CONFIG
include $(CONFIG)
NEWCONFIG="../$(CONFIG)"
else
NEWCONFIG=""
endif
ifdef SUPERGRUBDISK
DIRS := $(DIRS) supergrub
endif
#configfile = label @LABEL@\n \
# \tMENU LABEL @DISTRO@ \n \
# \tKERNEL menu.c32 \n \
# \tAPPEND @CONFIGFILE@\n
configfile = MENU INCLUDE @CONFIGFILE@ @DISTRO@\n
all: make_statement configfile $(DIRS)
make_statement:
echo "--> Making Boot Managers"
configfile: $(DIRS) boot_managers.conf
boot_managers.conf: $(subst %,%/%.conf,$(DIRS))
cat /dev/null > $@; \
_SUBDIR="$(shell echo "$(PXEKNIFEPREFIX)/$(ABSPATH)" | sed -e 's/\/\//\//gi' -e s'/\//\\\//gi' )"; \
_BASEDIR="$(PXEKNIFEPREFIX)/"; \
echo "MENU INCLUDE $${_BASEDIR}/pxeknife-gui.conf" >> $@; \
echo "MENU TITLE Boot Managers" >> $@; \
echo "label UpDir" >> $@; \
echo " MENU EXIT" >> $@; \
echo "label blankspace" >> $@; \
echo " MENU LABEL " >> $@; \
for x in $(DIRS); \
do \
if [[ -e "$${x}/$${x}.conf" ]]; \
then \
echo "~~ $${x}"; \
printf "$(configfile)" | \
sed \
-e "s/@DISTRO@/$${x}/" \
-e "s/@CONFIGFILE@/$${_SUBDIR}\/$${x}\/$${x}.conf/" \
-e "s/@LABEL@/$${x}/" >> $@; \
fi \
done
$(DIRS): make_statement
$(MAKE) $(MFLAGS) ABSPATH="$(ABSPATH)/$@" CONFIG="$(NEWCONFIG)" -C $@ -f Makefile
clean: make_statement $(patsubst %,%.clean,$(DIRS))
-rm -rf *.conf
$(patsubst %,%.clean,$(DIRS)):
$(MAKE) $(MFLAGS) ABSPATH="$(ABSPATH)/$@" CONFIG="$(NEWCONFIG)" -C $(patsubst %.clean,%,$@) -f Makefile clean