• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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: test_default test_strict test_links test_strict_links
13test_default: test/tests.c
14	$(CC) $(CFLAGS) $(LDFLAGS) $< -o test/$@
15	./test/$@
16test_strict: test/tests.c
17	$(CC) -DJSMN_STRICT=1 $(CFLAGS) $(LDFLAGS) $< -o test/$@
18	./test/$@
19test_links: test/tests.c
20	$(CC) -DJSMN_PARENT_LINKS=1 $(CFLAGS) $(LDFLAGS) $< -o test/$@
21	./test/$@
22test_strict_links: test/tests.c
23	$(CC) -DJSMN_STRICT=1 -DJSMN_PARENT_LINKS=1 $(CFLAGS) $(LDFLAGS) $< -o test/$@
24	./test/$@
25
26jsmn_test.o: jsmn_test.c libjsmn.a
27
28simple_example: example/simple.o libjsmn.a
29	$(CC) $(LDFLAGS) $^ -o $@
30
31jsondump: example/jsondump.o libjsmn.a
32	$(CC) $(LDFLAGS) $^ -o $@
33
34clean:
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