Ram
Ram

Reputation: 822

rules for makefile with flags

_OBJ = hellomake.o hellofunc.o 
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))

I am trying to learn makefile syntax. What is the second line saying? I am clueless. Can I get each operator what it is for in the above please.

Upvotes: 0

Views: 79

Answers (1)

Summer_More_More_Tea
Summer_More_More_Tea

Reputation: 13356

It's pattern substitution function call. Here is the link to the manual.

In your case, line2 prefixes all the filenames in _OBJ with $(ODIR)/ and stores the results into variable OBJ.

Upvotes: 1

Related Questions