From: Michel Pollet Date: Mon, 28 May 2012 09:17:34 +0000 (+0100) Subject: Makefile: Use CPPFLAGS for -I stuff X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=0c9c532655ac7980345db9306ce7283ec98e1ac8;hp=f5c4abeb873c4e94054e582273c84f9b1c3f9834;p=simavr Makefile: Use CPPFLAGS for -I stuff CFLAGS is for code generation Signed-off-by: Michel Pollet --- diff --git a/examples/Makefile.opengl b/examples/Makefile.opengl index 4b1f3a8..5d30b80 100644 --- a/examples/Makefile.opengl +++ b/examples/Makefile.opengl @@ -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 diff --git a/examples/board_reprap/Makefile b/examples/board_reprap/Makefile index ccc3f4d..d3c2cb4 100644 --- a/examples/board_reprap/Makefile +++ b/examples/board_reprap/Makefile @@ -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} diff --git a/simavr/Makefile b/simavr/Makefile index 61e0efc..7a67d32 100644 --- a/simavr/Makefile +++ b/simavr/Makefile @@ -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