help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Usage: CPPFLAGS vs VPATH


From: MD.Mahbubur Rahman
Subject: Usage: CPPFLAGS vs VPATH
Date: Wed, 28 Sep 2011 22:04:25 -0700 (PDT)

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]