Hi all,

I have created a makefile that is supposed to choose between two pattern rules, based on the availability of their dependencies:

<begin_code>

all : target0.ts
        @echo Done

target%.ts : file1
        @echo $?

target%.ts : file2
        @echo $?

<end_code>

The upper code works just fine. When I create file1 or file2, the first or the second pattern rule resp. is used. This changes when I define a random target that uses file1 as dependency. For some reason, gmake will always try to apply the first pattern rule and will complain that it cannot create file1, while file2 is there! The following code illustrates this:

<begin_code>

all : target0.ts
        @echo Done

target%.ts : file1
        @echo $?

target%.ts : file2
        @echo $?

dummy : file1
        @echo $@

<end_code>

Result:

make: *** No rule to make target `file1', needed by `target0.ts'.  Stop.

Any ideas why this is, and how to solve this in a somewhat elegant manner?

Cheers,
Simon.
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to