aboutsummaryrefslogtreecommitdiff
path: root/src/boot/Makefile.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/boot/Makefile.in')
-rw-r--r--src/boot/Makefile.in191
1 files changed, 126 insertions, 65 deletions
diff --git a/src/boot/Makefile.in b/src/boot/Makefile.in
index 94d98c33..c438d385 100644
--- a/src/boot/Makefile.in
+++ b/src/boot/Makefile.in
@@ -1,9 +1,68 @@
+## Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd.
+## All rights reserved.
+## Copyright (C) 2007-2008, Gabriel Dos Reis.
+## All rights reserved.
+##
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+##
+## - Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+##
+## - Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+##
+## - Neither the name of The Numerical ALgorithms Group Ltd. nor the
+## names of its contributors may be used to endorse or promote products
+## derived from this software without specific prior written permission.
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+## IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+## TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+## PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+## OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+## LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+## NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+## SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+##
+
+##
+## Abstract:
+## OpenAxiom is built in layers. The first layer is contructed into
+## an image called `bootsys'. The `bootsys' image is used
+## to translate Boot code to Common Lisp code. Since a Boot coded
+## interpreter is needed to translate the code for the Boot coded
+## interpreter we have a ``boot-strapping'' problem. In order to get
+## the whole process to start we need certain files kept in
+## common lisp form. This directory contains those files.
+##
+
+## We start with a Lisp image created in a previous build step (src/lisp).
+## That image is used to build Boot translator executable through the
+## entire bootstrap process.
+
AXIOM_LOCAL_LISP_sources = initial-env.lisp
AXIOM_LOCAL_LISP = ../lisp/lisp$(EXEEXT)
-PROCLAIMS=(load "$(srcdir)/boot-proclaims.lisp")
+
+## FASLs that comprises `bootsys'
+boot_SOURCES = initial-env.lisp $(boot_sources)
+boot_sources = tokens.boot includer.boot scanner.boot \
+ pile.boot ast.boot parser.boot translator.boot
+boot_clisp = $(boot_sources:.boot=.clisp)
boot_objects = initial-env.$(FASLEXT) $(boot_sources:.boot=.$(FASLEXT))
+# Garbage produced by GCL during compilation
+boot_data = $(boot_sources:.boot=.data)
+boot_fn = $(boot_sources:.boot=.fn)
+
+##
## ECL's program construction model is not based on image-dumping. It is
## closer to `traditional C' application building. Therefore, since
## bootsys is an augmentation of base-lisp, we need to have the objects
@@ -12,28 +71,10 @@ ifeq (@axiom_lisp_flavor@,ecl)
boot_objects_extra = ../lisp/core.$(FASLEXT)
endif
-boot_SOURCES = \
- initial-env.lisp.pamphlet \
- $(addsuffix .pamphlet, $(boot_sources))
-
-pamphlets = Makefile.pamphlet $(boot_SOURCES)
-boot_sources = tokens.boot includer.boot scanner.boot \
- pile.boot ast.boot parser.boot translator.boot
-
-boot_clisp = $(boot_sources:.boot=.clisp)
-boot_data = $(boot_sources:.boot=.data)
-boot_fn = $(boot_sources:.boot=.fn)
-boot_cached_clisp = $(boot_sources:.boot=.clisp)
-
-COMPILE_LISP = \
- $(axiom_build_document) --tag=lisp --mode=compile --output=$@
-
-BOOT_TO_LISP = \
- $(axiom_build_document) --tag=boot --mode=translate \
- --use=./prev-stage/bootsys $<
-
+# reference to this directory from toplevel
subdir = src/boot/
+## Make rule toplevel entry points.
.PHONY: all-ax all-boot
all: all-ax all-boot
@@ -43,119 +84,139 @@ stamp: $(axiom_build_bindir)/bootsys$(EXEEXT)
@rm -f stamp
$(STAMP) $@
+## The final `bootsys' image.
$(axiom_build_bindir)/bootsys$(EXEEXT): stage2/bootsys$(EXEEXT)
$(mkinstalldirs) $(axiom_build_bindir)
$(INSTALL_PROGRAM) stage2/bootsys$(EXEEXT) $(axiom_build_bindir)
-.PRECIOUS: stage0/%.clisp
-.PRECIOUS: stage0/%.$(FASLEXT)
+.PRECIOUS: strap/%.$(FASLEXT)
+
+##
+## The bootstrapping `bootsys' image.
+##
-stage0_boot_clisp = $(addprefix stage0/, $(boot_clisp))
+# The bootstrapping Lisp code is cached in the subdirectory strap/.
+# It is built first, followed by stage 1, and stage 2 `bootsys' images.
+strap_boot_clisp = $(addprefix strap/, $(boot_clisp))
-stage0_boot_objects = $(addprefix stage0/, $(boot_objects))
+strap_boot_objects = \
+ $(addprefix strap/, $(boot_objects))
-stage0/stamp: stage0/bootsys$(EXEEXT)
+strap/stamp: strap/bootsys$(EXEEXT)
@rm -f $@
@$(STAMP) $@
-stage0/bootsys$(EXEEXT): $(stage0_boot_objects)
+strap/bootsys$(EXEEXT): $(strap_boot_objects)
$(AXIOM_LOCAL_LISP) -- --make --main="|AxiomCore|::|topLevel|"\
- --output=$@ --load-directory=stage0 \
- $(boot_objects_extra) $(stage0_boot_objects)
+ --output=$@ --load-directory=strap \
+ $(boot_objects_extra) $(strap_boot_objects)
-.PRECIOUS: %/.started
-%/.started:
- $(mkinstalldirs) $*
- $(STAMP) $@
-
-$(stage0_boot_objects): $(AXIOM_LOCAL_LISP)
-
-stage0/%.clisp: $(srcdir)/%.boot.pamphlet stage0/.started
- $(axiom_build_document) --tangle=$*.clisp --output=$@ $<
+$(strap_boot_objects): $(AXIOM_LOCAL_LISP)
-%/initial-env.$(FASLEXT): initial-env.lisp %/.started
- $(AXIOM_LOCAL_LISP) -- --compile --output=$@ $<
+##
+## Stage 1 `bootsys' image.
+##
.PRECIOUS: stage1/%.$(FASLEXT)
.PRECIOUS: stage1/%.clisp
+stage1_boot_clisp = $(addprefix stage1/, $(boot_clisp))
+
+stage1_boot_objects = \
+ $(addprefix stage1/, $(boot_objects))
+
stage1/stamp: stage1/bootsys$(EXEEXT)
rm -f $@
$(STAMP) $@
-stage1/bootsys$(EXEEXT): $(addprefix stage1/, $(boot_objects))
+stage1/bootsys$(EXEEXT): $(stage1_boot_objects)
$(AXIOM_LOCAL_LISP) -- --make --main="|AxiomCore|::|topLevel|" \
--output=$@ --load-directory=stage1 \
- $(boot_objects_extra) $(addprefix stage1/, $(boot_objects))
+ $(boot_objects_extra) $(stage1_boot_objects)
+
+stage1/%.clisp: %.boot strap/stamp stage1/.started
+ strap/bootsys -- --translate --output=$@ $<
+
-stage1/%.clisp: %.boot stage0/stamp stage1/.started
- stage0/bootsys -- --translate --output=$@ $<
+##
+## Stage 2 `bootsys' image.
+##
.PRECIOUS: stage2/%.$(FASLEXT)
.PRECIOUS: stage2/%.clisp
+stage2_boot_clisp = $(addprefix stage2/, $(boot_clisp))
+
+stage2_boot_objects = \
+ $(addprefix stage2/, $(boot_objects))
+
stage2/stamp: stage2/bootsys$(EXEEXT)
@echo Building stage 2
$(STAMP) $@
-stage2/bootsys$(EXEEXT): $(addprefix stage2/, $(boot_objects))
+stage2/bootsys$(EXEEXT): $(stage2_boot_objects)
$(AXIOM_LOCAL_LISP) -- --make --main="|AxiomCore|::|topLevel|" \
--output=$@ --load-directory=stage2 \
- $(boot_objects_extra) $(addprefix stage2/, $(boot_objects))
+ $(boot_objects_extra) $(stage2_boot_objects)
stage2/%.clisp: %.boot stage1/stamp stage2/.started
stage1/bootsys -- --translate --output=$@ $<
+##
+## Generic rules for compiling FASLs
+##
+
+.PRECIOUS: %/.started
+%/.started:
+ $(mkinstalldirs) $*
+ $(STAMP) $@
+
## Dependency for various modules.
## FIXME: This should be automatically extracted from the
## Boot source file at packaging time.
+%/initial-env.$(FASLEXT): initial-env.lisp %/.started
+ $(AXIOM_LOCAL_LISP) -- --compile --output=$@ $<
+
%/tokens.$(FASLEXT): %/tokens.clisp %/initial-env.$(FASLEXT)
- $(AXIOM_LOCAL_LISP) -- --compile --load-directory=$* $<
+ $(AXIOM_LOCAL_LISP) -- --output=$@ --compile --load-directory=$* $<
%/includer.$(FASLEXT): %/includer.clisp %/tokens.$(FASLEXT)
- $(AXIOM_LOCAL_LISP) -- --compile --load-directory=$* $<
+ $(AXIOM_LOCAL_LISP) -- --output=$@ --compile --load-directory=$* $<
%/scanner.$(FASLEXT): %/scanner.clisp %/tokens.$(FASLEXT) %/includer.$(FASLEXT)
- $(AXIOM_LOCAL_LISP) -- --compile --load-directory=$* $<
+ $(AXIOM_LOCAL_LISP) -- --output=$@ --compile --load-directory=$* $<
%/pile.$(FASLEXT): %/pile.clisp %/scanner.$(FASLEXT) %/includer.$(FASLEXT)
- $(AXIOM_LOCAL_LISP) -- --compile --load-directory=$* $<
+ $(AXIOM_LOCAL_LISP) -- --output=$@ --compile --load-directory=$* $<
%/ast.$(FASLEXT): %/ast.clisp %/includer.$(FASLEXT)
- $(AXIOM_LOCAL_LISP) -- --compile --load-directory=$* $<
+ $(AXIOM_LOCAL_LISP) -- --output=$@ --compile --load-directory=$* $<
%/parser.$(FASLEXT): %/parser.clisp %/ast.$(FASLEXT) %/scanner.$(FASLEXT) \
%/includer.$(FASLEXT)
- $(AXIOM_LOCAL_LISP) -- --compile --load-directory=$* $<
+ $(AXIOM_LOCAL_LISP) -- --output=$@ --compile --load-directory=$* $<
%/translator.$(FASLEXT): %/translator.clisp %/parser.$(FASLEXT) \
%/ast.$(FASLEXT) %/pile.$(FASLEXT) %/scanner.$(FASLEXT) \
%/includer.$(FASLEXT)
- $(AXIOM_LOCAL_LISP) -- --compile --load-directory=$* $<
-
-.PRECIOUS: %.boot
-%.boot: $(srcdir)/%.boot.pamphlet
- $(axiom_build_document) --tangle $<
-.PRECIOUS: %.boot
+ $(AXIOM_LOCAL_LISP) -- --output=$@ --compile --load-directory=$* $<
-%.boot: $(srcdir)/%.boot.pamphlet
- $(axiom_build_document) --tangle $<
-.PRECIOUS: %.lisp
-initial-env.lisp: initial-env.lisp.pamphlet
- $(axiom_build_document) --tangle $<
+##
+## Cleaning mess
+##
mostlyclean-local:
@rm -f $(axiom_build_bindir)/bootsys$(EXEEXT)
@rm -rf prev-stage
- @rm -rf stage0 stage1 stage2
+ @rm -rf strap stage1 stage2
@rm -f *.data *.fn
@rm -f stamp
clean-local: mostlyclean-local
@rm -f $(boot_sources)
- @rm -f *.clisp *.lisp
+ @rm -f *.clisp
distclean-local: clean-local