# Compiler (LIAR)
.PHONY: compile-cross-compiler
-compile-cross-compiler: syntax-cross-compiler
- (echo '(with-working-directory-pathname "compiler"' && \
- echo ' (lambda () (load "compiler.cbf")))') \
- | $(HOST_COMPILER)
+compile-cross-compiler: compile-cross-compiler-back
+compile-cross-compiler: compile-cross-compiler-base
+compile-cross-compiler: compile-cross-compiler-fggen
+compile-cross-compiler: compile-cross-compiler-fgopt
+compile-cross-compiler: compile-cross-compiler-machine
+compile-cross-compiler: compile-cross-compiler-rtlbase
+compile-cross-compiler: compile-cross-compiler-rtlgen
+
+.PHONY: compile-cross-compiler-back
+compile-cross-compiler-back: syntax-cross-compiler
+ echo '(compile-directory "compiler/back")' | $(HOST_COMPILER)
+
+.PHONY: compile-cross-compiler-base
+compile-cross-compiler-base: syntax-cross-compiler
+ echo '(compile-directory "compiler/base")' | $(HOST_COMPILER)
+
+.PHONY: compile-cross-compiler-fggen
+compile-cross-compiler-fggen: syntax-cross-compiler
+ echo '(compile-directory "compiler/fggen")' | $(HOST_COMPILER)
+
+.PHONY: compile-cross-compiler-fgopt
+compile-cross-compiler-fgopt: syntax-cross-compiler
+ echo '(compile-directory "compiler/fgopt")' | $(HOST_COMPILER)
+
+.PHONY: compile-cross-compiler-machine
+compile-cross-compiler-machine: syntax-cross-compiler
+ echo '(compile-directory "compiler/machine")' | $(HOST_COMPILER)
+
+.PHONY: compile-cross-compiler-rtlbase
+compile-cross-compiler-rtlbase: syntax-cross-compiler
+ echo '(compile-directory "compiler/rtlbase")' | $(HOST_COMPILER)
+
+.PHONY: compile-cross-compiler-rtlgen
+compile-cross-compiler-rtlgen: syntax-cross-compiler
+ echo '(compile-directory "compiler/rtlgen")' | $(HOST_COMPILER)
+
+.PHONY: compile-cross-compiler-rtlopt
+compile-cross-compiler-rtlopt: syntax-cross-compiler
+ echo '(compile-directory "compiler/rtlopt")' | $(HOST_COMPILER)
# Must use HOST_SYNTAXER here because compiler.sf's (and, more
# generally, CREF's) host/target distinction is bollocksed up, and will
# Compiler (LIAR)
+# The subdirectories can be compiled independently and in parallel, but
+# syntaxing the compiler is too hairy right now to do without the
+# compiler.sf script(s).
+
.PHONY: compile-compiler
-compile-compiler: bootstrap-toolchain
-compile-compiler: syntax-compiler
- (echo '(with-working-directory-pathname "compiler"' && \
- echo ' (lambda () (load "compiler.cbf")))') \
- | $(BOOTSTRAP_COMPILER)
+compile-compiler: compile-compiler-back
+compile-compiler: compile-compiler-base
+compile-compiler: compile-compiler-fggen
+compile-compiler: compile-compiler-fgopt
+compile-compiler: compile-compiler-machine
+compile-compiler: compile-compiler-rtlbase
+compile-compiler: compile-compiler-rtlgen
+
+.PHONY: compile-compiler-back
+compile-compiler-back: bootstrap-toolchain
+compile-compiler-back: syntax-compiler
+ echo '(compile-directory "compiler/back")' | $(BOOTSTRAP_COMPILER)
+
+.PHONY: compile-compiler-base
+compile-compiler-base: bootstrap-toolchain
+compile-compiler-base: syntax-compiler
+ echo '(compile-directory "compiler/base")' | $(BOOTSTRAP_COMPILER)
+
+.PHONY: compile-compiler-fggen
+compile-compiler-fggen: bootstrap-toolchain
+compile-compiler-fggen: syntax-compiler
+ echo '(compile-directory "compiler/fggen")' | $(BOOTSTRAP_COMPILER)
+
+.PHONY: compile-compiler-fgopt
+compile-compiler-fgopt: bootstrap-toolchain
+compile-compiler-fgopt: syntax-compiler
+ echo '(compile-directory "compiler/fgopt")' | $(BOOTSTRAP_COMPILER)
+
+.PHONY: compile-compiler-machine
+compile-compiler-machine: bootstrap-toolchain
+compile-compiler-machine: syntax-compiler
+ echo '(compile-directory "compiler/machine")' | $(BOOTSTRAP_COMPILER)
+
+.PHONY: compile-compiler-rtlbase
+compile-compiler-rtlbase: bootstrap-toolchain
+compile-compiler-rtlbase: syntax-compiler
+ echo '(compile-directory "compiler/rtlbase")' | $(BOOTSTRAP_COMPILER)
+
+.PHONY: compile-compiler-rtlgen
+compile-compiler-rtlgen: bootstrap-toolchain
+compile-compiler-rtlgen: syntax-compiler
+ echo '(compile-directory "compiler/rtlgen")' | $(BOOTSTRAP_COMPILER)
+
+.PHONY: compile-compiler-rtlopt
+compile-compiler-rtlopt: bootstrap-toolchain
+compile-compiler-rtlopt: syntax-compiler
+ echo '(compile-directory "compiler/rtlopt")' | $(BOOTSTRAP_COMPILER)
.PHONY: syntax-compiler
syntax-compiler: bootstrap-toolchain