chiark / gitweb /
Makefile, zone.asd: Use ASDF and `runlisp' for building images.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 17 Jun 2024 16:32:56 +0000 (17:32 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 17 Jun 2024 16:40:33 +0000 (17:40 +0100)
ASDF will make standalone images rather than the weird shell-script-
assisted things that `cl-launch' produces.

This is a little tricky because ASDF output translations can't match
just a filename with no type.  As a bodge, produce the image with a
`.img' extension and rename in the makefile.

Makefile
zone.asd

index 6cbf5950a82780c2af9a5822c774215ebca3eb89..868a9cf2cb4a7dd37fa00f15faa05046077f253a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+bindir = $(HOME)/bin
+
 SOURCES = \
        zone.asd \
        frontend.lisp \
@@ -5,9 +7,11 @@ SOURCES = \
        net.lisp serv.lisp sys.lisp \
        addr-family-ipv4.lisp addr-family-ipv6.lisp
 
-CLEANFILES += zone
 all:: zone
 zone: $(SOURCES)
-       cl-launch -o $@ -s zone +I -d `pwd`/zone.core -r zone.frontend:main
-
-clean:; rm -f $(CLEANFILES)
+       ASDF_OUTPUT_TRANSLATIONS="(:output-translations ((#p\"$(abspath zone.img)\") t) :inherit-configuration)" \
+               runlisp -e "(progn (asdf:clear-configuration) (asdf:operate 'asdf:program-op \"zone\"))"
+       mv zone.img $@
+clean:: rm -f zone
+install:: zone
+       install zone $(bindir)/
index b0544a1069f3de636bde972dcb7395f2e8c747fc..6c143e8130d48113e49fbec21c3d15e97ec08d9d 100644 (file)
--- a/zone.asd
+++ b/zone.asd
@@ -5,6 +5,8 @@
   :version "1.0.0"
   :author "Mark Wooding <mdw@distorted.org.uk>"
   :depends-on ("mdw" #+ecl "cffi" #+sbcl "sb-bsd-sockets")
+  :entry-point "zone.frontend:main"
+  :build-pathname "zone.img"
   :components ((:file "net-package")
               (:file "sys")
               (:file "net")