Hi,

I try to use intensivly the Static Pattern Rules in my makefile :

targets ...: target-pattern: dep-patterns ...
        commands


I am facing to the following problem.  I would like to build the
dep-patterns part with a script taking as argument the stem.
Here a example of a such makefile.


====================================================
target = fit

DATABASE_FILES = $(target)
all:    $(DATABASE_FILES)

$(target): %: $(shell ./script %)
        @echo "Run all the target : $^"
====================================================

In this makefile, $(target) is "fit".  So the stem is "fit" in the
Static Pattern Rules.

This is not working because the stem (%) is resolved AFTER to have
launched the script.
The script is launched with the argument "%" in place of "fit".
So makefile launch "script %" and build my dependencies with it.

I was expecting the stem is resolved before.  
And then makefile should have launch "script fit" to build my
dependencies.

Is there a way to avoid that ?


In this test case, he script looks like :


#!/bin/sh 

source="$1";

if [ $source = "fit" ]; then
  echo "a$source";
fi


It is not working because, $1 and so $source is "%" in place of "fit".




Regards

Thibaut

_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to