Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!usc!jarthur!uunet!mcsun!hp4nl!star.cs.vu.nl!engbert From: engbert@cs.vu.nl (Engbert Gerrit IJff) Newsgroups: comp.lang.c Subject: Re: Generating a demo version from production code Message-ID: <8291@star.cs.vu.nl> Date: 19 Nov 90 19:27:12 GMT References: <6734@uceng.UC.EDU> <1990Nov18.004032.10424@dirtydog.ima.isc.com> Sender: news@cs.vu.nl Reply-To: engbert@cs.vu.nl (Engbert Gerrit IJff) Organization: VU Dept. of Computer Science, Amsterdam, The Netherlands Lines: 26 In article <1990Nov18.004032.10424@dirtydog.ima.isc.com>, karl@ima.isc.com (Karl Heuer) writes: ) In article <6734@uceng.UC.EDU> dmocsny@minerva.che.uc.edu (Daniel Mocsny) writes: ) >Since I can't find a compiler flag that can create an object file with the ) >name demo_smurf.o from a source named smurf.c, is that what I have to do? ) ) No doubt someone is about to recommend "cc -c smurf.c -o demo_smurf.o" without ) realizing that it's a non-portable Berkeleyism. Yes, I recommend you use ) "cc -c smurf.c && mv smurf.o demo_smurf.o". Since this destroys any "smurf.o" ) you already have, you may want to consider making the other target with ) "cc -c smurf.c && mv smurf.o real_smurf.o" so there's no "smurf.o" target. ) ) Karl W. Z. Heuer (karl@ima.isc.com or uunet!ima!karl), The Walking Lint The other way to achieve your goal, when you are on a filesystem that knows of directories and multiple links is to have a subdirectory DEMO in which all the .h and .c files are just links to file with the same name in the real directory. (and also for the makefile) If you then go into your DEMO directory and do make -DDEMO you will get demo versions for your .o files that do not collide with the REAL .o files. The only thing you have to take care of is that you have ALL your .c files linked into the DEMO directory. Bert