X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=Makefile;h=137844b1588eb741c769d0429e102d0b660d76f4;hb=4755aca02762c23967027d6b57a94f3c6adcc684;hp=0b99b0df19c664386668810a98c957ba4e6218f2;hpb=c18e5d36dc4788195df4bdaf536efde3a1a3d780;p=blerg.git diff --git a/Makefile b/Makefile index 0b99b0d..137844b 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,26 @@ -CFLAGS = -g -LIBS = +CFLAGS ?= -g +INCLUDES = -Ilibmicrohttpd-0.9.3/src/include -Iyajl/build/yajl-1.0.11/include +LDFLAGS ?= +LIBDIRS = -Llibmicrohttpd-0.9.3/src/daemon/.libs -Lyajl/build/yajl-1.0.11/lib -targets = blergtool -blergtool_objects = blergtool.o database.o +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 all: $(targets) clean: - rm -f $(targets) $(blergtool_objects) + rm -f $(targets) $(blerg_a_objects) $(blergtool_objects) $(http_blerg_objects) + +blerg.a: $(blerg_a_objects) + ar rcu $@ $(blerg_a_objects) blergtool: $(blergtool_objects) - gcc $^ -o $@ + gcc $(LDFLAGS) $^ -o $@ + +http_blerg: $(http_blerg_objects) + gcc $(LIBDIRS) $(LDFLAGS) $(http_blerg_objects) -lpthread -lmicrohttpd -lyajl_s -o $@ %.o: %.c - gcc $(CFLAGS) $(LIBS) -c $< -o $@ + gcc $(INCLUDES) $(CFLAGS) -c $< -o $@