[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

makefile issues




dear list,

in the process of porting i have come across some makefile issues.

it is of course the gnu and bsd make interoperability which
gives me headaches.

1. my first problem:
   how can i get the `pwd` where the makefile was started?
   GNU: ROOTDIR=$(shell pwd)
   BSD: ROOTDIR=$(.CURDIR)

   is there a universal solution in the Makefile?  or any other
   ideas (./configure preferably not)

2. the GNUmakefile specifies a "%" macro which

	can match any part of the target name; this part is called the
	"stem".  The rest of the pattern must match exactly.  For
	example, the target `foo.o' matches the pattern `%.o', with
	`foo' as the stem.  The targets `foo.c' and `foo.out' do not
	match that pattern.

   the makefile i am trying to make more BSD like uses this feature
   as a kind parameter passing mechanims in the rule names:

Makefile:
---------------------------------------
rule4%.dict:
        @echo "this is rule4$(*F).dict"

this: rule4this.dict

that: rule4that.dict
---------------------------------------

amaaq> gmake this
this is rule4this.dict
amaaq> gmake that 
this is rule4that.dict

   it is useful, because the make process runs a lot of scripts, and
   passes the $(*F) as parameter for those scripts.
   so the rules are written just once and make use of this parameter.

   how can accomplish the same w/bsd make?

   or what are my alternatives?

-f
-- 
"will you leave me alone if i give you a quote?" -- emmanuel goldstein