UNAME = ${shell uname}
ifeq (${UNAME}, Darwin)
-LDFLAGS += -framework GLUT -framework OpenGL
+LDFLAGS += -framework GLUT -framework OpenGL
else
ifeq (${UNAME}, Linux)
-CFLAGS += ${shell pkg-config --cflags glu}
-LDFLAGS += ${shell pkg-config --libs glu} -lglut
+CPPFLAGS += ${shell pkg-config --cflags glu}
+LDFLAGS += ${shell pkg-config --libs glu} -lglut
else
-CFLAGS += ${shell pkg-config --cflags glu glut} -DFREEBSD=1
-LDFLAGS += ${shell pkg-config --libs glu glut}
+CPPFLAGS += ${shell pkg-config --cflags glu glut} -DFREEBSD=1
+LDFLAGS += ${shell pkg-config --libs glu glut}
endif
endif
ifeq (${UNAME}, FreeBSD)
-CFLAGS += -DFREEBSD=1 -DNO_ALLOCA=1
+CPPFLAGS += -DFREEBSD=1 -DNO_ALLOCA=1
endif
VPATH += ../shared
# for the Open Motion Controller board
-CFLAGS += -DMOTHERBOARD=91
-CFLAGS += ${shell pkg-config --cflags pangocairo}
+CPPFLAGS += -DMOTHERBOARD=91
+CPPFLAGS += ${shell pkg-config --cflags pangocairo}
include ../Makefile.opengl
C3SRC = ${wildcard src/c3/*.c}
C3OBJ = ${patsubst src/c3%,${OBJ}%,${C3SRC:.c=.o}}
-CFLAGS += ${patsubst %,-I%,${subst :, ,${IPATH}}}
+CPPFLAGS += ${patsubst %,-I%,${subst :, ,${IPATH}}}
all: obj ${firmware} ${target}
# it otherwise eat quite a bit of few cycles, even disabled
#CFLAGS += -DCONFIG_SIMAVR_TRACE=1
-all: obj config ${target}
+all: obj config libsimavr ${target}
include ../Makefile.common
# Static library
#
${OBJ}/libsimavr.a : ${sim_o}
+ifeq ($(V),1)
+ $(AR) cru $@ $^ && $(RANLIB) $@
+else
@echo AR $@
@$(AR) cru $@ $^ && $(RANLIB) $@
+endif
#
# Shared library (Linux)
#
${OBJ}/libsimavr.so.1 : ${sim_o}
+ifeq ($(V),1)
+ $(CC) -shared -Wl,-soname,libsimavr.so.1 -o $@ $^
+else
@echo SHARED $@
@$(CC) -shared -Wl,-soname,libsimavr.so.1 -o $@ $^
+endif
${OBJ}/libsimavr.so : ${OBJ}/libsimavr.so.1
ln -sf libsimavr.so.1 $@
libsimavr : ${OBJ}/libsimavr.so
endif
-${OBJ}/${target}.o : libsimavr
${OBJ}/${target}.elf : ${OBJ}/${target}.o
${target} : ${OBJ}/${target}.elf