aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-09-17 20:57:05 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-09-17 20:57:05 +0200
commit361bb55f01ba28960a8127b0a16c1e7a7a8de61a (patch)
treeff0479af1c9283c8a0546025022ebc54616a9a75 /Makefile
parent2810ad72aeb973a898034d6875922284062c5ce0 (diff)
downloadcforum-361bb55f01ba28960a8127b0a16c1e7a7a8de61a.tar.gz
Rewrite mktpl script in C
The Perl version didn't handle multiple interpolations on the same line.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 10 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 512b613..4e788a9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,19 @@
.SUFFIXES: .c .t .tc
LDFLAGS += -lsqlite3
-C = cforum.c err.c front.c query.c
-TPL = t/err.tc t/foot.tc t/front.tc t/head.tc
+C = cforum.c ctl.c db.c err.c query.c
+TPL = t/err.tc t/foot.tc t/front.tc t/head.tc t/post.tc t/user.tc
cforum: $(C) $(TPL)
$(CC) $(CFLAGS) $(LDFLAGS) -o cforum $(C)
-.t.tc: maketpl
- <$< ./maketpl >$@
+.t.tc: mktpl/mktpl
+ <$< mktpl/mktpl >$@
db:
- sqlite3 db "CREATE TABLE settings(key UNIQUE, value);"
- sqlite3 db "INSERT INTO settings values('name', 'C Forum');" \ No newline at end of file
+ sqlite3 db "CREATE TABLE settings(key, value, PRIMARY KEY (key));"
+ sqlite3 db "INSERT INTO settings values('name', 'C Forum');"
+ sqlite3 db "CREATE TABLE users(name, hash NOT NULL, PRIMARY KEY (name));"
+ sqlite3 db "INSERT INTO users values('john', '123');"
+ sqlite3 db "CREATE TABLE posts(user INT NOT NULL, created INT NOT NULL, edited INT, subject NOT NULL, text NOT NULL, FOREIGN KEY (user) REFERENCES users(oid));"
+ sqlite3 db "INSERT INTO posts values(1, 0, NULL, 'Hello World!', 'This is the first post.');" \ No newline at end of file