Commit 1fed9bf1 authored by Sven Gestegård Robertz's avatar Sven Gestegård Robertz
Browse files

hacks to make it mostly work on MacOS X

parent 31388aec
...@@ -7,12 +7,18 @@ all: ...@@ -7,12 +7,18 @@ all:
echo More to be done... echo More to be done...
$(MAKE) -C twoway all $(MAKE) -C twoway all
UNAME_S=$(shell uname -s)
.PHONY: test .PHONY: test
test: test:
echo More to be done... echo More to be done...
ifeq ($(UNAME_S),Darwin)
$(MAKE) -C user_types all
else
cd simple ; sh compile.sh && sh run.sh cd simple ; sh compile.sh && sh run.sh
$(MAKE) -C wiki_example test $(MAKE) -C wiki_example test
$(MAKE) -C user_types test $(MAKE) -C user_types test
endif
$(MAKE) -C duck_typing test $(MAKE) -C duck_typing test
$(MAKE) -C twoway test $(MAKE) -C twoway test
......
...@@ -2,7 +2,8 @@ TARGETS=client server ...@@ -2,7 +2,8 @@ TARGETS=client server
LABCOMM_JAR=../../compiler/labcomm_compiler.jar LABCOMM_JAR=../../compiler/labcomm_compiler.jar
LABCOMM=java -jar $(LABCOMM_JAR) LABCOMM=java -jar $(LABCOMM_JAR)
CFLAGS=-O3 -g -Wall -Werror -I../../lib/c/2014 -I. -Wno-unused-function include ../../lib/c/os_compat.mk
CFLAGS+=-I../../lib/c/2014 -I.
all: $(TARGETS:%=gen/%) all: $(TARGETS:%=gen/%)
......
...@@ -21,7 +21,12 @@ ...@@ -21,7 +21,12 @@
#include <errno.h> #include <errno.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#ifndef LABCOMM_OS_DARWIN
#include <linux/tcp.h> #include <linux/tcp.h>
#else
#include <netinet/in.h>
#include <netinet/tcp.h>
#endif
#include <netdb.h> #include <netdb.h>
#include <pthread.h> #include <pthread.h>
#include <stdio.h> #include <stdio.h>
......
...@@ -20,7 +20,12 @@ ...@@ -20,7 +20,12 @@
*/ */
#include <arpa/inet.h> #include <arpa/inet.h>
#ifndef LABCOMM_OS_DARWIN
#include <linux/tcp.h> #include <linux/tcp.h>
#else
#include <netinet/in.h>
#include <netinet/tcp.h>
#endif
#include <errno.h> #include <errno.h>
#include <pthread.h> #include <pthread.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -4,3 +4,9 @@ all: ...@@ -4,3 +4,9 @@ all:
%: %:
for v in $(VERSIONS) ; do $(MAKE) -C $${v} $@ || exit 1 ; done for v in $(VERSIONS) ; do $(MAKE) -C $${v} $@ || exit 1 ; done
.PHONY: distclean
distclean:
rm *.o *.so *.so.1 *.a
...@@ -14,6 +14,7 @@ else ifeq ($(UNAME_S),Darwin) ...@@ -14,6 +14,7 @@ else ifeq ($(UNAME_S),Darwin)
LD=$(CROSS_COMPILE)ld LD=$(CROSS_COMPILE)ld
CFLAGS=-g -Wall -Werror -O3 -I. -Itest \ CFLAGS=-g -Wall -Werror -O3 -I. -Itest \
-DLABCOMM_COMPAT=\"labcomm_compat_osx.h\" \ -DLABCOMM_COMPAT=\"labcomm_compat_osx.h\" \
-DLABCOMM_OS_DARWIN=1\
-Wno-tautological-compare -Wno-unused-function -Wno-tautological-compare -Wno-unused-function
LDFLAGS=-L.. LDFLAGS=-L..
LDLIBS=-llabcomm$(LIBVERSION) LDLIBS=-llabcomm$(LIBVERSION)
......
...@@ -2,7 +2,7 @@ TESTS=basic simple nested ref ...@@ -2,7 +2,7 @@ TESTS=basic simple nested ref
LABCOMM_JAR=../compiler/labcomm_compiler.jar LABCOMM_JAR=../compiler/labcomm_compiler.jar
LABCOMM=java -jar $(LABCOMM_JAR) LABCOMM=java -jar $(LABCOMM_JAR)
CFLAGS=-O3 -g -Wall -Werror -Wno-unused-function include ../lib/c/os_compat.mk
all: all:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment