aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2018-09-06 14:52:29 -0700
committerHaibo Huang <hhb@google.com>2018-09-07 00:06:54 +0000
commit8e49843295ad2c5113d03766e466eef438b4c8d6 (patch)
tree746a1b2df268d632637462ef0d97d29db49a53ae /Makefile
parent0945105514d9e025c67a9cbc64b3e96e40ed999c (diff)
downloadjsmn-8e49843295ad2c5113d03766e466eef438b4c8d6.tar.gz
Test: m checkbuild Change-Id: I94ec65cb78b0ed1f469320bb2d66778f0488b429
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile34
1 files changed, 24 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 28f59dc..f89701f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
# You can put your build options here
-include config.mk
-all: libjsmn.a
+all: libjsmn.a
libjsmn.a: jsmn.o
$(AR) rc $@ $^
@@ -9,19 +9,33 @@ libjsmn.a: jsmn.o
%.o: %.c jsmn.h
$(CC) -c $(CFLAGS) $< -o $@
-test: jsmn_test
- ./jsmn_test
-
-jsmn_test: jsmn_test.o
- $(CC) -L. -ljsmn $< -o $@
+test: test_default test_strict test_links test_strict_links
+test_default: test/tests.c
+ $(CC) $(CFLAGS) $(LDFLAGS) $< -o test/$@
+ ./test/$@
+test_strict: test/tests.c
+ $(CC) -DJSMN_STRICT=1 $(CFLAGS) $(LDFLAGS) $< -o test/$@
+ ./test/$@
+test_links: test/tests.c
+ $(CC) -DJSMN_PARENT_LINKS=1 $(CFLAGS) $(LDFLAGS) $< -o test/$@
+ ./test/$@
+test_strict_links: test/tests.c
+ $(CC) -DJSMN_STRICT=1 -DJSMN_PARENT_LINKS=1 $(CFLAGS) $(LDFLAGS) $< -o test/$@
+ ./test/$@
jsmn_test.o: jsmn_test.c libjsmn.a
+simple_example: example/simple.o libjsmn.a
+ $(CC) $(LDFLAGS) $^ -o $@
+
+jsondump: example/jsondump.o libjsmn.a
+ $(CC) $(LDFLAGS) $^ -o $@
+
clean:
- rm -f jsmn.o jsmn_test.o
- rm -f jsmn_test
- rm -f jsmn_test.exe
- rm -f libjsmn.a
+ rm -f *.o example/*.o
+ rm -f *.a *.so
+ rm -f simple_example
+ rm -f jsondump
.PHONY: all clean test