Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!yale.edu!cmcl2!adm!lhc!lhc!warsaw From: warsaw@nlm.nih.gov (Barry A. Warsaw) Newsgroups: comp.lang.c++ Subject: Re: Wisdom for handling C++ files with suffix .cc Message-ID: Date: 14 Jun 91 17:50:53 GMT References: <1991Jun13.200637.16078@watson.ibm.com> Sender: usenet@nlm.nih.gov (usenet news poster) Reply-To: warsaw@nlm.nih.gov Organization: Century Computing, Inc. Lines: 32 In-Reply-To: oasis@watson.ibm.com's message of 13 Jun 91 20:06:37 GMT >>>>> "Gary" == GA.Hoffman writes: Gary> I just received a bunch of c++ files with suffix .cc, CC Gary> wants .C or some such ... is there conventional wisdom on Gary> handling this in makefiles? I'm currently making a link Gary> during the compile, file by file to a file with the desired Gary> suffix. Below is an extract from my Makefile's. Using this, it's relatively simple to change to any suffix just by mv'ing the files and changing the $(C) macro in the makefiles. C= .cc # I have files file1.cc, etc or file1.C, etc. SOURCES = file1$(C) file2$(C) file3$(C) ... # this is a SunOS 4.x make-ism OBJECTS = $(SOURCES:%$(C)=%.o) # rule to convert any $(C) c++ source file into a .o object file $(C).o: $(CC) $(OTHER_USEFUL_FLAGS) -c $< $(PROGRAM): $(OBJECTS) $(CC) $(USEFUL_LD_SWITCHES) $(OBJECTS) -o $(PROGRAM) -Barry NAME: Barry A. Warsaw INET: warsaw@nlm.nih.gov TELE: (301) 496-1936 UUCP: uunet!nlm.nih.gov!warsaw