Minor makefile cleanup
[blerg.git] / Makefile
1 CFLAGS ?= -g
2 INCLUDES = -Ilibmicrohttpd-0.9.3/src/include -Iyajl/build/yajl-1.0.11/include
3 LDFLAGS ?=
4 LIBDIRS = -Llibmicrohttpd-0.9.3/src/daemon/.libs -Lyajl/build/yajl-1.0.11/lib
5
6 targets = blerg.a blergtool http_blerg
7 blerg_a_objects = database.o tags.o
8 blergtool_objects = blergtool.o blerg.a
9 http_blerg_objects = http_blerg.o canned_responses.o auth.o blerg.a
10
11 all: $(targets)
12
13 clean:
14         rm -f $(targets) $(blerg_a_objects) $(blergtool_objects) $(http_blerg_objects)
15
16 blerg.a: $(blerg_a_objects)
17         ar rcu $@ $(blerg_a_objects)
18
19 blergtool: $(blergtool_objects)
20         gcc $(LDFLAGS) $^ -o $@
21
22 http_blerg: $(http_blerg_objects)
23         gcc $(LIBDIRS) $(LDFLAGS) $(http_blerg_objects) -lpthread -lmicrohttpd -lyajl_s -o $@
24
25 %.o: %.c
26         gcc $(INCLUDES) $(CFLAGS) -c $< -o $@