summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMurilo Ijanc <[email protected]>2026-07-26 12:45:04 -0300
committerMurilo Ijanc <[email protected]>2026-07-26 12:45:04 -0300
commitcf5597871327dbff2c7c743672d696e7ff340c42 (patch)
tree2502272b9042d9bc980b20a8a3f308b7c5e7fe87 /Makefile
downloadpascal-0.1.0.tar.gz
Initial importv0.1.0
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile42
1 files changed, 42 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..9ec6301
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,42 @@
+FPC ?= fpc
+SRCDIR := src
+TESTDIR := tests
+BUILDDIR := build
+UNITDIR := $(BUILDDIR)/units
+LINTDIR := $(BUILDDIR)/lint
+TESTBIN := $(BUILDDIR)/testcepis
+
+FPCFLAGS ?= -O2 -vewn -Fu$(SRCDIR)
+LINTFLAGS ?= -Sew -vewnh -Fu$(SRCDIR)
+
+.DEFAULT_GOAL := help
+.PHONY: help build test lint check clean
+
+help:
+ @echo 'Targets:'
+ @echo ' build compile the units into $(UNITDIR)'
+ @echo ' test compile and run the suite against a local HTTP server'
+ @echo ' lint compile with warnings as errors, into a scratch dir'
+ @echo ' check lint + test + build, in that order'
+ @echo ' clean remove $(BUILDDIR)'
+ @echo
+ @echo 'Override the compiler with e.g. make build FPC=ppcx64'
+
+build:
+ @mkdir -p $(UNITDIR)
+ $(FPC) $(FPCFLAGS) -FU$(UNITDIR) $(SRCDIR)/Cepis.pas
+
+test:
+ @mkdir -p $(UNITDIR)
+ $(FPC) $(FPCFLAGS) -FU$(UNITDIR) -FE$(BUILDDIR) -otestcepis $(TESTDIR)/TestCepis.pas
+ ./$(TESTBIN) --all --format=plain
+
+lint:
+ @mkdir -p $(LINTDIR)
+ $(FPC) $(LINTFLAGS) -FU$(LINTDIR) $(SRCDIR)/Cepis.pas
+ $(FPC) $(LINTFLAGS) -FU$(LINTDIR) -FE$(LINTDIR) -otestcepis $(TESTDIR)/TestCepis.pas
+
+check: lint test build
+
+clean:
+ rm -rf $(BUILDDIR)