LDLIBS += -lsqlite3 C = $(shell ls *.c) H = $(shell ls *.h) TPL = $(shell ls t/*.t | sed 's/$$/c/') .SUFFIXES: .t .tc cforum: $(C) $(H) $(TPL) $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o cforum $(C) .t.tc: mktpl/mktpl <$< mktpl/mktpl >$@ db: 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, full, hash NOT NULL, PRIMARY KEY (name));" sqlite3 db "INSERT INTO users values('john', 'John Ankarström', '123');" sqlite3 db "CREATE TABLE posts(parent INT, 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(NULL, 1, 1462137896, NULL, 'Hello World!', 'This is the first post.');" sqlite3 db "INSERT INTO posts values(1, 1, 1462138896, NULL, 'Re: Hello World!', 'This is the second post!');"