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 blerg.httpd blerg.cgi rss.cgi
12 blerg_a_objects = database/database.o database/tags.o database/util.o
13 blergtool_objects = tools/blergtool.o blerg.a
14 rss_objects = cgi/rss.o cgi/canned_responses.o common/app.o common/escapery.o blerg.a
15 http_blerg_objects = http/http_blerg.o http/canned_responses.o common/app.o common/json.o common/auth.o blerg.a
16 cgi_blerg_objects = cgi/cgi_blerg.o cgi/canned_responses.o common/app.o common/json.o common/auth.o blerg.a
21 rm -f $(targets) $(blerg_a_objects) $(blergtool_objects) $(http_blerg_objects) $(cgi_blerg_objects) $(rss_objects)
23 blerg.a: $(blerg_a_objects)
24 ar rcu $@ $(blerg_a_objects)
26 blergtool: $(blergtool_objects)
27 gcc $(LDFLAGS) $^ -o $@
29 blerg.httpd: $(http_blerg_objects)
30 gcc $(HTTP_LIBDIRS) $(LDFLAGS) $(http_blerg_objects) -lpthread -lmicrohttpd -lyajl_s -o $@
32 blerg.cgi: $(cgi_blerg_objects)
33 gcc $(CGI_LIBDIRS) $(LDFLAGS) $(cgi_blerg_objects) -lcgi-util -lyajl_s -o $@
35 rss.cgi: $(rss_objects)
36 gcc $(CGI_LIBDIRS) $(LDFLAGS) $(rss_objects) -lcgi-util -o $@
39 gcc $(INCLUDES) $(HTTP_INCLUDES) $(CFLAGS) -c $< -o $@
42 gcc $(INCLUDES) $(CGI_INCLUDES) $(CFLAGS) -c $< -o $@
45 gcc $(INCLUDES) $(CFLAGS) -c $< -o $@