-
Makefile
I'm doing this project with fltk as gui. I use mingw and msys as compiler, meaning regular makefiles. But I get this weird error that I just can't figure out...
This is how my Makefile looks like:
Code:
CC = g++
CFLAGS = -Wall `fltk-config --cxxflags`
OFLAGS = -Wall -lOpenGL32 `fltk-config --use-gl --ldflags`
OBJECTFILES = gui.o infvizglib.o
exe: $(OBJECTFILES)
$(CC) $(OBJECTFILES) -o finviz.exe $(OFLAGS)
strip -s finviz.exe
gui.o: gui.cpp gui.h infvizglib.h
$(CC) -c gui.cpp $(CFLAGS)
infviz.o: infvizglib.cpp infvizglib.h
$(CC) -c infvizglib.cpp $(CFLAGS)
clean:
rm *.o *.exe
I get this weird error about not finding some fltk headerfile, but I don't think that's the problem. I get this printout about what's going on.
Code:
g++ -c gui.cpp -Wall `fltk-config --cxxflags`
g++ -c -o infvizglib.o infvizglib.cpp
The first line gets me a good compiled gui.o file, but the second one means nothing... What could be wrong? I've looked into Makefiles and I can't find any abnormalties about my code...
Hope for help...
-
Gaah, the infvizglib.o target isn't defined but is dependent of exe, which means the default rule is run, and by default make uses $(CXXFLAGS) when compiling c++ source files not $(CFLAGS). If you want different behavior, either define and use CXXFLAGS, add another rule, or look in the makefile manual( there are other ways).
-
ahh! Of course, thank you! :-)