Generating a demo version from production code

Engbert Gerrit IJff engbert at cs.vu.nl
Tue Nov 20 06:27:12 AEST 1990


In article <1990Nov18.004032.10424 at dirtydog.ima.isc.com>,
	karl at ima.isc.com (Karl Heuer) writes:
) In article <6734 at uceng.UC.EDU> dmocsny at 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 at 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



More information about the Comp.lang.c mailing list