summaryrefslogtreecommitdiff
path: root/src/shim/mkjson/makefile
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2020-08-28 15:50:12 -0500
committerJohn Estabrook <jestabro@vyos.io>2020-08-31 09:57:00 -0500
commit163047aedabc2d43249239b0c0bdf92b8e664131 (patch)
tree097147c823c5dab2c3f041af430939084f68b682 /src/shim/mkjson/makefile
parent88985dad133d5e85aca559dbfce53207a2292e0a (diff)
downloadvyos-1x-163047aedabc2d43249239b0c0bdf92b8e664131.tar.gz
vyos-1x-163047aedabc2d43249239b0c0bdf92b8e664131.zip
configd: T2582: add mkjson for use by shim
(https://github.com/Jacajack/mkjson.git)
Diffstat (limited to 'src/shim/mkjson/makefile')
-rw-r--r--src/shim/mkjson/makefile30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/shim/mkjson/makefile b/src/shim/mkjson/makefile
new file mode 100644
index 000000000..ba75399d2
--- /dev/null
+++ b/src/shim/mkjson/makefile
@@ -0,0 +1,30 @@
+CFLAGS = -Wall -Os -I.
+CC = gcc
+AR = ar
+
+#USE_ASPRINTF make flag can be used in order to encourage asprintf use inside the library
+ifeq ($(USE_ASPRINTF),1)
+CFLAGS += -D_GNU_SOURCE
+endif
+
+#Builds object and a static library file
+all: clean force
+ $(CC) $(CFLAGS) -c mkjson.c -o obj/mkjson.o
+ $(AR) -cvq lib/libmkjson.a obj/mkjson.o
+ $(AR) -t lib/libmkjson.a
+
+#Normal cleanup
+clean:
+ -rm -rf obj
+ -rm -rf lib
+
+#Environment init
+force:
+ -mkdir obj
+ -mkdir lib
+
+#Build the example snippet
+example: all
+ gcc -o example examples/example.c -I. -Llib -lmkjson
+
+