In the following example, when creating the entire target main-gs-universalk9-mo, it seems to match rule 1 instead of rule 2. In make version 3.81, I thought that order matters. Even if I moved rule 2, which should be defined before rule 1. It still ends with rule 1
What is the correct way to encode this and make it work properly?
$(info .FEATURES := $(.FEATURES))
%.o:
@echo "Rule 1 $?"
rm -f $@
cp $*.c $@
main-gs-%-m.o: file1.o file2.o file3.o
@echo "Rule 2"
cat $? > $@
binos_%_version.o:
@echo "Rule 3"
echo "Hello World" > $@
x86-%-m: main-gs-%-m.o binos_%_version.o
@echo "Rule 4"
cat $? > $@
all: x86-universalk9-m
clean:
@echo "Rule Cleaning"
rm -f *.o
rm -f x86-universalk9-m
source
share