pegrep-cl/Makefile
2024-09-20 18:56:25 -05:00

46 lines
1.2 KiB
Makefile

EXE = sbcl
FLAGS = --no-userinit --no-sysinit --non-interactive
BUILDDIR = ./build
QL = $(BUILDDIR)/quicklisp
LIBS= $(BUILDDIR)/libs.stamp
.PHONY: all clean cleanall
all: $(BUILDDIR)/pegrep-debug
# Make executable with full debug support and slower execution time
$(BUILDDIR)/pegrep-debug: $(LIBS)
$(EXE) $(FLAGS) \
--load $(QL)/setup.lisp \
--load ./src/pegrep.asd \
--eval '(ql:quickload :alexandria)' \
--eval '(asdf:disable-output-translations)' \
--eval '(asdf:load-system :pegrep-debug)' \
--eval '(asdf:make :pegrep-debug)' \
--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
$(LIBS): $(QL)/setup.lisp
$(EXE) $(FLAGS) \
--load $(QL)/setup.lisp \
--eval '(ql:quickload :alexandria)' \
--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)'