Commit 59df9898 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

Simplify Makefile to delegate to bootstrap scripts.

parent e53f8006
......@@ -15,43 +15,6 @@
# Other targets are for maintainer use only. If you want a list of all of the targets, use
# make help
#
# Default action: bootstrap asdf.lisp
# That's the only thing that we really need before we may invoke asdf-builder.
all: build/asdf.lisp
@: # This dummy action is necessary so the all target does not invoke the fallback action.
# Download all the development-time dependencies of ASDF:
ext:
git submodule update --init
# Remove all the development-time dependencies of ASDF:
noext:
git submodule deinit .
header_lisp := header.lisp
driver_lisp := uiop/package.lisp uiop/common-lisp.lisp uiop/utility.lisp uiop/os.lisp uiop/pathname.lisp uiop/filesystem.lisp uiop/stream.lisp uiop/image.lisp uiop/run-program.lisp uiop/lisp-build.lisp uiop/configuration.lisp uiop/backward-driver.lisp uiop/driver.lisp
defsystem_lisp := upgrade.lisp component.lisp system.lisp cache.lisp find-system.lisp find-component.lisp operation.lisp action.lisp lisp-action.lisp plan.lisp operate.lisp output-translations.lisp source-registry.lisp parse-defsystem.lisp bundle.lisp concatenate-source.lisp package-inferred-system.lisp backward-internals.lisp backward-interface.lisp interface.lisp user.lisp footer.lisp
# Making ASDF itself should be our first, default, target:
build/asdf.lisp: $(header_lisp) $(driver_lisp) $(defsystem_lisp)
mkdir -p build
rm -f $@
cat $^ > $@
# These targets are used during tests to ensure the Makefile is in synch with the .asd files.
driver-files:
@echo $(driver_lisp)
defsystem-files:
@echo $(defsystem_lisp)
### exclude source files from fallback rule.
%.lisp:
@:
Makefile:
@:
### Default fall back rule: delegate to asdf-tools.
# Note that the l= L= etc. are the only way I (Faré) have found to
# pass arguments from the Makefile to the underlying script:
......@@ -73,17 +36,31 @@ Makefile:
# instead of
# make bump v=3.2.1
# or
# ./make.sh v=3.2.1 bump
# or
# ./tools/asdf-tools env v=3.2.1 bump
# or
# v=3.2.1 ./tools/asdf-tools bump
%: build/asdf.lisp
./tools/asdf-tools env l='$l' L='$L' u='$u' U='$U' v='$v' s='$s' t='$t' $@
# This is the list of phony targets from this file
.PHONY: all driver-files defsystem-files ext noext force
ifeq ($(OS),Windows_NT)
MAKE_SCRIPT := make.bat
else
MAKE_SCRIPT := ./make.sh
endif
all ext noext driver_files defsystem_files: force
${MAKE_SCRIPT} $@
build_asdf build/asdf.lisp: force
${MAKE_SCRIPT} build_asdf
.PHONY: force all ext noext driver_files defsystem_files build_asdf
# The text below was automaticaly generated by `make --silent makefile-targets`
# then manually inserted here to provide for completion:
.PHONY: archive build-asdf bump bump-version check-all-results check-all-scripts-results check-all-upgrade-results clean debian-package doc extract extract-all-tagged-asdf extract-tagged-asdf fix-local-git-tags fix-remote-git-tags git-all-committed-p help install install-asdf link-archive load make-and-publish-archive make-archive makefile-targets merge-master-into-release publish-archive publish-debian-package push re show-commands t test test-all test-all-clean-load test-all-no-stop test-all-no-upgrade test-all-no-upgrade-no-stop test-all-scripts test-all-scripts-no-stop test-all-upgrade test-all-upgrade-no-stop test-basic test-clean-load test-load-systems test-scripts test-upgrade u wc website
archive build-asdf bump bump-version check-all-results check-all-scripts-results check-all-upgrade-results clean debian-package doc extract extract-all-tagged-asdf extract-tagged-asdf fix-local-git-tags fix-remote-git-tags git-all-committed-p help install install-asdf link-archive load make-and-publish-archive make-archive makefile-targets merge-master-into-release publish-archive publish-debian-package push re show-commands t test test-all test-all-clean-load test-all-no-stop test-all-no-upgrade test-all-no-upgrade-no-stop test-all-scripts test-all-scripts-no-stop test-all-upgrade test-all-upgrade-no-stop test-basic test-clean-load test-load-systems test-scripts test-upgrade u wc website: force
./tools/asdf-tools env l='$l' L='$L' u='$u' U='$U' v='$v' s='$s' t='$t' $@
${MAKE_SCRIPT} l='$l' L='$L' u='$u' U='$u' v='$v' s='$s' t='$t' $@
......@@ -55,26 +55,25 @@
(assert-pathname-equal (subpathname *asdf-directory* "asdf.asd")
(system-source-file (find-system :asdf)))
(DBG "Checking that Makefile and asdf.asd are in synch")
(DBG "Checking that the bootstrap script and asdf.asd are in synch")
(defun system-lisp-files (system)
(loop :for f :in (required-components system :keep-component 'cl-source-file)
:collect (enough-pathname (component-pathname f) *asdf-directory*)))
(defun makefile-lisp-files (target)
(defun bootstrap-lisp-files (target)
(mapcar
'parse-unix-namestring
(remove-if 'emptyp
(split-string ;; NB: assumes GNU make
(run-program `("make" "-C" ,(native-namestring *asdf-directory*)
"--quiet" "--no-print-directory" ,target)
:output :string :error-output t)
(split-string ;; don't use make(1), use the bootstrap script
(run-program `(#+os-unix "./make.sh" #+os-windows "make.bat" ,target)
:directory *asdf-directory* :output :string :error-output t)
:separator #(#\space #\newline #\return #\tab)))))
(defmacro compare-files (system target)
`(assert-pathnames-equal (system-lisp-files ,system) (makefile-lisp-files ,target)))
`(assert-pathnames-equal (system-lisp-files ,system) (bootstrap-lisp-files ,target)))
(DBG "Testing that the Makefile and ASDF agree on the order of UIOP files")
(compare-files :uiop "driver-files")
(compare-files :uiop "driver_files")
(DBG "Testing that the Makefile and ASDF agree on the order of ASDF/DEFSYSTEM files")
(compare-files :asdf/defsystem "defsystem-files")
(compare-files :asdf/defsystem "defsystem_files")
......@@ -72,7 +72,7 @@ so that, when included in the Makefile, they will enable shell completion
based on a list of targets"
(let ((c (public-command-strings)))
(format t ".PHONY: ~{~A~^ ~}~%~%~{~A~^ ~}: force
./tools/asdf-tools env l='$l' L='$L' u='$u' U='$u' v='$v' s='$s' t='$t' $@~%" c c))
~C${MAKE_SCRIPT} l='$l' L='$L' u='$u' U='$u' v='$v' s='$s' t='$t' $@~%" c c #\tab))
(success))
(defun help (&optional x)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment