dr-w-site/css/Makefile

29 lines
708 B
Makefile
Raw Normal View History

lessc := node_modules/.bin/lessc
lightserver := node_modules/.bin/light-server
2018-11-20 00:08:30 +00:00
NPM != command -v npm 2> /dev/null
2018-11-20 00:08:30 +00:00
.PHONY: build dev clean
2018-11-20 00:08:30 +00:00
# First target is default
build: hacker.css dracula.css
dev: build
$(lightserver) -s . -p 9000 -w "index.html, **/*.less \# make" -o
2020-06-15 14:05:28 +00:00
%.css: node_modules less/%/*.less less/plex.css
$(info building $@)
$(lessc) less/$*.less $*.css --clean-css="--s1 --advanced --compatibility=ie8"
2018-11-20 00:08:30 +00:00
node_modules: package.json package-lock.json Makefile
ifndef NPM
$(error Missing dependency 'npm'. Please install and try again.)
endif
2018-11-20 00:08:30 +00:00
npm install
touch node_modules # fixes watch bug if you manually ran npm install
2018-11-20 00:08:30 +00:00
clean:
rm -rf node_modules
rm dracula.css
rm hacker.css