]> git.donarmstrong.com Git - lilypond.git/blobdiff - stepmake/make/stepmake.make
patch::: 1.3.37.jcn2
[lilypond.git] / stepmake / make / stepmake.make
index 3c7dade6d78e94a61627123c8d5a7d907b42a066..1130415d69bdf696d5818568d5cb2ab3e835ffff 100644 (file)
@@ -8,24 +8,56 @@ 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
 
-ifndef config
-  configuration=config
+# 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
-  configuration=config-$(config)
+  outbase=out$(CONFIGSUFFIX)
 endif
 
-include $(depth)/$(configuration).make
+ifdef config
+  configuration=$(config)
+else
+  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
 
-ifdef CONFIGSUFFIX
-outdir=out-$(CONFIGSUFFIX)
+include $(configuration)
+
+ifeq ($(builddir),.)
+  outroot=.
 else
-outdir=out
+  outroot=$(depth)/$(builddir)/$(patsubst $(shell cd $(depth); pwd)%,%,$(shell cd .; pwd))
 endif
 
+outdir=$(outroot)/$(outbase)
+config_h=$(depth)/$(builddir)/config$(CONFIGSUFFIX).h
+
 # user package
 # stepdir = $(stepmake)/stepmake
-# for stepmake packageg
+# for stepmake package
 stepdir = $(depth)/stepmake
 
 STEPMAKE_TEMPLATES := generic $(STEPMAKE_TEMPLATES)