]> git.donarmstrong.com Git - lilypond.git/blobdiff - make/stepmake.make
patch::: 1.3.45.jcn1
[lilypond.git] / make / stepmake.make
index 835f6907a4fa21de789a015cccdda0c14adc3a49..92ce216398ec3de92873319940397991d000b68d 100644 (file)
@@ -8,22 +8,57 @@ ifeq (0,${MAKELEVEL})
 endif
 .SUFFIXES:
 
+# Use alternate configurations alongside eachother:
+#
+#     ./configure --enable-configsuffix=debug
+#     make conf=debug
+#
+# uses config-debug.make and config-debug.h; output goes to out-debug.
+#
+ifdef conf
+  CONFIGSUFFIX=-$(conf)
+endif
+
+# Use same configuration, but different output directory:
+#
+#     make out=www
+#
+# uses config.make and config.h; output goes to out-www.
+#
+ifdef out
+  outbase=out-$(out)
+else
+  outbase=out$(CONFIGSUFFIX)
+endif
 
-ifndef config
-  configuration=config
+ifdef config
+  configuration=$(config)
 else
-  configuration=config-$(config)
+  ifeq ($(builddir),.)
+    configuration=$(depth)/config$(CONFIGSUFFIX).make
+  else
+    # user package
+    configuration=$(depth)/$(builddir)/config$(CONFIGSUFFIX).make
+    # stepmake package
+    #configuration=$(depth)/../$(builddir)/stepmake/config$(CONFIGSUFFIX).make
+  endif
 endif
 
-include $(depth)/$(configuration).make
+include $(configuration)
 
-ifdef CONFIGSUFFIX
-outdir=out-$(CONFIGSUFFIX)
+ifeq ($(builddir),.)
+  outroot=.
 else
-outdir=out
+  outroot=$(depth)/$(builddir)/$(patsubst $(shell cd $(depth); pwd)%,%,$(shell cd .; pwd))
 endif
 
-stepdir = $(depth)/$(stepmake)/stepmake
+outdir=$(outroot)/$(outbase)
+config_h=$(depth)/$(builddir)/config$(CONFIGSUFFIX).h
+
+# user package
+stepdir = $(stepmake)/stepmake
+# for stepmake package
+# stepdir = $(depth)/stepmake
 
 STEPMAKE_TEMPLATES := generic $(STEPMAKE_TEMPLATES) 
 LOCALSTEPMAKE_TEMPLATES:= generic $(LOCALSTEPMAKE_TEMPLATES)
@@ -31,6 +66,11 @@ LOCALSTEPMAKE_TEMPLATES:= generic $(LOCALSTEPMAKE_TEMPLATES)
 
 all:
 
+-include $(addprefix $(depth)/make/,$(addsuffix -inclusions.make, $(LOCALSTEPMAKE_TEMPLATES)))
+
+-include $(addprefix $(stepdir)/,$(addsuffix -inclusions.make, $(STEPMAKE_TEMPLATES)))
+
+
 include $(addprefix $(stepdir)/,$(addsuffix -vars.make, $(STEPMAKE_TEMPLATES)))
 
 # ugh. need to do this because of PATH :=$(topdir)/..:$(PATH)