[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Preprocessing C++ only
From: |
David Fang |
Subject: |
Re: Preprocessing C++ only |
Date: |
Mon, 8 Jan 2007 16:19:28 -0500 (EST) |
> SUFFIXES = .i
> noinst_DATA = Quadratic.i
> .cpp.i:
> $(CPP) $(CPPFLAGS) -E -o $@ $<
Hi,
Sometimes it is useful to distinguish C from C++ preprocessed
files, I use .ii for C++ and .i for C. If you want to retain the
CFLAGS/CXXFLAGS/CPPFLAGS from configure, then it's convenient to define
the rule as:
SUFFIXES += .i .ii
.c.i:
$(COMPILE) -E $< > $@
.cpp.ii:
$(CXXCOMPILE) -E $< > $@
since $(COMPILE) and $(CXXCOMPILE) are generated in Makefile.in.
I use these frequently when debugging, and usually add these rules to new
projects' Makefile.am's.
HTH,
Fang