Makefile: Use CPPFLAGS for -I stuff
authorMichel Pollet <buserror@gmail.com>
Mon, 28 May 2012 09:17:34 +0000 (10:17 +0100)
committerMichel Pollet <buserror@gmail.com>
Mon, 28 May 2012 09:17:34 +0000 (10:17 +0100)
CFLAGS is for code generation

Signed-off-by: Michel Pollet <buserror@gmail.com>
examples/Makefile.opengl
examples/board_reprap/Makefile
simavr/Makefile

index 4b1f3a8..5d30b80 100644 (file)
@@ -2,17 +2,17 @@
 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
index ccc3f4d..d3c2cb4 100644 (file)
@@ -34,8 +34,8 @@ VPATH += ../parts
 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
 
@@ -46,7 +46,7 @@ LDFLAGS += -lm
 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}
index 61e0efc..7a67d32 100644 (file)
@@ -26,7 +26,7 @@ CFLAGS        += -Werror
 # 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
 
@@ -46,15 +46,23 @@ IPATH       += ../include
 # 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 $@
@@ -65,7 +73,6 @@ ifeq (${shell uname}, Linux)
 libsimavr      :       ${OBJ}/libsimavr.so
 endif
 
-${OBJ}/${target}.o             : libsimavr 
 ${OBJ}/${target}.elf   : ${OBJ}/${target}.o
 
 ${target}      : ${OBJ}/${target}.elf