forked from zserge/jsmn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (36 loc) · 1.11 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# You can put your build options here
-include config.mk
CFLAGS:=${CFLAGS} -std=c89 -Wno-invalid-source-encoding
test: test_default test_default_low_memory test_permissive test_permissive_low_memory
test_default: test/tests.c
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o test/$@
./test/$@
test_default_low_memory: test/tests.c
$(CC) -DJSMN_LOW_MEMORY $(CFLAGS) $(LDFLAGS) $^ -o test/$@
./test/$@
test_permissive: test/tests.c
$(CC) -DJSMN_PERMISSIVE $(CFLAGS) $(LDFLAGS) $^ -o test/$@
./test/$@
test_permissive_low_memory: test/tests.c
$(CC) -DJSMN_PERMISSIVE -DJSMN_LOW_MEMORY $(CFLAGS) $(LDFLAGS) $^ -o test/$@
./test/$@
simple_example: example/simple.c
$(CC) $(LDFLAGS) $^ -o $@
jsondump: example/jsondump.c
$(CC) $(LDFLAGS) $^ -o $@
explode: example/explode.c jsmn_utils.c
$(CC) $(LDFLAGS) $^ -o $@
fmt:
clang-format -i jsmn.h test/*.[ch] example/*.[ch]
lint:
clang-tidy jsmn.h --checks='*'
clean:
rm -f *.o example/*.o
rm -f simple_example
rm -f jsondump
rm -f explode
rm -f test/test_default
rm -f test/test_default_low_memory
rm -f test/test_permissive
rm -f test/test_permissive_low_memory
.PHONY: clean test