80 lines
2.1 KiB
Makefile
80 lines
2.1 KiB
Makefile
EXE = sbcl
|
|
FLAGS = --no-userinit --no-sysinit --non-interactive
|
|
|
|
BUILDDIR = ./build
|
|
QL = $(BUILDDIR)/quicklisp
|
|
LIBS= $(BUILDDIR)/libs.stamp
|
|
|
|
.PHONY: all clean cleanall test
|
|
all: deb rel faf
|
|
deb: $(BUILDDIR)/pegrep-debug
|
|
rel: $(BUILDDIR)/pegrep
|
|
faf: $(BUILDDIR)/pegrep-faf
|
|
deploy: $(BUILDDIR)/pegrep-deploy
|
|
|
|
# Make executable with full debug support and slower execution time
|
|
$(BUILDDIR)/pegrep-debug: $(LIBS)
|
|
$(EXE) $(FLAGS) \
|
|
--load $(QL)/setup.lisp \
|
|
--eval '(asdf:load-system :pegrep/debug)' \
|
|
--eval '(asdf:make :pegrep/debug)' \
|
|
--eval '(quit)'
|
|
|
|
$(BUILDDIR)/pegrep: $(LIBS)
|
|
$(EXE) $(FLAGS) \
|
|
--load $(QL)/setup.lisp \
|
|
--eval '(asdf:load-system :pegrep)' \
|
|
--eval '(asdf:make :pegrep)' \
|
|
--eval '(quit)'
|
|
|
|
$(BUILDDIR)/pegrep-faf: $(LIBS)
|
|
$(EXE) $(FLAGS) \
|
|
--load $(QL)/setup.lisp \
|
|
--eval '(asdf:load-system :pegrep/faf)' \
|
|
--eval '(asdf:make :pegrep/faf)' \
|
|
--eval '(quit)'
|
|
|
|
# "/run/current-system/sw/lib/" is required for NixOS
|
|
$(BUILDDIR)/pegrep-deploy: $(LIBS)
|
|
$(EXE) $(FLAGS) \
|
|
--load $(QL)/setup.lisp \
|
|
--eval '(ql:quickload :cffi :silent t)' \
|
|
--eval '(pushnew "/run/current-system/sw/lib/" cffi:*foreign-library-directories*)' \
|
|
--eval '(asdf:load-system :pegrep/deploy)' \
|
|
--eval '(asdf:make :pegrep/deploy)' \
|
|
--eval '(quit)'
|
|
|
|
test: $(LIBS)
|
|
$(EXE) $(FLAGS) \
|
|
--load $(QL)/setup.lisp \
|
|
--eval '(asdf:load-system :pegrep/tests)' \
|
|
--eval '(asdf:test-system :pegrep/tests)' \
|
|
--eval '(quit)'
|
|
|
|
# Remove binaries and fasl compiled files
|
|
clean:
|
|
rm -f build/pegrep*
|
|
find . -name "*.fasl" -type f -delete
|
|
|
|
# Remove everything, including libraries
|
|
cleanall: clean
|
|
rm -rf build bin
|
|
|
|
$(LIBS): $(QL)/setup.lisp
|
|
$(EXE) $(FLAGS) \
|
|
--load $(QL)/setup.lisp \
|
|
--eval '(ql:quickload :alexandria)' \
|
|
--eval '(ql:quickload :fiveam)' \
|
|
--eval '(ql:quickload :deploy)' \
|
|
--eval '(quit)'
|
|
touch $@
|
|
|
|
$(QL)/quicklisp.lisp:
|
|
mkdir -p build/quicklisp
|
|
wget -P build/quicklisp/ http://beta.quicklisp.org/quicklisp.lisp
|
|
|
|
$(QL)/setup.lisp: $(QL)/quicklisp.lisp
|
|
$(EXE) $(FLAGS) \
|
|
--load $(QL)/quicklisp.lisp \
|
|
--eval '(quicklisp-quickstart:install :path "$(BUILDDIR)/quicklisp")' \
|
|
--eval '(quit)'
|