Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
asdf
asdf
Commits
59df9898
Commit
59df9898
authored
Aug 05, 2015
by
Francois-Rene Rideau
Browse files
Simplify Makefile to delegate to bootstrap scripts.
parent
e53f8006
Changes
3
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
59df9898
...
...
@@ -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'
$@
test/test-sysdef-asdf.script
View file @
59df9898
...
...
@@ -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")
tools/main.lisp
View file @
59df9898
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment