Making makefiles portable

jon at csvax.caltech.edu jon at csvax.caltech.edu
Fri Apr 18 16:10:42 AEST 1986


	Does anyone have suggestions on producing makefiles which
are portable between BSD and Sys{III,V}? I am stuggling with this
due to our recent acquisition of some Sys V machines. The most
obvious problems I have found are:
	use of MFLAGS in BSD as opposed to MAKEFLAGS 
	different options accepted by lint, cc, etc.
	need to define SHELL= or SHELL=/bin/sh to Sys V make
		(if the environment variable SHELL is not sh)
		in order to get sh constructs in make targets
		to work

	The obvious approach is to put #ifdefs in makefiles just
like in C code and run makefiles through cpp, but this is inelegant
(especially to the person who receives a copy of your code and just
wants to type 'make'). In addition, there's no guarantee cpp will
be available everywhere (say if the functionality is built into the
C compiler).

    Jon Leech (jon at csvax.caltech.edu || ...seismo!cit-vax!jon)
    Caltech Computer Science Graphics Group
    __@/



More information about the Comp.unix.wizards mailing list