Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!rutgers!usc!samsung!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: Generating a demo version from production code Message-ID: <4343@goanna.cs.rmit.oz.au> Date: 22 Nov 90 04:36:33 GMT References: <6734@uceng.UC.EDU> <5818@stpstn.UUCP> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 30 In article <6734@uceng.UC.EDU> dmocsny@minerva.che.uc.edu (Daniel Mocsny) writes: ->I need to create a demonstration version of a C program. This demonstration ->program will preserve the user-interface and screen-handling of the There's a fairly simple way of compiling several versions of a program without interference. I've tried this under both 4.3 BSD and V.3 UNIX. The idea is that you have three directories: $PROG/ -- holds the sources $PROG/production/ -- where the production version gets built $PROG/demo/ -- where the demo version gets built. In your Makefile, you have entries like foo.o: ../foo.c cc -c $(CFLAGS) ../foo.c (well, that's the effect you want to generate). Then cd $PROG/production make -f ../Makefile CFLAGS=-Udemo program will make the production/program version, and cd $PROG/demo make -f ../Makefile CFLAGS=-Ddemo program will make the demo/program version. This relies on cc -c $DIR/$BASE.c producing a $BASE.o file in the current directory, not in $DIR, but as I say, I tried this in something claiming to be System V as well as in something claiming to be BSD. Something like this may work with other systems. A UNIX-specific technique is to use links, so that each of the demo/ and production/ directories _thinks_ it has a copy of the sources, but is in fact sharing the master copy. -- I am not now and never have been a member of Mensa. -- Ariadne.