Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tommy Olofsson
LabComm
Commits
1fed9bf1
Commit
1fed9bf1
authored
Jan 19, 2015
by
Sven Gestegård Robertz
Browse files
hacks to make it mostly work on MacOS X
parent
31388aec
Changes
10
Hide whitespace changes
Inline
Side-by-side
examples/Makefile
View file @
1fed9bf1
...
@@ -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
...
...
examples/twoway/Makefile
View file @
1fed9bf1
...
@@ -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/%)
...
...
examples/twoway/client.c
View file @
1fed9bf1
...
@@ -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>
...
...
examples/twoway/server.c
View file @
1fed9bf1
...
@@ -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>
...
...
lib/c/2006/labcomm
2006
_compat_arm_cortexm3.h
→
lib/c/2006/labcomm_compat_arm_cortexm3.h
View file @
1fed9bf1
File moved
lib/c/2006/labcomm
2006
_compat_osx.h
→
lib/c/2006/labcomm_compat_osx.h
View file @
1fed9bf1
File moved
lib/c/2006/labcomm
2006
_compat_vxworks.h
→
lib/c/2006/labcomm_compat_vxworks.h
View file @
1fed9bf1
File moved
lib/c/Makefile
View file @
1fed9bf1
...
@@ -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
lib/c/os_compat.mk
View file @
1fed9bf1
...
@@ -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)
...
...
test/Makefile
View file @
1fed9bf1
...
@@ -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
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment