diff options
author | John Ankarström <john@ankarstrom.se> | 2021-09-19 22:27:31 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-09-19 22:27:31 +0200 |
commit | fd9e2f7245212f2b652652f4669648260e59f9e9 (patch) | |
tree | 35e12c2f78cde9338f34780921cd8020eea1bbb4 /Makefile | |
parent | 93c1df59ef14348e9a3e1d66ea0b96960f5b5732 (diff) | |
download | cforum-fd9e2f7245212f2b652652f4669648260e59f9e9.tar.gz |
Add bcrypt
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 31 |
1 files changed, 17 insertions, 14 deletions
@@ -1,35 +1,38 @@ CFLAGS += -std=c89 -Wall -pedantic -Wno-parentheses LDLIBS += -lsqlite3 -C = $(shell ls *.c) -H = $(shell ls *.h) -TPL = $(shell ls t/*.t | sed 's/$$/c/') + +A = $(shell ls *.c *.h t/*.t) +O = $(shell ls *.c | sed 's/c$$/o/') +CRYPTO = $(shell ls crypt/*.o) crypt/x86.S +T = $(shell ls t/*.t) +TC = $(shell ls t/*.t | sed 's/t$$/tc/') .SUFFIXES: .t .tc all: cforum README +.c.o: cforum.h +ctl.o: ctl.c cforum.h $(TC) +cforum: $(O) $(CRYPTO) -clean: - rm cforum - rm $(TPL) +.t.tc: mktpl/mktpl + <$< mktpl/mktpl >$@ -cforum: $(C) $(H) $(TPL) - $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o cforum $(C) +clean: + rm cforum || true + rm *.o t/*.tc || true -README: $(C) $(H) $(TPL) +README: $(A) <README >.README awk '/^ / {if(!i++){print;system($$0"|sed s/^/\\ /")}next} {i=0;print}' mv .README README -.t.tc: mktpl/mktpl - <$< mktpl/mktpl >$@ - db: touch db chown :www db chmod g+w 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, created INT NOT NULL, PRIMARY KEY (name));" - sqlite3 db "INSERT INTO users values('john', 'John Ankarström', '123', 1462134896);" + sqlite3 db "CREATE TABLE users(name, full, hash NOT NULL, salt NOT NULL, created INT NOT NULL, PRIMARY KEY (name));" + sqlite3 db "INSERT INTO users values('john', 'John Ankarström', '$$2b$$10$$...v8J996R...KGui.D3H.4K7ZLj0/fl9LcenV71fja/drdObqxZK', '$$2b$$10$$...v8J996R...KGui.D3H.', 1462134896);" 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!');" |