Re: How do I make a script to change and recompile source code in Informix?
Posted in 1996
Topics: General Discussion
Lawrence Carrington <wontolla@mail.internet.com.mx> posted :
>Kenneth Dybvik <Kenneth.Dybvik@idg.no> wrote:
>>I want to make a script that browses through directories,
>>delete .o and .frm files and then make a simple change to
>>all my global files. Recompiling should be done before moving to next
>>directory.
Try this.
In each directory, have a makefile with sth like
# start of makefile
PROGRAM = program
program: your object files here
your compilation/linking commands here
objects: your source files
your compilation commands here
# note the semi-colon below
clean_n_compile:; rm *.o *.frm
put your sed or similar command to replace the global file
make $(PROGRAM)
#end of makefile
Then in another directory, have a makefile with sth like
SRC_DIRS= list all your source directories here
# note the semi-colon below
clean_n_compile:; for i in $(SRC_DIRS);do
cd $i
make clean_n_compile
cd -
done
Then from this directory when you type
$ make clean_n_compileit would go to each of your source directory and run the
make files in those directories.
If you read more about make and mkmf, you would benefit a lot more.
Hope this helps!
-Sams