From cf5597871327dbff2c7c743672d696e7ff340c42 Mon Sep 17 00:00:00 2001 From: Murilo Ijanc Date: Sun, 26 Jul 2026 12:45:04 -0300 Subject: Initial import --- Makefile | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Makefile (limited to 'Makefile') 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) -- cgit v1.3