pegrep-cl/Makefile
2024-09-21 07:38:30 -05:00

59 lines
1.4 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: $(BUILDDIR)/pegrep-debug
fast: $(BUILDDIR)/pegrep
# 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)'
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
$(LIBS): $(QL)/setup.lisp
$(EXE) $(FLAGS) \
--load $(QL)/setup.lisp \
--eval '(ql:quickload :alexandria)' \
--eval '(ql:quickload :fiveam)' \
--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)'