How to suppress "linker file not used" at compilation

part of my makefile looks like this:

ifdef vis 
flg += -framework GLUT -framework OpenGL -Dvis
obj += camfun.o glfuns.o
endif

...

all: driver.cpp header.h $(obj) 
  $(cc) -o $(exe) driver.cpp $(obj) $(flg) $(lib)

funs.o: header.h funs.cpp
  $(cc) -c funs.cpp $(flg)

glfuns.o: header.h glfuns.cpp
  $(cc) -c glfuns.cpp $(flg)

camfun.o: header.h camfun.cpp
  $(cc) -c camfun.cpp $(flg)

which gives me the following warning when compiling:

g++ -c camfun.cpp -Wno-write-strings -O2 -framework GLUT -framework OpenGL -Dvis
i686-apple-darwin10-g++-4.2.1: -framework: linker input file unused because linking not done
i686-apple-darwin10-g++-4.2.1: GLUT: linker input file unused because linking not done
i686-apple-darwin10-g++-4.2.1: -framework: linker input file unused because linking not done
i686-apple-darwin10-g++-4.2.1: OpenGL: linker input file unused because linking not done

now, I know that I am getting this warning because I definitely should (the -c option indicates that it is not referencing)! but I want to disable it, I know that I connect too much, and I'm fine with that. how to disable this warning?

+5
source share
2 answers

, , . , " ", , , -c, . , , , , . , . make : , , ( CFLAGS, ), - ( LDFLAGS).

all: , , .

POSIX .

, , .

:

ifdef vis 
ccflg += -Dvis
ldflg += -framework GLUT -framework OpenGL
obj += camfun.o glfuns.o
endif

...

all: $(exe)

$(exe): driver.cpp header.h $(obj) 
        $(cc) -o $(exe) $(ccflg) $(ldflg) driver.cpp $(obj) $(lib)

%.o: %.cpp header.h
        $(cc) -c $(ccflg) $<
+6

-c , * *. -framework.

0

All Articles