Dear all,
I have found below code in  a make file that uses CPPFLAGS and VPATH AS
FOLLOWS:

VPATH    = src include
CPPFLAGS = -I include

count_words: count_words.o counter.o lexer.o -lfl
        gcc $^ -o $@

count_words.o: count_words.c counter.h
        gcc $(CPPFLAGS) -c $< -o $@

counter.o: counter.c counter.h lexer.h
        gcc $(CPPFLAGS) -c $< -o $@

lexer.o: lexer.c lexer.h
        gcc $(CPPFLAGS) -c $< -o $@

lexer.c: lexer.l
        flex -t $< > $@

My question is , if I use VPATH to tell MAKE to find the required files from
the paths mentioned in VPATH, than why should I need to use gcc $(CPPFLAGS)
<--- This kind of things? What is the mystery??
-- 
View this message in context: 
http://old.nabble.com/Usage%3A-CPPFLAGS-vs-VPATH-tp32550826p32550826.html
Sent from the Gnu - Make - Help mailing list archive at Nabble.com.


_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to