I have .haml
files and want to convert them automatically into .html
files and update the latter when .haml
is changed.
The generic makefile rule is no problem:
%.html: %.haml
hamlpy $< $@
But now I need a rule or a command to do the following:
X.haml
files in templates/
make X.html
command, where X is the same filename (haml
is replaced with html
).I can't find how to do this with GNU Make or Unix find.
If all of your *.haml
files are well name (i.e. no spaces or other funny characters), you can do it with a call to find(1)
:
HAML_FILES = $(shell find templates/ -type f -name '*.haml')
HTML_FILES = $(HAML_FILES:.haml=.html)
all: $(HTML_FILES)
%.html : %.haml
hamlpy $< $@
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With