Permalink
Browse files

Allow to build the system without a GNU toolchain

  • Loading branch information...
1 parent ae429fa commit 9da825f11febdc723a2ff1be9e9d27e39f6198b5 @trondn committed Mar 26, 2012
Showing with 40 additions and 0 deletions.
  1. +2 −0 build/Makefile
  2. +13 −0 build/SunOS/Makefile
  3. +25 −0 build/SunOS/Makefile.mk
View
@@ -0,0 +1,2 @@
+all check clean:
+ @(cd ../; $(MAKE) -f build/`uname -s`/Makefile $@)
View
@@ -0,0 +1,13 @@
+all check clean:
+ @$(MAKE) -f build/SunOS/Makefile.mk \
+ CFLAGS="-DJSONSL_STATE_GENERIC -m32" \
+ LDFLAGS="-m32" ORIGINREL=".." \
+ LIBDIR=lib BINDIR=bin OBJDIR=obj/32 \
+ CC=c89 $@
+ @$(MAKE) -f build/SunOS/Makefile.mk \
+ CFLAGS="-DJSONSL_STATE_GENERIC -m64" \
+ LDFLAGS="-m64" ORIGINREL="../.." \
+ LIBDIR=lib/`isainfo -n` \
+ BINDIR=bin/`isainfo -n` \
+ OBJDIR=obj/`isainfo -n` \
+ CC=c89 $@
View
@@ -0,0 +1,25 @@
+RPATH=\$$ORIGIN/$(ORIGINREL)/$(LIBDIR)
+all: $(BINDIR)/json_test $(LIBDIR)/libjsonsl.so
+
+$(BINDIR) $(LIBDIR) $(OBJDIR):; -@mkdir -p $@
+
+$(BINDIR)/json_test: $(BINDIR) $(OBJDIR) $(OBJDIR)/json_test.o $(LIBDIR)/libjsonsl.so
+ $(LINK.c) -R$(RPATH) -o $@ $(OBJDIR)/json_test.o -L$(LIBDIR) -ljsonsl
+
+share: json_samples.tgz
+ gzcat $^ | tar xf -
+
+check: $(BINDIR)/json_test share
+ JSONSL_QUIET_TESTS=1 ./$(BINDIR)/json_test share/*
+
+$(LIBDIR)/libjsonsl.so: $(LIBDIR) $(OBJDIR)/jsonsl.o
+ $(LINK.c) -G -KPIC -R$(RPATH) -o $@ $(OBJDIR)/jsonsl.o
+
+$(OBJDIR)/json_test.o: $(OBJDIR) json_test.c
+ $(COMPILE.c) -o $@ json_test.c
+
+$(OBJDIR)/jsonsl.o: $(OBJDIR) jsonsl.c jsonsl.h
+ $(COMPILE.c) -KPIC -o $@ jsonsl.c
+
+clean:
+ $(RM) -r $(OBJDIR) $(LIBDIR) $(BINDIR) share

0 comments on commit 9da825f

Please sign in to comment.