summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorAndreas Fankhauser hiddenalpha.ch2026-03-01 13:53:32 +0100
committerAndreas Fankhauser hiddenalpha.ch2026-03-01 13:53:32 +0100
commit2f174da6aba06d64138a0b6145aea17f250045d0 (patch)
tree74921b248b28a7f8085fc31d0f1d8d053a427005 /configure
parenta4a4668619bcfdcf701a0cafb7ed688cd35ff399 (diff)
downloadquotprint-2f174da6aba06d64138a0b6145aea17f250045d0.tar.gz
quotprint-2f174da6aba06d64138a0b6145aea17f250045d0.zip
Some initial tinkering
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure64
1 files changed, 64 insertions, 0 deletions
diff --git a/configure b/configure
new file mode 100755
index 0000000..06e4c1e
--- /dev/null
+++ b/configure
@@ -0,0 +1,64 @@
+#!/usr/bin/env lua
+
+
+do
+
+ function getCFLAGSArr()return{
+ "-Wall", "-Werror", "-pedantic", "-std=c99", "-fmax-errors=1", "-ggdb", "-O0",
+ }end
+
+ function getLDFLAGSAarr()return{ }end
+
+end
+
+
+function main()
+ local snk = io.open("Makefile", "wb")
+ snk:write([=[
+
+.SILENT:
+
+CC=gcc
+LD=gcc
+MKDIRS=mkdir -p
+RIMRAF=rm -rf
+
+PROJECT_NAME=quotprint
+PROJECT_VERSION=$(shell git describe --tags || date -u +0.0.0-%Y%m%d.%H%M%S)
+
+CFLAGS=]=])for _, f in ipairs(getCFLAGSArr())do snk:write(" ")snk:write(f)end snk:write([=[ \
+ -DPROJECT_NAME=$(PROJECT_NAME) \
+ -DPROJECT_VERSION=$(PROJECT_VERSION) \
+
+DFLAGS=]=])for _, f in ipairs(getLDFLAGSAarr())do snk:write(" ")snk:write(f)end snk:write("\n"..[=[
+
+
+.PHONY: default
+default: build/bin/quotprint
+
+
+.PHONY: clean
+clean:
+ $(RIMRAF) build/bin/* build/obj/*
+
+
+build/bin/quotprint:
+build/bin/quotprint: build/obj/quotprint.o
+ printf ' LN\t%s\n' '$@'
+ $(MKDIRS) "$(shell dirname "$@")"
+ $(LD) -o $@ $^ $(LDFLAGS)
+
+
+build/obj/quotprint.o:
+build/obj/quotprint.o: src/quotprint.c
+ printf ' CC\t%s\n' '$@'
+ $(MKDIRS) "$(shell dirname "$@")"
+ $(CC) -c -o $@ $^ $(CFLAGS)
+
+
+]=])
+ snk:close()
+end
+
+main()
+