X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=Makefile;h=2e49315f050987c6226d421d0255103bd03ad311;hb=96ec261b36bdbb701e05f5ee1aab70dec44085f9;hp=c0050dbbda6087c4e369e0c9a9ca0f4fc8f22072;hpb=82f9ef6f267b3fcbd0052ef809dbe6df5de5a925;p=blerg.git diff --git a/Makefile b/Makefile index c0050db..2e49315 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,31 @@ -CFLAGS = -g -LIBS = - -targets = blerg.a blergtool tag_test -blerg_a_objects = database.o tags.o -blergtool_objects = blergtool.o blerg.a - -tag_test_objects = tag_test.o tags.o +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 database/util.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) + 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 $(HTTP_LIBDIRS) $(LDFLAGS) $(http_blerg_objects) -lpthread -lmicrohttpd -lyajl_s -o $@ -tag_test: $(tag_test_objects) - gcc $^ -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 $@