automake
[Top][All Lists]
Advanced

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

Re: Preprocessing C++ only


From: Tim Van Holder
Subject: Re: Preprocessing C++ only
Date: Mon, 08 Jan 2007 15:05:18 +0100
User-agent: Thunderbird 1.5.0.9 (Windows/20061207)

Alan Larkin wrote:
> I cant figure out how to write a Makefile.am which directs that a %.cpp
> be preprocessed to a %.i (and not compiled). Anybody got a suggestion?
> 
> Something like:
> 
> AM_CPPFLAGS = -I$(top_srcdir)/src @INCLTDL@
> bin_PROGRAMS = Quadratic
> Quadratic_SOURCES = Quadratic.cpp
> Quadratic_CPPFLAGS = -E #-o Quadratic.i

That's the same as setting CXX to CPP - no way it's going to work.

> chokes with the following:
> 
> <snip>
> g++ -DHAVE_CONFIG_H -I. -I../src  -E    -g -O2 -MT Quadratic-Quadratic.o
> -MD -MP -MF .deps/Quadratic-Quadratic.Tpo -c -o Quadratic-Quadratic.o
> `test -f 'Quadratic.cpp' || echo './'`Quadratic.cpp
> 
> mv -f .deps/Quadratic-Quadratic.Tpo .deps/Quadratic-Quadratic.Po
> /bin/sh ../libtool --tag=CXX   --mode=link g++  -g -O2   -o Quadratic
> Quadratic-Quadratic.o
> 
> g++ -g -O2 -o Quadratic Quadratic-Quadratic.o Quadratic-Quadratic.o:
> file not recognized: File format not recognized
> collect2: ld returned 1 exit status
> make[1]: *** [Quadratic] Error 1
> <snip>
> 
> Thanks very much.

Something like this perhaps (should also work in cases where "$(CC) -E"
is not equivalent to "$(CPP)"):

.i.cpp:
        $(CPP) $(CPPFLAGS) -o $@ $<

noinst_DATA: Quadratic.i






reply via email to

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