X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=Makefile;h=5113e701f6898df8fee225723cd599cbf1c9dda7;hb=88b2727cbe5eb12a74f83085938670ac348a27d3;hp=709b6b95130f448680f7e412343379d8186688b1;hpb=453451e03c0e8295031656671eb92fa8b8b0779d;p=blerg.git diff --git a/Makefile b/Makefile index 709b6b9..5113e70 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,31 @@ -libmicrohttpd_a = libmicrohttpd-0.9.3/src/daemon/.libs/libmicrohttpd.a - -CFLAGS = -g -Ilibmicrohttpd-0.9.3/src/include -LIBS = - -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 blerg.a +CFLAGS ?= -g +INCLUDES = -I. -Ifcgi -Idatabase -Icommon -Icgi-util-2.2.1 -Ilibmicrohttpd-0.9.3/src/include -Iyajl/build/yajl-1.0.11/include +LDFLAGS ?= +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 cgi_blerg +blerg_a_objects = database/database.o database/tags.o +blergtool_objects = tools/blergtool.o blerg.a +http_blerg_objects = http/http_blerg.o http/canned_responses.o common/app.o common/auth.o blerg.a +cgi_blerg_objects = cgi/cgi_blerg.o common/app.o common/auth.o blerg.a all: $(targets) clean: rm -f $(targets) $(blerg_a_objects) $(blergtool_objects) $(http_blerg_objects) - -cd libmicrohttpd-0.9.3 && make distclean blerg.a: $(blerg_a_objects) ar rcu $@ $(blerg_a_objects) -$(libmicrohttpd_a): - cd libmicrohttpd-0.9.3 && ./configure --disable-https --disable-shared && make - blergtool: $(blergtool_objects) - gcc $^ -o $@ + gcc $(LDFLAGS) $^ -o $@ + +http_blerg: $(http_blerg_objects) + gcc $(HTTP_LIBDIRS) $(LDFLAGS) $(http_blerg_objects) -lpthread -lmicrohttpd -lyajl_s -o $@ -http_blerg: $(http_blerg_objects) $(libmicrohttpd_a) - gcc $(http_blerg_objects) -lpthread $(libmicrohttpd_a) -o $@ +cgi_blerg: $(cgi_blerg_objects) + gcc $(CGI_LIBDIRS) $(LDFLAGS) $(cgi_blerg_objects) -lcgi-util -lyajl_s -o $@ %.o: %.c - gcc $(CFLAGS) $(LIBS) -c $< -o $@ + gcc $(INCLUDES) $(CFLAGS) -c $< -o $@