~ chicken-core (chicken-5) ee5af60c5d9b09a7acb180de6ac1652b8b0af9b6
commit ee5af60c5d9b09a7acb180de6ac1652b8b0af9b6
Author: unknown <felix@.(none)>
AuthorDate: Wed Nov 4 09:49:01 2009 +0100
Commit: unknown <felix@.(none)>
CommitDate: Wed Nov 4 09:49:01 2009 +0100
allow using config-file for make variables
diff --git a/Makefile b/Makefile
index fb2816e0..947963ac 100644
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,11 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+
+ifneq ($(CONFIG),)
+include $(CONFIG)
+endif
+
STANDARD_TARGETS \
= all clean distclean spotless install uninstall confclean check \
fullcheck dist libs bootstrap
@@ -51,28 +56,28 @@ $(STANDARD_TARGETS):
@exit 1
else
all:
- $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) all
+ $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) all
clean:
- $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) clean
+ $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) clean
distclean:
- $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) distclean
+ $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) distclean
spotless:
- $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) spotless
+ $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) spotless
install:
- $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) install
+ $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) install
uninstall:
- $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) uninstall
+ $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) uninstall
confclean:
- $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) confclean
+ $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) confclean
check:
- $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) check
+ $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) check
fullcheck:
- $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) fullcheck
+ $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) fullcheck
dist:
- $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) distfiles
+ $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) distfiles
csi -s scripts/makedist.scm
libs:
- $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) libs
+ $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) libs
bootstrap:
- $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) bootstrap
+ $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) bootstrap
endif
diff --git a/Makefile.bsd b/Makefile.bsd
index 84307e27..8151479e 100644
--- a/Makefile.bsd
+++ b/Makefile.bsd
@@ -25,6 +25,10 @@
# POSSIBILITY OF SUCH DAMAGE.
+ifneq ($(CONFIG),)
+include $(CONFIG)
+endif
+
SRCDIR = ./
# platform configuration
diff --git a/Makefile.cross-linux-mingw b/Makefile.cross-linux-mingw
index 1f246059..7ebb077d 100644
--- a/Makefile.cross-linux-mingw
+++ b/Makefile.cross-linux-mingw
@@ -25,6 +25,10 @@
# POSSIBILITY OF SUCH DAMAGE.
+ifneq ($(CONFIG),)
+include $(CONFIG)
+endif
+
SRCDIR = ./
# platform configuration
diff --git a/Makefile.cygwin b/Makefile.cygwin
index 5c693c4c..33a8fb07 100644
--- a/Makefile.cygwin
+++ b/Makefile.cygwin
@@ -25,6 +25,10 @@
# POSSIBILITY OF SUCH DAMAGE.
+ifneq ($(CONFIG),)
+include $(CONFIG)
+endif
+
SRCDIR = ./
# platform configuration
diff --git a/Makefile.linux b/Makefile.linux
index c8506b9c..dc3f320e 100644
--- a/Makefile.linux
+++ b/Makefile.linux
@@ -25,6 +25,10 @@
# POSSIBILITY OF SUCH DAMAGE.
+ifneq ($(CONFIG),)
+include $(CONFIG)
+endif
+
SRCDIR ?= ./
# platform configuration
diff --git a/Makefile.macosx b/Makefile.macosx
index bf3f59ea..eb849cd8 100644
--- a/Makefile.macosx
+++ b/Makefile.macosx
@@ -25,6 +25,10 @@
# POSSIBILITY OF SUCH DAMAGE.
+ifneq ($(CONFIG),)
+include $(CONFIG)
+endif
+
SRCDIR = ./
# platform configuration
diff --git a/Makefile.mingw b/Makefile.mingw
index 30962fd2..2714debf 100644
--- a/Makefile.mingw
+++ b/Makefile.mingw
@@ -25,6 +25,10 @@
# POSSIBILITY OF SUCH DAMAGE.
+ifneq ($(CONFIG),)
+include $(CONFIG)
+endif
+
SEP = $(strip \)
SRCDIR =.$(SEP)
diff --git a/Makefile.mingw-msys b/Makefile.mingw-msys
index caa54943..5379c16b 100644
--- a/Makefile.mingw-msys
+++ b/Makefile.mingw-msys
@@ -25,6 +25,10 @@
# POSSIBILITY OF SUCH DAMAGE.
+ifneq ($(CONFIG),)
+include $(CONFIG)
+endif
+
SRCDIR = ./
# platform configuration
diff --git a/Makefile.solaris b/Makefile.solaris
index 8987282a..6d90072a 100644
--- a/Makefile.solaris
+++ b/Makefile.solaris
@@ -25,6 +25,10 @@
# POSSIBILITY OF SUCH DAMAGE.
+ifneq ($(CONFIG),)
+include $(CONFIG)
+endif
+
SRCDIR = ./
# platform configuration
diff --git a/README b/README
index 0d3101ff..7c4457c6 100644
--- a/README
+++ b/README
@@ -174,6 +174,12 @@
When VARDIR is specified, extensions will be stored in
"<VARDIR>/chicken/<BINARYVERSION>", conforming to the FHS.
+ CONFIG=
+ If you build CHICKEN often, passing all those make variables
+ can get annoying. An alternative is to create a configuration
+ file defining the required variables and passing "CONFIG=<configfile>"
+ to make(1).
+
To remove CHICKEN from your file-system, enter (probably as
root):
diff --git a/rules.make b/rules.make
index dbf64bcb..c1318306 100644
--- a/rules.make
+++ b/rules.make
@@ -852,8 +852,8 @@ install:
$(CHICKEN_STATUS_PROGRAM)$(EXE) $(CHICKEN_SETUP_PROGRAM)$(EXE) \
$(LIBCHICKEN_SO_FILE) $(LIBUCHICKEN_SO_FILE) \
$(IMPORT_LIBRARIES:%=%.so) $(IMPORT_LIBRARIES:%=%.import.so)
- $(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) NEEDS_RELINKING=no RUNTIME_LINKER_PATH=$(LIBDIR) \
- SONAME_VERSION=.$(BINARYVERSION) install
+ $(MAKE) -f CONFIG=$(CONFIG) $(SRCDIR)Makefile.$(PLATFORM) NEEDS_RELINKING=no \
+ RUNTIME_LINKER_PATH=$(LIBDIR) SONAME_VERSION=.$(BINARYVERSION) install
$(MAKE_WRITABLE_COMMAND) $(CHICKEN_PROGRAM)$(EXE) $(CSI_PROGRAM)$(EXE) \
$(CSC_PROGRAM)$(EXE) $(CHICKEN_PROFILE_PROGRAM)$(EXE)
ifndef STATICBUILD
@@ -1311,17 +1311,17 @@ fullcheck: check compiler-check
compiler-check:
@echo "======================================== packing ..."
- $(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) dist
+ $(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) CONFIG=$(CONFIG) dist
$(REMOVE_COMMAND $(REMOVE_COMMAND_RECURSIVE_OPTIONS) tests$(SEP)chicken-*
tar -C tests -xzf `ls -t chicken-*.tar.gz | head -1`
@echo "======================================== building stage 1 ..."
- $(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) STATICBUILD=1 -C tests$(SEP)chicken-* confclean all
+ $(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) CONFIG=$(CONFIG) STATICBUILD=1 -C tests$(SEP)chicken-* confclean all
touch tests$(SEP)chicken-*$(SEP)*.scm
@echo "======================================== building stage 2 ..."
- $(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) STATICBUILD=1 -C tests$(SEP)chicken-* confclean all
+ $(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) CONFIG=$(CONFIG) STATICBUILD=1 -C tests$(SEP)chicken-* confclean all
cat tests$(SEP)chicken-*$(SEP)*.c >tests$(SEP)stage2.out
@echo "======================================== building stage 3 ..."
- $(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) STATICBUILD=1 -C tests$(SEP)chicken-* confclean all
+ $(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) CONFIG=$(CONFIG) STATICBUILD=1 -C tests$(SEP)chicken-* confclean all
cat tests$(SEP)chicken-*$(SEP)*.c >tests$(SEP)stage3.out
diff tests$(SEP)stage2.out tests$(SEP)stage3.out >tests$(SEP)stages.diff
$(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) tests$(SEP)chicken-*
@@ -1334,11 +1334,12 @@ compiler-check:
bootstrap:
gzip -d -c $(SRCDIR)bootstrap.tar.gz | tar xvf -
touch *.c
- $(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) STATICBUILD=1 DEBUGBUILD=1 PLATFORM=$(PLATFORM) \
- chicken$(EXE)
+ $(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) CONFIG=$(CONFIG) STATICBUILD=1 \
+ DEBUGBUILD=1 PLATFORM=$(PLATFORM) chicken$(EXE)
$(COPY_COMMAND) chicken$(EXE) chicken-boot$(EXE)
touch *.scm
- $(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) PLATFORM=$(PLATFORM) confclean
+ $(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) CONFIG=$(CONFIG) PLATFORM=$(PLATFORM) \
+ confclean
$(SRCDIR)bootstrap.tar.gz: distfiles
tar cfz $@ library.c eval.c data-structures.c ports.c files.c extras.c lolevel.c utils.c tcp.c \
Trap