make: conditions in the Makefile

make: conditions in the Makefile

Post by Jack Vins » Sat, 19 Feb 1994 03:06:00

I am using make to compile a 'modular' program.  By modular I mean that the
root program remains the same and other functions (files) can be swapped in
and out depending on which exact program I want to test.

The problem is that the header file is different for each system and I'd
like an easy way of using the correct header each time.

Let's say the header file used in the program header.h.  What I currently
do it to copy header1.h or header2.h into header.h when I want to compile
prog1 or prog2 respectively.

What I would like is to set up my Makefile so that it will automatically
copy the proper header file into header.h.  I am thinking some sort of
conditional should be set in the dependencies for program.h, but I don't
know how and the man page for make is less than helpful.

If I am going about this backwards, please let me know that as well.  Like
maybe the info in the headers really should be read in from a datafile


The Purple Puddle Eater   and   Captain Jack
"Skin ain't got no tailored pockets." - Eat _Sell_Me_a_God_