From 42e706a85cc52fded05e2f231dcd45de157e86eb Mon Sep 17 00:00:00 2001 From: Martin Stjernholm <mast@lysator.liu.se> Date: Thu, 29 Apr 1999 11:37:45 +0200 Subject: [PATCH] Handle and cache arbitrary configure args. Rev: Makefile:1.7 --- Makefile | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 71d68847a7..0c224041f3 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile,v 1.6 1999/03/09 14:41:38 mast Exp $ +# $Id: Makefile,v 1.7 1999/04/29 09:37:45 mast Exp $ # # Meta Makefile # @@ -11,22 +11,28 @@ OS=`uname -srm|sed -e 's/ /-/g'|tr '[A-Z]' '[a-z]'|tr '/' '_'` BUILDDIR=build/$(OS) METATARGET= +# Use this to pass arguments to configure. Leave empty to keep previous args. +CONFIGUREARGS= + # Used to avoid make compatibility problems. BIN_TRUE=":" all: bin/pike compile -@$(BIN_TRUE) +force: + -@$(BIN_TRUE) + src/configure: src/configure.in cd src && ./run_autoconfig . 2>&1 | grep -v warning - -@(cd "$(BUILDDIR)" && rm -f Makefile .prefix-h) + -@(cd "$(BUILDDIR)" 2>/dev/null && rm -f Makefile .configureargs || :) force_configure: cd src && ./run_autoconfig . 2>&1 | grep -v warning + -@(cd "$(BUILDDIR)" 2>/dev/null && rm -f Makefile .configureargs || :) -configure: src/configure +builddir: @builddir="$(BUILDDIR)"; \ - srcdir=`pwd`/src; \ ( \ IFS='/'; dir=""; \ for d in $$builddir; do \ @@ -34,13 +40,28 @@ configure: src/configure test -z "$$dir" -o -d "$$dir" || mkdir "$$dir" || exit 1; \ dir="$$dir/"; \ done \ - ) && \ - cd "$$builddir" && \ - if test -f Makefile -a -f .prefix-h && test "`cat .prefix-h`" = "$(prefix)"; then :; else \ - echo Running "$$srcdir"/configure in "$$builddir"; \ - CONFIG_SITE=x "$$srcdir"/configure --prefix=$(prefix) $(CONFIGFLAGS) && \ - ( echo "$(prefix)" > .prefix-h; rm -f main.o; :; ) \ - fi + ) + +configure: src/configure builddir + @builddir="$(BUILDDIR)"; \ + srcdir=`pwd`/src; \ + cd "$$builddir" && ( \ + if test -f .configureargs -a -z "$(CONFIGUREARGS)"; then \ + configureargs="`cat .configureargs`"; \ + else \ + configureargs="--prefix=$(prefix) $(CONFIGUREARGS)"; \ + fi; \ + if test -f Makefile -a -f config.cache -a -f .configureargs && \ + test "`cat .configureargs`" = "$$configureargs"; then :; \ + else \ + echo Running "$$srcdir"/configure $$configureargs in "$$builddir"; \ + CONFIG_SITE=x "$$srcdir"/configure $$configureargs && ( \ + echo "$$configureargs" > .configureargs; \ + $(MAKE) clean > /dev/null; \ + : \ + ) \ + fi \ + ) compile: configure @builddir="$(BUILDDIR)"; \ @@ -52,9 +73,6 @@ compile: configure $(MAKE) all $$metatarget || ( test -f remake && $(MAKE) all $$metatarget ) \ ) -force: - -@$(BIN_TRUE) - bin/pike: force sed -e "s|\"BASEDIR\"|\"`pwd`\"|" < bin/pike.in > bin/pike chmod a+x bin/pike -- GitLab