Permalink
Browse files

Add support to build on Linux from running make in build

  • Loading branch information...
1 parent 9da825f commit 7b92f48e8706afc4e12286962670e4ee24466a9b @trondn committed Mar 26, 2012
Showing with 27 additions and 0 deletions.
  1. +27 −0 build/Linux/Makefile
View
@@ -0,0 +1,27 @@
+CC=gcc
+LDFLAGS=-Wl,--rpath=\$$ORIGIN/../lib
+CFLAGS=-std=gnu89 -pedantic -O3 -ggdb3 -DJSONSL_STATE_GENERIC
+
+all: bin/json_test lib/libjsonsl.so
+bin lib obj:; -@mkdir -p $@
+
+bin/json_test: bin obj obj/json_test.o lib/libjsonsl.so
+ $(LINK.c) -g -ggdb3 -o $@ obj/json_test.o -Llib -ljsonsl
+
+share: json_samples.tgz
+ tar xfz $^
+
+check: bin/json_test share
+ JSONSL_QUIET_TESTS=1 ./bin/json_test share/*
+
+lib/libjsonsl.so: lib obj/jsonsl.o
+ $(LINK.c) -g -ggdb3 -shared -fPIC -o $@ obj/jsonsl.o
+
+obj/json_test.o: obj json_test.c
+ $(COMPILE.c) -o $@ json_test.c
+
+obj/jsonsl.o: obj jsonsl.c jsonsl.h
+ $(COMPILE.c) -g -ggdb3 -shared -fPIC -o $@ jsonsl.c
+
+clean:
+ $(RM) -r obj lib bin share

0 comments on commit 7b92f48

Please sign in to comment.