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