annotate Makefile @ 0:15a06aa20298

misc: initial import
author David Demelier <markand@malikania.fr>
date Tue, 04 Feb 2020 13:35:52 +0100
parents
children 836a698946f8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 #
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
2 # Makefile -- basic makefile for paster
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 #
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
4 # Copyright (c) 2020 David Demelier <markand@malikania.fr>
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 #
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 # Permission to use, copy, modify, and/or distribute this software for any
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 # purpose with or without fee is hereby granted, provided that the above
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 # copyright notice and this permission notice appear in all copies.
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 #
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
17 #
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
18
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
19 .POSIX:
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
20
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
21 CC= cc
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
22 CFLAGS= -std=c18 -Wall -Wextra -pedantic -D_XOPEN_SOURCE=700 -g
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
23 # Release
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
24 # CFLAGS= -std=c18 -Wall -Wextra -pedantic -O3 -DNDEBUG -D_XOPEN_SOURCE=700
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
25 LDFLAGS= -static -lkcgi -lz
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
26
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
27 SRCS= database.c log.c pasterd.c paste.c util.c
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
28 OBJS= ${SRCS:.c=.o}
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
29 DEPS= ${SRCS:.c=.d}
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
30
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
31 SQLITE_FLAGS= -DSQLITE_THREADSAFE=0 \
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
32 -DSQLITE_OMIT_LOAD_EXTENSION \
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
33 -DSQLITE_OMIT_DEPRECATED \
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
34 -DSQLITE_DEFAULT_FOREIGN_KEYS=1
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
35
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
36 UID= www
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
37
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
38 .SUFFIXES:
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
39 .SUFFIXES: .c .o
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
40
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
41 all: paster
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
42
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
43 -include ${DEPS}
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
44
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
45 .c.o:
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
46 ${CC} ${CFLAGS} -MMD -Iextern -c $<
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
47
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
48 extern/sqlite3.o: extern/sqlite3.c extern/sqlite3.h
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
49 ${CC} ${CFLAGS} ${SQLITE_FLAGS} -MMD -c $< -o $@
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
50
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
51 extern/libsqlite3.a: extern/sqlite3.o
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
52 ${AR} -rc $@ $<
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
53
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
54 pasterd: ${OBJS} extern/libsqlite3.a
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
55 ${CC} -o $@ ${OBJS} ${LDFLAGS} extern/libsqlite3.a
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
56
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
57 clean:
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
58 rm -f extern/sqlite3.o extern/libsqlite3.a
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
59 rm -f pasterd ${OBJS} ${DEPS}
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
60
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
61 run: pasterd
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
62 kfcgi -dv -s ./paster.sock -u ${UID} -U ${UID} -p . -- pasterd -f
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
63
15a06aa20298 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
64 .PHONY: all clean run