swcarpentry / make-novice

Automation and Make

Home Page:http://swcarpentry.github.io/make-novice

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ep05: Streamline pattern rule explanation

gcapes opened this issue · comments

I wonder whether skipping straight over $* in the following episode (5) on pattern rules would be advised? Its inclusion is slightly contrived, though its omission would only be showing 'half' of a pattern rule.

It is currently introduced like this

%.dat : books/%.txt countwords.py
	python countwords.py $< $*.dat

but the pattern rule could be introduced more cleanly like this:

%.dat : countwords.py books/%.txt 
	python $^ $*.dat

Or, maybe more authentic still:

%.dat : countwords.py books/%.txt 
	python $^ $@

Originally posted by @gcapes in #166 (comment)