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:
echo More to be done...
$(MAKE) -C twoway all
UNAME_S=$(shell uname -s)
.PHONY: test
test:
echo More to be done...
ifeq ($(UNAME_S),Darwin)
$(MAKE) -C user_types all
else
cd simple ; sh compile.sh && sh run.sh
$(MAKE) -C wiki_example test
$(MAKE) -C user_types test
endif
$(MAKE) -C duck_typing test
$(MAKE) -C twoway test
......
......@@ -2,7 +2,8 @@ TARGETS=client server
LABCOMM_JAR=../../compiler/labcomm_compiler.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/%)
......
......@@ -21,7 +21,12 @@
#include <errno.h>
#include <arpa/inet.h>
#ifndef LABCOMM_OS_DARWIN
#include <linux/tcp.h>
#else
#include <netinet/in.h>
#include <netinet/tcp.h>
#endif
#include <netdb.h>
#include <pthread.h>
#include <stdio.h>
......
......@@ -20,7 +20,12 @@
*/
#include <arpa/inet.h>
#ifndef LABCOMM_OS_DARWIN
#include <linux/tcp.h>
#else
#include <netinet/in.h>
#include <netinet/tcp.h>
#endif
#include <errno.h>
#include <pthread.h>
#include <stdlib.h>
......
......@@ -4,3 +4,9 @@ all:
%:
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)
LD=$(CROSS_COMPILE)ld
CFLAGS=-g -Wall -Werror -O3 -I. -Itest \
-DLABCOMM_COMPAT=\"labcomm_compat_osx.h\" \
-DLABCOMM_OS_DARWIN=1\
-Wno-tautological-compare -Wno-unused-function
LDFLAGS=-L..
LDLIBS=-llabcomm$(LIBVERSION)
......
......@@ -2,7 +2,7 @@ TESTS=basic simple nested ref
LABCOMM_JAR=../compiler/labcomm_compiler.jar
LABCOMM=java -jar $(LABCOMM_JAR)
CFLAGS=-O3 -g -Wall -Werror -Wno-unused-function
include ../lib/c/os_compat.mk
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