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

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
Loading
Loading
Loading
Loading
+6 −6
Changes for Makefile: 6 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -49,17 +49,17 @@ else
endif


all ext noext driver_files defsystem_files: force
all ext noext driver_files defsystem_files build_asdf build_asdf_tools: force
	${MAKE_SCRIPT} $@

build_asdf build/asdf.lisp: force
	${MAKE_SCRIPT} build_asdf
build/asdf.lisp: 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`
# 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' $@
+15 −2
Changes for README.md: 15 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -152,6 +152,17 @@ To run only the regression test scripts, try simply:

    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
------------
@@ -240,10 +251,12 @@ How do I navigate this source tree?
      Far from covering all of ASDF, but a good start.

* [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/)
    * files for packaging on Debian, Ubuntu, etc.
      (now only present in the debian branch).

* [build/](build/)
    * where the `Makefile` and `asdf-tools` store their output files, including
@@ -264,4 +277,4 @@ How do I navigate this source tree?
    * plenty of ideas for how to further improve ASDF.


Last updated Saturday, January 2nd, 2016.
Last updated Tuesday, January 12th, 2016.
+12 −4
Changes for make.bat: 12 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -13,21 +13,22 @@ cd %~p0
if "%~1"=="" goto all
if "%~1"=="all" goto all
if "%~1"=="build_asdf" goto build_asdf
if "%~1"=="build_asdf_tools" goto build_asdf_tools
if "%~1"=="ext" goto ext
if "%~1"=="noext" goto noext
if "%~1"=="driver_files" goto driver_files
if "%~1"=="defsystem_files" goto defsystem_files

call %0 build_asdf
%here%\tools\asdf-tools.bat env %*
goto :end
call %0 build_asdf_tools
%here%\build\asdf-tools.exe env %*
goto end


:all
:: Default action: bootstrap asdf.lisp

: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
 set a=build\asdf.lisp
 copy /y /b %header_lisp% + %driver_lisp% + %defsystem_lisp% %a%.tmp > nul
@@ -37,6 +38,13 @@ goto :end
 del /f /q %a%.tmp
 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
 if exist %a% del /f /q %a%
 rename %a%.tmp asdf.lisp
+11 −2
Changes for make.sh: 11 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -23,6 +23,15 @@ build_asdf () {
    mv -f ${a}.tmp ${a}
  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 () {
  # Download all the development-time dependencies of ASDF:
  git submodule update --init
@@ -42,6 +51,6 @@ defsystem_files () {

case "$1" in
  "") all ;;
  all|build_asdf|ext|noext|driver_files|defsystem_files) "$@" ;;
  *) build_asdf ; exec ${here}/tools/asdf-tools env "$@" ;;
  all|build_asdf|build_asdf_tools|ext|noext|driver_files|defsystem_files) "$@" ;;
  *) build_asdf_tools ; exec ${here}/build/asdf-tools env "$@" ;;
esac ; exit
+4 −0
Changes for tools/asdf-tools.asd: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -7,6 +7,10 @@
               (:version "optima.ppcre" "1.0")
               (:version "cl-scripting" "0.2")
               (: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
  ((:file "package")
   (:file "main" :depends-on ("package"))
Loading