X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=Makefile;h=640be85a90ef48fe6024abbaefb196f52be6bf70;hb=213e6e64dd863fd39d0db7c6fb4ccf1970a868fb;hp=137844b1588eb741c769d0429e102d0b660d76f4;hpb=4755aca02762c23967027d6b57a94f3c6adcc684;p=blerg.git diff --git a/Makefile b/Makefile index 137844b..640be85 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,22 @@ CFLAGS ?= -g -INCLUDES = -Ilibmicrohttpd-0.9.3/src/include -Iyajl/build/yajl-1.0.11/include +INCLUDES = -I. -Idatabase -Icommon -Iyajl/build/yajl-1.0.11/include +HTTP_INCLUDES = -Ihttp -Ilibmicrohttpd-0.9.3/src/include +CGI_INCLUDES = -Icgi -Icgi-util-2.2.1 LDFLAGS ?= -LIBDIRS = -Llibmicrohttpd-0.9.3/src/daemon/.libs -Lyajl/build/yajl-1.0.11/lib +HTTP_LIBDIRS = -Llibmicrohttpd-0.9.3/src/daemon/.libs -Lyajl/build/yajl-1.0.11/lib +CGI_LIBDIRS = -Lcgi-util-2.2.1 -Lyajl/build/yajl-1.0.11/lib -targets = blerg.a blergtool http_blerg -blerg_a_objects = database.o tags.o -blergtool_objects = blergtool.o blerg.a -http_blerg_objects = http_blerg.o canned_responses.o auth.o blerg.a +targets = blerg.a blergtool http_blerg cgi_blerg rss +blerg_a_objects = database/database.o database/tags.o database/util.o +blergtool_objects = tools/blergtool.o blerg.a +rss_objects = cgi/rss.o cgi/canned_responses.o common/app.o common/escapery.o blerg.a +http_blerg_objects = http/http_blerg.o http/canned_responses.o common/app.o common/json.o common/auth.o blerg.a +cgi_blerg_objects = cgi/cgi_blerg.o cgi/canned_responses.o common/app.o common/json.o common/auth.o blerg.a all: $(targets) clean: - rm -f $(targets) $(blerg_a_objects) $(blergtool_objects) $(http_blerg_objects) + rm -f $(targets) $(blerg_a_objects) $(blergtool_objects) $(http_blerg_objects) $(cgi_blerg_objects) $(rss_objects) blerg.a: $(blerg_a_objects) ar rcu $@ $(blerg_a_objects) @@ -20,7 +25,19 @@ blergtool: $(blergtool_objects) gcc $(LDFLAGS) $^ -o $@ http_blerg: $(http_blerg_objects) - gcc $(LIBDIRS) $(LDFLAGS) $(http_blerg_objects) -lpthread -lmicrohttpd -lyajl_s -o $@ + gcc $(HTTP_LIBDIRS) $(LDFLAGS) $(http_blerg_objects) -lpthread -lmicrohttpd -lyajl_s -o $@ + +cgi_blerg: $(cgi_blerg_objects) + gcc $(CGI_LIBDIRS) $(LDFLAGS) $(cgi_blerg_objects) -lcgi-util -lyajl_s -o $@ + +rss: $(rss_objects) + gcc $(CGI_LIBDIRS) $(LDFLAGS) $(rss_objects) -lcgi-util -o $@ + +http/%.o: http/%.c + gcc $(INCLUDES) $(HTTP_INCLUDES) $(CFLAGS) -c $< -o $@ + +cgi/%.o: cgi/%.c + gcc $(INCLUDES) $(CGI_INCLUDES) $(CFLAGS) -c $< -o $@ %.o: %.c gcc $(INCLUDES) $(CFLAGS) -c $< -o $@