In retrospect, using POST params for subscribe was stupid
[blerg.git] / Makefile
1 include libs.mk
2
3 CFLAGS ?= -g
4 INCLUDES = -I. -Idatabase -Icommon $(YAJL_INCLUDES)
5 HTTP_INCLUDES = -Ihttp $(MHD_INCLUDES)
6 CGI_INCLUDES = -Icgi $(CGI_UTIL_INCLUDES)
7 LDFLAGS ?=
8 HTTP_LIBDIRS = $(MHD_LIBDIR) $(YAJL_LIBDIR)
9 CGI_LIBDIRS = $(CGI_UTIL_LIBDIR) $(YAJL_LIBDIR)
10
11 targets = blerg.a blergtool blerglatest blerg.httpd blerg.cgi rss.cgi
12 blerg_a_objects = database/database.o database/tags.o database/util.o database/subscription.o common/stringbucket.o
13 blergtool_objects = tools/blergtool.o blerg.a
14 blerglatest_objects = tools/blerglatest.o blerg.a common/json.o
15 rss_objects = cgi/rss.o cgi/canned_responses.o common/app.o common/escapery.o blerg.a
16 http_blerg_objects = http/http_blerg.o http/canned_responses.o common/app.o common/json.o common/auth.o blerg.a
17 cgi_blerg_objects = cgi/cgi_blerg.o cgi/canned_responses.o common/app.o common/json.o common/auth.o blerg.a
18
19 all: $(targets)
20
21 clean:
22         rm -f $(targets) $(blerg_a_objects) $(blergtool_objects) $(http_blerg_objects) $(cgi_blerg_objects) $(rss_objects)
23
24 blerg.a: $(blerg_a_objects)
25         ar rcu $@ $(blerg_a_objects)
26
27 blergtool: $(blergtool_objects)
28         gcc $(LDFLAGS) $^ -o $@
29
30 blerglatest: $(blerglatest_objects)
31         gcc $(YAJL_LIBDIR) $(LDFLAGS) $^ -lyajl_s -o $@
32
33 blerg.httpd: $(http_blerg_objects)
34         gcc $(HTTP_LIBDIRS) $(LDFLAGS) $(http_blerg_objects) -lpthread -lmicrohttpd -lyajl_s -o $@
35
36 blerg.cgi: $(cgi_blerg_objects)
37         gcc $(CGI_LIBDIRS) $(LDFLAGS) $(cgi_blerg_objects) -lcgi-util -lyajl_s -o $@
38
39 rss.cgi: $(rss_objects)
40         gcc $(CGI_LIBDIRS) $(LDFLAGS) $(rss_objects) -lcgi-util -o $@
41
42 http/%.o: http/%.c
43         gcc $(INCLUDES) $(HTTP_INCLUDES) $(CFLAGS) -c $< -o $@
44
45 cgi/%.o: cgi/%.c
46         gcc $(INCLUDES) $(CGI_INCLUDES) $(CFLAGS) -c $< -o $@
47
48 %.o: %.c
49         gcc $(INCLUDES) $(CFLAGS) -c $< -o $@