lvc@cbsck.UUCP (Larry Cipriani) (02/15/86)
How do you tell make to use the C++ translator instead of the C compiler if both C and C++ programs end in the same suffix (.c). I wouldn't want to run my C programs through the C++ translator unless it produced identical results. -- Larry Cipriani cbsck!lvc
latham@bsdpkh.UUCP (Ken Latham) (02/20/86)
> How do you tell make to use the C++ translator instead > of the C compiler if both C and C++ programs end in > the same suffix (.c). I wouldn't want to run my > C programs through the C++ translator unless it produced > identical results. > -- > > Larry Cipriani cbsck!lvc If you look at the internal rules of make, ( you know those strange looking rules like .c~.a :-) ) They all use ${CC} as the name of the processor for any .c files. All you have to do is set. CC=C++; export CC before you make and Voila! Ken Latham ( a MAKE artist ) AT&T-IS (via AGS Inc.), Orlando , FL uucp: ihnp4!bsdpkh!latham P.S. For more extraordinary circumstances you could replace CC by a shell.
mherman@omnitor.UUCP (02/20/86)
[posted by mail] > >From lvc@cbsck.UUCP (Larry Cipriani) Fri Feb 14 20:13:30 1986 > > How do you tell make to use the C++ translator instead > of the C compiler if both C and C++ programs end in > the same suffix (.c). I wouldn't want to run my > C programs through the C++ translator unless it produced > identical results. At Waterloo, we renamed CC to ccc and used .cc for C++ source and left .c for standard C. Don't think of C++ and C as the "same" language. One the first frustations a 4.BSD C++ programmer is going to experience is the lack of header files for the functions libraries you use on your system. The easiest way to automatically generate these is a fairly simple modification to pass 1 of lint which passes the *names* of structs/unions/enums to pass 2. To get an idea of what you need to do, turn on the debugging feature in pass 2. You should end up saying "That's almost exactly what I need to make external function declarations for C++". Second, we ran into problems with the 4.2BSD C compiler with expression stack overflows (I'm not real sure it was the expression stack any more). Anyway, one of our trusty Unix people modified cc to dynamically relocate the stack when the overflow occurred. BTW, note that I'm now at Omnibus Computer Graphics in T.O. ...and no, we aren't using C++ here (yet). Michael Herman Graphics Programmer, Research and Development Omnibus Computer Graphics Inc. TransAmerica Tower, 2180 Yonge Street Toronto, Ontario, Canada M4S 2B9 UUCP: {allegra,decvax,ihnp4,utcsri}!watmath!omnitor!mherman ARPA: mherman@omnitor.ARPA@csnet-relay.ARPA