4 INCLUDES = -I. -Idatabase -Icommon $(YAJL_INCLUDES)
5 HTTP_INCLUDES = -Ihttp $(MHD_INCLUDES)
6 CGI_INCLUDES = -Icgi $(CGI_UTIL_INCLUDES)
8 HTTP_LIBDIRS = $(MHD_LIBDIR) $(YAJL_LIBDIR)
9 CGI_LIBDIRS = $(CGI_UTIL_LIBDIR) $(YAJL_LIBDIR)
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
22 rm -f $(targets) $(blerg_a_objects) $(blergtool_objects) $(http_blerg_objects) $(cgi_blerg_objects) $(rss_objects)
24 blerg.a: $(blerg_a_objects)
25 ar rcu $@ $(blerg_a_objects)
27 blergtool: $(blergtool_objects)
28 gcc $(LDFLAGS) $^ -o $@
30 blerglatest: $(blerglatest_objects)
31 gcc $(YAJL_LIBDIR) $(LDFLAGS) $^ -lyajl_s -o $@
33 blerg.httpd: $(http_blerg_objects)
34 gcc $(HTTP_LIBDIRS) $(LDFLAGS) $(http_blerg_objects) -lpthread -lmicrohttpd -lyajl_s -o $@
36 blerg.cgi: $(cgi_blerg_objects)
37 gcc $(CGI_LIBDIRS) $(LDFLAGS) $(cgi_blerg_objects) -lcgi-util -lyajl_s -o $@
39 rss.cgi: $(rss_objects)
40 gcc $(CGI_LIBDIRS) $(LDFLAGS) $(rss_objects) -lcgi-util -o $@
43 gcc $(INCLUDES) $(HTTP_INCLUDES) $(CFLAGS) -c $< -o $@
46 gcc $(INCLUDES) $(CGI_INCLUDES) $(CFLAGS) -c $< -o $@
49 gcc $(INCLUDES) $(CFLAGS) -c $< -o $@