-CFLAGS = -g -Ilibmicrohttpd-0.9.3/src/include -Iyajl/build/yajl-1.0.11/include
-LDFLAGS = -Llibmicrohttpd-0.9.3/src/daemon/.libs -Lyajl/build/yajl-1.0.11/lib
+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 = blerg.a blergtool http_blerg
blerg_a_objects = database.o tags.o
ar rcu $@ $(blerg_a_objects)
blergtool: $(blergtool_objects)
- gcc $^ -o $@
+ gcc $(LDFLAGS) $^ -o $@
http_blerg: $(http_blerg_objects)
- gcc $(LDFLAGS) $(http_blerg_objects) -lpthread -lmicrohttpd -lyajl_s -o $@
+ gcc $(LIBDIRS) $(LDFLAGS) $(http_blerg_objects) -lpthread -lmicrohttpd -lyajl_s -o $@
%.o: %.c
- gcc $(CFLAGS) $(LIBS) -c $< -o $@
+ gcc $(INCLUDES) $(CFLAGS) -c $< -o $@