Thanks Martin,

Your Makefile is too advanced for me to understand by now.


I tested out the below five rules.
Aren't the order of compiling object files of first two rules certain?
Will GNU Make keep their ordering behavior or are they just some random ordering
caused by some random bugs (sorry, no offensive, I love GNU Make)


# ok: in order of writing, with recipe
x: y.o z.o x.o
    $(CC) $^ -o $@


# ok: compiles x.o last, no mentioning x.o
x: y.o z.o




The rest of the below three rules are not suitable if compiling order matters.


# compiles x.o first, mentioning x.o
x: y.o z.o x.o


# compiles x.o first
x: $(patsubst %.y,%.o,$(wildcard *.y))


# in order of file names, with recipe
x: $(patsubst %.y,%.o,$(wildcard *.y))
    $(CC) $^ -o $@ 
    

Reply via email to