Skip to content
Snippets Groups Projects
Commit 42e706a8 authored by Martin Stjernholm's avatar Martin Stjernholm
Browse files

Handle and cache arbitrary configure args.

Rev: Makefile:1.7
parent 9559db32
Branches
Tags
No related merge requests found
#
# $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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment