I have a number of less file that I would like to compile using a makefile.
DEBUG=yes
LESS_FILES= static/backend/css/styles.less static/frontend/css/styles.less
ifeq ($(DEBUG),yes)
LESSC=lessc
else
LESSC=lessc -x
endif
less: $(LESS_FILES)
%.css: %.less
$(LESSC) $< > $@
I created this makefile, but when starting make less
I get :
make: Rien à faire pour « less ».
The file .css
doesn't exists yet. What's wrong ?
I've got it ! Sometimes it's help to ask the question to find the answer ...
DEBUG=True
LESS_FILES= static/admin/css/modulo_admin.less
CSS_FILES=$(LESS_FILES:.less=.css)
ifeq ($(DEBUG),True)
LESSC=lessc
else
LESSC=lessc -x
endif
less: $(CSS_FILES)
%.css: %.less
$(LESSC) $< > $@
Note that the target less
depends upon the source files. Those already exist and are up-to-date.
I suggest changing the less
target to look more like this:
less: $(CSS_FILES:.less=.css)
(Untested, I don't have the lessc
tool installed, nor suitable input files.)
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