Makefile: Misc Makefile cleanups
authorJohn 'Warthog9' Hawley <warthog9@eaglescrag.net>
Thu, 1 Oct 2009 00:54:08 +0000 (17:54 -0700)
committerJohn 'Warthog9' Hawley <warthog9@eaglescrag.net>
Thu, 1 Oct 2009 00:54:08 +0000 (17:54 -0700)
This is just a few makefile cleanups, and enabling the live images
to be built via make.  It's not perfect, but nothing ever is.  If
it's in the repository we stand a better chance of getting it
fixed later.

bko/Makefile
bko/live/Makefile [new file with mode: 0644]
bko/live/live.conf
bko/live/live.tmpl [new file with mode: 0755]

index a530124..cdce0a4 100644 (file)
@@ -3,11 +3,11 @@ SHELL = /bin/bash
 PWD := $(shell pwd)
 
 
-ifndef CONFIG
-CONFIG=config
+ifndef BKO_CONFIG
+BKO_CONFIG=config
 endif
 
--include $(CONFIG)
+-include $(BKO_CONFIG)
 
 ABSPATH = 
 
@@ -15,16 +15,18 @@ export BKOPREFIX
 
 #.SILENT:
 
-all: make_statement
+DIRS = live
 
-bko: $(SUPPORTDIRS) $(GPXEDIR)
+all: make_statement $(DIRS)
+
+bko: $(DIRS)
 
 clean: make_statement $(patsubst %,%.clean,$(DIRS))
 
 make_statement:
        echo "  Working on building the bko menuing system"
 
-$(patsubst %,%.build,$(DIRS)): make_statement
+$(DIRS): make_statement
        $(MAKE) $(MFLAGS) -C $@ -f Makefile
 
 $(patsubst %,%.clean,$(DIRS)):
diff --git a/bko/live/Makefile b/bko/live/Makefile
new file mode 100644 (file)
index 0000000..20b0833
--- /dev/null
@@ -0,0 +1,39 @@
+SHELL = /bin/bash
+
+#.SILENT:
+
+DIRS = debian dsl fedora knoppix ubuntu
+
+configfile = MENU INCLUDE @CONFIGFILE@ @DISTRO@\n
+
+all: make_statement configfile $(DIRS)
+
+make_statement:
+       echo "--> Generating Live Image Menus"
+
+configfile: $(DIRS) live.conf
+live.conf: $(subst %,%/%.conf,$(DIRS)) live.tmpl
+       _SUBDIR="\/live"; \
+       cat live.tmpl > $@; \
+        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
+
index 219a3ba..1bd2d62 100755 (executable)
@@ -18,8 +18,8 @@ label uplvl
 label spacer
        MENU LABEL
 
-menu include live/debian/debian.conf Debian
-menu include live/ubuntu/ubuntu.conf Ubuntu
-menu include live/knoppix/knoppix.conf Knoppix
-menu include live/dsl/dsl.conf Damn Small Linux
-menu include live/fedora/red_hat.conf Fedora
+MENU INCLUDE /live/debian/debian.conf debian
+MENU INCLUDE /live/dsl/dsl.conf dsl
+MENU INCLUDE /live/fedora/fedora.conf fedora
+MENU INCLUDE /live/knoppix/knoppix.conf knoppix
+MENU INCLUDE /live/ubuntu/ubuntu.conf ubuntu
diff --git a/bko/live/live.tmpl b/bko/live/live.tmpl
new file mode 100755 (executable)
index 0000000..23bfdf3
--- /dev/null
@@ -0,0 +1,20 @@
+MENU INCLUDE bko-gui.conf
+PROMPT 0
+MENU TITLE --== Live Images ==--
+MENU LABEL ^Live Images
+
+TEXT HELP
+               These are Live, immediately bootable, operating systems.
+               They provide an easy way to try out, test a distribution on
+               your hardware or help you recover your system.
+
+               Includes: Damn Small Linux, Debian, Knoppix, Fedora & Ubuntu
+ENDTEXT
+
+label uplvl
+       MENU LABEL Return
+       MENU EXIT
+
+label spacer
+       MENU LABEL
+