help-make
[Top][All Lists]
Advanced

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

Static Pattern Rules


From: Thibaut Bultiaux
Subject: Static Pattern Rules
Date: Mon, 11 Feb 2002 10:34:34 +0100

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]