1# You can put your build options here
2-include config.mk
3
4all: libjsmn.a 
5
6libjsmn.a: jsmn.o
7	$(AR) rc $@ $^
8
9%.o: %.c jsmn.h
10	$(CC) -c $(CFLAGS) $< -o $@
11
12test: jsmn_test
13	./jsmn_test
14
15jsmn_test: jsmn_test.o
16	$(CC) $(LDFLAGS) -L. -ljsmn $< -o $@
17
18jsmn_test.o: jsmn_test.c libjsmn.a
19
20simple_example: example/simple.o libjsmn.a
21	$(CC) $(LDFLAGS) $^ -o $@
22
23jsondump: example/jsondump.o libjsmn.a
24	$(CC) $(LDFLAGS) $^ -o $@
25
26clean:
27	rm -f jsmn.o jsmn_test.o example/simple.o
28	rm -f jsmn_test
29	rm -f jsmn_test.exe
30	rm -f libjsmn.a
31	rm -f simple_example
32	rm -f jsondump
33
34.PHONY: all clean test
35
36