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
Sven Gestegård Robertz
LabComm
Commits
41a77020
Commit
41a77020
authored
Apr 29, 2015
by
Sven Gestegård Robertz
Browse files
hacked Makefiles to make it build on macOs
parent
9a42874e
Changes
2
Hide whitespace changes
Inline
Side-by-side
examples/twoway/Makefile
View file @
41a77020
...
...
@@ -2,41 +2,45 @@ UNAME_S=$(shell uname -s)
TARGETS
=
client server
LABCOMM_JAR
=
../../compiler/labcomm2014_compiler.jar
LABCOMM
=
java
-jar
$(LABCOMM_JAR)
LABCOMM
=
java
-jar
$(LABCOMM_JAR)
#include ../../lib/c/os_compat.mk
CFLAGS
=
-O3
-g
-Wall
-Werror
-I
../../lib/c/2014
-I
.
-Wno-unused-function
ifeq
($(UNAME_S),Darwin)
CFLAGS
+=
-DLABCOMM_COMPAT
=
\"
labcomm_compat_osx.h
\"
-DLABCOMM_OS_DARWIN
=
1
-Wno-tautological-compare
CFLAGS
+=
-DLABCOMM_COMPAT
=
\"
labcomm2014_compat_osx.h
\"
-DLABCOMM_OS_DARWIN
=
1
else
CFLAGS
+=
-Wno-tautological-compare
endif
all
:
$(TARGETS:%=gen/%)
test
:
all
LD_LIBRARY_PATH
=
../../lib/c ./gen/server 2000 &
LD_LIBRARY_PATH
=
../../lib/c ./gen/client localhost 2000
LD_LIBRARY_PATH
=
../../lib/c ./gen/client localhost 2000
gen/.dir
:
mkdir
-p
$@
.PRECIOUS
:
gen/%.o
gen/%.o
:
gen/%.c | gen/.dir
$(CC)
$(CFLAGS)
-c
-o
$@
$<
$(CC)
$(CFLAGS)
-c
-o
$@
$<
gen/%.o
:
%.c | gen/.dir
$(CC)
$(CFLAGS)
-c
-o
$@
$<
$(CC)
$(CFLAGS)
-c
-o
$@
$<
.PRECIOUS
:
gen/%.c gen/%.h
gen/%.c gen/%.h
:
%.lc | gen/.dir
$(LABCOMM)
--c
=
gen/
$*
.c
--h
=
gen/
$*
.h
$<
gen/client
:
client.c
gen/client
:
client.c
$(CC)
-o
$@
$(CFLAGS)
$^
-lpthread
\
-L
../../lib/c
-llabcomm2014
gen/server
:
server.c
gen/server
:
server.c
$(CC)
-o
$@
$(CFLAGS)
$^
-lpthread
\
-L
../../lib/c
-llabcomm2014
-L
../../lib/c
-llabcomm2014
.PHONY
:
clean distclean
clean distclean
:
...
...
@@ -48,7 +52,7 @@ gen/introspecting.o: introspecting.h
gen/introspecting.o
:
gen/introspecting_messages.h
gen/client.o
:
decimating.h
gen/client.o
:
gen/types.h
gen/client
:
gen/decimating.o
gen/client
:
gen/decimating.o
gen/client
:
gen/decimating_messages.o
gen/client
:
gen/introspecting.o
gen/client
:
gen/introspecting_messages.o
...
...
lib/c/os_compat.mk
View file @
41a77020
...
...
@@ -15,7 +15,7 @@ else ifeq ($(UNAME_S),Darwin)
CC
=
$(CROSS_COMPILE)
gcc
LD
=
$(CROSS_COMPILE)
gcc
CFLAGS
=
-g
-Wall
-Werror
-O3
-I
.
-Itest
\
-DLABCOMM_COMPAT
=
\"
labcomm_compat_osx.h
\"
\
-DLABCOMM_COMPAT
=
\"
labcomm
$(LIBVERSION)
_compat_osx.h
\"
\
-DLABCOMM_OS_DARWIN
=
1
# -Wno-tautological-compare -Wno-unused-function
CFLAGS
+=
-std
=
c99
...
...
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