Well, when it comes to makefile, i'm a total noob, and i've just recently written one for my small project.
However, when trying to run 'make debug' option,it stops with 'no rule..' error.
More than that, i'm not sure whether that action will work.
The makefile in question -
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
debug: CXXFLAGS = -D "IS_VERBOSE"
all: hello
hello: main.o preprocess.o functions.o
g++ $(CXXFLAGS) main.o preprocess.o functions.o -o program
main.o: main.cpp
g++ $(CXXFLAGS) -c main.cpp
preprocess.o: preprocess.cpp
g++ $(CXXFLAGS) -c preprocess.cpp
functions.o: functions.cpp
g++ $(CXXFLAGS) -c functions.cpp
clean:
rm -rf *o program
|
Ok, so two questions here -
First, how to make that work?
Second, what i want to achieve, is that, i coul use #ifdef IS_VERBOSE in my files, so if i made a program with debug parameter, it would work with IS_VERBOSE #definition visible in code. Is that correct way of thinking?
It is to be compiled under linux.