diff options
author | Linnnus <[email protected]> | 2024-02-01 22:59:38 +0100 |
---|---|---|
committer | Linnnus <[email protected]> | 2024-02-04 09:58:06 +0100 |
commit | d38f82f6462af4e5aad6a2c776f5c00ce5b13c87 (patch) | |
tree | 01a222792dfb10473ae4370b4fc90f3a48e1a499 /Makefile |
feat: initial commit
Here is a small overview of the state of the project at this first
commit.
I have basic Git Repo -> HTML working, and a plan for how setting up an
actual server would work (mainly, NGINX + a git hook to rebuild).
The main thing I'm working on right now is parsing WikiCreole, though I
am starting to wonder if this is the right langauge. WikiCreole is
pretty irregular and has a lot of edge cases (e.g. around emphasis).
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..afc9dda --- /dev/null +++ b/Makefile @@ -0,0 +1,47 @@ +.POSIX: +.PHONY: all install uninstall clean + +CC := cc +CFLAGS := -W -O $(shell pkg-config --cflags libgit2) +CFLAGS += -g3 -O0 -fsanitize=address,undefined -fsanitize-trap +CFLAGS += -Wall -Wextra -Wconversion -Wdouble-promotion \ + -Wno-unused-parameter -Wno-unused-function -Wno-sign-conversion +LDLIBS := -lm $(shell pkg-config --libs libgit2) +PREFIX ?= /usr/local + +all: build/simplewiki + +install: build/simplewiki + mkdir -p $(PREFIX)/bin + mkdir -p $(PREFIX)/share/man/man1 + cp -f build/simplewiki $(PREFIX)/bin + gzip <doc/simplewiki.1 >$(PREFIX)/share/man/man1/simplewiki.1.gz + +uninstall: + rm -f $(PREFIX)/bin/simplewiki + rm -f $(PREFIX)/share/man/man1/simplewiki.1.gz + rmdir $(PREFIX)/bin >/dev/null 2>&1 || true + rmdir $(PREFIX)/share/man/man1 >/dev/null 2>&1 || true + +build/simplewiki: build/main.o build/die.o build/arena.o build/strutil.o build/creole.o + $(CC) $(LDFLAGS) -o build/simplewiki $^ $(LDLIBS) + +build/creole-test: build/creole-test.o build/creole.o + $(CC) -o $@ $^ + +build/creole-test.o: src/creole-test.c +build/main.o: src/main.c src/arena.h src/die.h src/strutil.h src/creole.h +build/arena.o: src/arena.c src/arena.h +build/die.o: src/die.c src/die.h +build/strutil.o: src/strutil.c src/strutil.h src/arena.h +build/creole.o: src/creole.c + +build/%.o: src/%.c | build/ + $(CC) $(CFLAGS) -c -o $@ $< + +build/: + mkdir -p build/ + +clean: + rm -f build/ + |