commit c95650c357bb8cc41e79f0fd5acaf61edc2e387c Author: pestctrl Date: Fri Sep 20 09:40:09 2024 -0500 Let there be light! diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1c0e038 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build/ +*.fasl \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..87d59b3 --- /dev/null +++ b/Makefile @@ -0,0 +1,46 @@ +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)' diff --git a/README.org b/README.org new file mode 100644 index 0000000..3dd1dda --- /dev/null +++ b/README.org @@ -0,0 +1,2 @@ +* pegrep -- When regular expressions aren't enough! +It's pronounced peg-rep, for peg-replace. \ No newline at end of file diff --git a/src/pegrep.asd b/src/pegrep.asd new file mode 100644 index 0000000..c1f6244 --- /dev/null +++ b/src/pegrep.asd @@ -0,0 +1,28 @@ +(require 'asdf) + +(defmacro def-pegrep (name &rest args) + `(asdf:defsystem ,name + :serial t + :build-operation "program-op" + :entry-point "pegrep:entry" + :depends-on ("alexandria") + :components ((:file "pegrep")) + ,@args)) + +(def-pegrep :pegrep + :build-pathname "../build/pegrep" + :around-compile (lambda (next) + (proclaim '(optimize + (safety 3) + (debug 0) + (speed 3))) + (funcall next))) + +(def-pegrep :pegrep-debug + :build-pathname "../build/pegrep-debug" + :around-compile (lambda (next) + (proclaim '(optimize + (safety 3) + (debug 3) + (speed 0))) + (funcall next))) diff --git a/src/pegrep.lisp b/src/pegrep.lisp new file mode 100644 index 0000000..a8a63f2 --- /dev/null +++ b/src/pegrep.lisp @@ -0,0 +1,8 @@ +(defpackage :pegrep + (:use :cl :alexandria) + (:export :entry)) + +(in-package :pegrep) + +(defun entry () + (format t "Hello, world!~%"))