Commit 4f940d54 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

Build an executable for asdf-tools

Don't rebuild asdf-tools everytime, but build it once,
hopefully while asdf is working.

Update README: asdf-tools has to be explicitly rebuilt after update.
parent 90fab315
...@@ -49,17 +49,17 @@ else ...@@ -49,17 +49,17 @@ else
endif endif
all ext noext driver_files defsystem_files: force all ext noext driver_files defsystem_files build_asdf build_asdf_tools: force
${MAKE_SCRIPT} $@ ${MAKE_SCRIPT} $@
build_asdf build/asdf.lisp: force build/asdf.lisp: build_asdf
${MAKE_SCRIPT} build_asdf build/asdf-tools build/asdf-tools.exe: build_asdf_tools
.PHONY: force all ext noext driver_files defsystem_files build_asdf .PHONY: force all ext noext driver_files defsystem_files build_asdf build_asdf_tools
# The text below was automaticaly generated by `make --silent makefile-targets` # The text below was automaticaly generated by `make --silent makefile-targets`
# then manually inserted here to provide for completion: # 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 ext-clear ext-init ext-reset ext-update 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-ascii test-basic test-clean-load test-load-systems test-scripts test-upgrade u wc website .PHONY: archive build-asdf build-asdf-tools bump bump-version check-all-results check-all-scripts-results check-all-upgrade-results clean debian-package doc ext-clear ext-init ext-reset ext-update 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-ascii 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 ext-clear ext-init ext-reset ext-update 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-ascii test-basic test-clean-load test-load-systems test-scripts test-upgrade u wc website: force archive build-asdf build-asdf-tools bump bump-version check-all-results check-all-scripts-results check-all-upgrade-results clean debian-package doc ext-clear ext-init ext-reset ext-update 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-ascii test-basic test-clean-load test-load-systems test-scripts test-upgrade u wc website: force
${MAKE_SCRIPT} 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' $@
...@@ -152,6 +152,17 @@ To run only the regression test scripts, try simply: ...@@ -152,6 +152,17 @@ To run only the regression test scripts, try simply:
make l=$L test-scripts make l=$L test-scripts
Note that an executable `build/asdf-tools` is being built the first time you test ASDF.
When you update ASDF, via e.g. `git pull` or a branch switch, you may have to update it, with:
make build-asdf-tools
The reason this is not done automatically everytime is because
building it depends on a working ASDF;
but when you're modifying ASDF and testing it, you cannot rely on a working ASDF:
indeed, a developer may not only make mistakes, but may deliberately
introduce or re-introduce bugs at some place to test code in another place.
Debugging it Debugging it
------------ ------------
...@@ -240,10 +251,12 @@ How do I navigate this source tree? ...@@ -240,10 +251,12 @@ How do I navigate this source tree?
Far from covering all of ASDF, but a good start. Far from covering all of ASDF, but a good start.
* [contrib/](contrib/) * [contrib/](contrib/)
* a few contributed files that show case how to use ASDF. * a few contributed files that show case how to use ASDF
or help with debugging it or debugging programs that use it.
* [debian/](debian/) * [debian/](debian/)
* files for packaging on Debian, Ubuntu, etc. * files for packaging on Debian, Ubuntu, etc.
(now only present in the debian branch).
* [build/](build/) * [build/](build/)
* where the `Makefile` and `asdf-tools` store their output files, including * where the `Makefile` and `asdf-tools` store their output files, including
...@@ -264,4 +277,4 @@ How do I navigate this source tree? ...@@ -264,4 +277,4 @@ How do I navigate this source tree?
* plenty of ideas for how to further improve ASDF. * plenty of ideas for how to further improve ASDF.
Last updated Saturday, January 2nd, 2016. Last updated Tuesday, January 12th, 2016.
...@@ -13,21 +13,22 @@ cd %~p0 ...@@ -13,21 +13,22 @@ cd %~p0
if "%~1"=="" goto all if "%~1"=="" goto all
if "%~1"=="all" goto all if "%~1"=="all" goto all
if "%~1"=="build_asdf" goto build_asdf if "%~1"=="build_asdf" goto build_asdf
if "%~1"=="build_asdf_tools" goto build_asdf_tools
if "%~1"=="ext" goto ext if "%~1"=="ext" goto ext
if "%~1"=="noext" goto noext if "%~1"=="noext" goto noext
if "%~1"=="driver_files" goto driver_files if "%~1"=="driver_files" goto driver_files
if "%~1"=="defsystem_files" goto defsystem_files if "%~1"=="defsystem_files" goto defsystem_files
call %0 build_asdf call %0 build_asdf_tools
%here%\tools\asdf-tools.bat env %* %here%\build\asdf-tools.exe env %*
goto :end goto end
:all :all
:: Default action: bootstrap asdf.lisp :: Default action: bootstrap asdf.lisp
:build_asdf :build_asdf
:: That's the only thing that we really need before we may invoke asdf-builder. :: That's the only thing that we really need before we may invoke the asdf-tools
if not exist build mkdir build if not exist build mkdir build
set a=build\asdf.lisp set a=build\asdf.lisp
copy /y /b %header_lisp% + %driver_lisp% + %defsystem_lisp% %a%.tmp > nul copy /y /b %header_lisp% + %driver_lisp% + %defsystem_lisp% %a%.tmp > nul
...@@ -37,6 +38,13 @@ goto :end ...@@ -37,6 +38,13 @@ goto :end
del /f /q %a%.tmp del /f /q %a%.tmp
goto end goto end
:build_asdf_tools
:: Building a binary for asdf-tools
if exists build\asdf-tools.exe goto end
call %0 build_asdf
%here%\tools\asdf-tools.bat build-asdf-tools
goto end
:clobber :clobber
if exist %a% del /f /q %a% if exist %a% del /f /q %a%
rename %a%.tmp asdf.lisp rename %a%.tmp asdf.lisp
......
...@@ -23,6 +23,15 @@ build_asdf () { ...@@ -23,6 +23,15 @@ build_asdf () {
mv -f ${a}.tmp ${a} mv -f ${a}.tmp ${a}
fi fi
} }
build_asdf_tools () {
if [ -x build/asdf-tools ] ; then
: "Reusing existing asdf-tools."
else
: "Building asdf-tools."
build_asdf
${here}/tools/asdf-tools build-asdf-tools
fi
}
ext () { ext () {
# Download all the development-time dependencies of ASDF: # Download all the development-time dependencies of ASDF:
git submodule update --init git submodule update --init
...@@ -42,6 +51,6 @@ defsystem_files () { ...@@ -42,6 +51,6 @@ defsystem_files () {
case "$1" in case "$1" in
"") all ;; "") all ;;
all|build_asdf|ext|noext|driver_files|defsystem_files) "$@" ;; all|build_asdf|build_asdf_tools|ext|noext|driver_files|defsystem_files) "$@" ;;
*) build_asdf ; exec ${here}/tools/asdf-tools env "$@" ;; *) build_asdf_tools ; exec ${here}/build/asdf-tools env "$@" ;;
esac ; exit esac ; exit
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
(:version "optima.ppcre" "1.0") (:version "optima.ppcre" "1.0")
(:version "cl-scripting" "0.2") (:version "cl-scripting" "0.2")
(:feature :sbcl (:require "sb-introspect"))) (:feature :sbcl (:require "sb-introspect")))
:build-operation program-op
:build-pathname #.(format nil "../build/asdf-tools~@[.~A~]"
(asdf/bundle:bundle-pathname-type :program))
:entry-point "asdf-tools::entry-point"
:components :components
((:file "package") ((:file "package")
(:file "main" :depends-on ("package")) (:file "main" :depends-on ("package"))
......
...@@ -2,7 +2,14 @@ ...@@ -2,7 +2,14 @@
(deftestcmd build-asdf () (deftestcmd build-asdf ()
"make sure asdf.lisp is built" "make sure asdf.lisp is built"
(load-system :asdf)) (load-system :asdf)
(success))
(deftestcmd build-asdf-tools ()
"build a binary for asdf-tools"
(when (asdf:traverse :program-op :asdf-tools)
(asdf:operate :program-op :asdf-tools))
(success))
;;; Documentation ;;; Documentation
(deftestcmd doc () (deftestcmd doc ()
......
...@@ -43,7 +43,7 @@ The UNIX-y name will be downcased, and any % prefix will be dropped." ...@@ -43,7 +43,7 @@ The UNIX-y name will be downcased, and any % prefix will be dropped."
(defun public-commands () (defun public-commands ()
;;(loop :for x :being :the :external-symbols :of :asdf-tools ;;(loop :for x :being :the :external-symbols :of :asdf-tools
;; :when (and (eq x (find-command x)) (documentation x 'function)) :collect x) ;; :when (and (eq x (find-command x)) (documentation x 'function)) :collect x)
'(build-asdf doc website wc ;; build '(build-asdf build-asdf-tools doc website wc ;; build
clean %push merge-master-into-release fix-local-git-tags fix-remote-git-tags ;; git clean %push merge-master-into-release fix-local-git-tags fix-remote-git-tags ;; git
ext-init ext-clear ext-reset ext-update ;; extension ext-init ext-clear ext-reset ext-update ;; extension
git-all-committed-p git-all-committed-p
......
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