Thread View: comp.unix.programmer
2 messages
2 total messages
Started by Linde, Jon Olav
Wed, 19 Jun 1996 00:00
GNU cpp combined with HP C++ compiler ?
Author: Linde, Jon Olav
Date: Wed, 19 Jun 1996 00:00
Date: Wed, 19 Jun 1996 00:00
82 lines
3518 bytes
3518 bytes
I would like to utilize GNU cpp's -MD option. I.e. making it generate
dependency files in parallell with normal pre-processing.
But I didn't succeed with my little test-program, so therefore, I will
appreciate any help from those of you with experience with this.
I use an HP 715/50, HP-UX 9.03, HP C++ 3.05 and cpp from the gcc 2.7.2
distribution.
This is my test-program:
----------------------------------------------------------------------
#include <stream.h>
main()
{
cout << "Hello world !!" << endl;
}
----------------------------------------------------------------------
My makefile looks like this:
----------------------------------------------------------------------
CCC.comp = CC -v -tp,/local/gnu/lib/gcc-lib/hppa1.1-hp-hpux9.03/2.7.2/cpp -Wp,-lang-c++,"-MD $*.d"
CCC.link = CC -v
helloWorld: helloWorld.o
$(CCC.link) -o helloWorld helloWorld.o
.C.o:
$(CCC.comp) -c -o $@ $<
----------------------------------------------------------------------
... and the output when running make:
----------------------------------------------------------------------
~/CC/testDir > make helloWorld.o
CC -v -tp,/local/gnu/lib/gcc-lib/hppa1.1-hp-hpux9.03/2.7.2/cpp -Wp,-lang-c++,"-MD helloWorld.d" -c -o helloWorld.o helloWorld.C
/local/gnu/lib/gcc-lib/hppa1.1-hp-hpux9.03/2.7.2/cpp -lang-c++ -MD helloWorld.d -D__hp9000s700 -D_PA_RISC1_1 -$ -Dc_plusplus -D__cplusplus -D__hp9000s800 -D__hppa -D__hpux -D__unix -Dhp9000s800 -Dhppa -Dhpux -Dunix -I/usr/include/CC -I/usr/include helloWorld.C /usr/tmp/AAAa27020.i
/usr/lib/cfront +T/usr/tmp/BAAa27020 +s +t/usr/tmp/CAAa27020 +fhelloWorld.C +XChelloWorld.o </usr/tmp/AAAa27020.i
removing /usr/tmp/AAAa27020.i
removing /usr/tmp/BAAa27020
removing /usr/tmp/CAAa27020
~/CC/testDir >
~/CC/testDir > ls -l
total 112
-rw-r--r-- 1 etojol 68 Jun 19 17:51 helloWorld.C
-rw-r--r-- 1 etojol 624 Jun 19 18:07 helloWorld.o
-rw-r--r-- 1 etojol 241 Jun 19 17:50 makefile
----------------------------------------------------------------------
cpp seems to get the right argument (-MD helloWorld.d) but the dependency
file is simply not generated, and the object file (helloWorld.o) is
obviously to small. But, it is an object-file:
~/CC/testDir > file *.o
helloWorld.o: PA-RISC1.1 relocatable object
The really strange thing is, when I use "copy and paste" from the above
output, and executes the cpp-command isolated (not invoked by CC) it works
exactly like expected, and generates the .d-file.
Any suggestions are welcome !
regards,
Jon Olav Linde
----------------------------------------------------------------------
Ericsson AS phone: +47 66 84 12 13
Olav Brunborgs vei 6 fax: +47 66 84 26 06
postboks 34 e-mail: etojol@etn.ericsson.se
1361 Billingstad
Norway
Re: GNU cpp combined with HP C++ compiler ?
Author: Shankar Unni
Date: Thu, 20 Jun 1996 00:00
Date: Thu, 20 Jun 1996 00:00
17 lines
1425 bytes
1425 bytes
Linde, Jon Olav (etojol@eto.ericsson.se) wrote: > CCC.comp = CC -v -tp,/local/gnu/lib/gcc-lib/hppa1.1-hp-hpux9.03/2.7.2/cpp -Wp,-lang-c++,"-MD $*.d" Make that -Wp,-lang-c++m,-MD,$*.d (i.e. put a "," instead of an escaped space between -MD and the filename). When GNU cpp sees -MD, it goes to the *next* argument to get the dependency file name. However, you have forced the CC driver to pass in "-MD $*.d" as one argv token with an embedded space. Passing it as above should work.. -- Shankar Unni shankar@chromatic.com Chromatic Research (408) 752-9488
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads