diff --git a/css/Makefile b/css/Makefile index 8ab0e76..f8812b8 100644 --- a/css/Makefile +++ b/css/Makefile @@ -1,19 +1,33 @@ -OBJS = \ - less/**/*.less \ - less/plex.css +lessc := node_modules/.bin/lessc +lightserver := node_modules/.bin/light-server -.PHONY: all dev build clean +NPM != command -v npm 2> /dev/null +PLEX = less/plex.css +HACKER = less/hacker/*.less $(PLEX) +DRACULA = less/dracula/*.less $(PLEX) -all: - make build +.PHONY: build dev clean -dev: $(OBJS) Makefile +# First target is default +build: hacker.css dracula.css + +dev: build + $(lightserver) -s . -p 9000 -w "index.html, **/*.less \# make" -o + +hacker.css: node_modules $(HACKER) + $(lessc) less/hacker.less hacker.css --clean-css="--s1 --advanced --compatibility=ie8" + +dracula.css: node_modules $(DRACULA) + $(lessc) less/dracula.less dracula.css --clean-css="--s1 --advanced --compatibility=ie8" + +node_modules: package.json package-lock.json Makefile +ifndef NPM + $(error Missing dependency 'npm'. Please install and try again.) +endif npm install - npm run dev - -build: $(OBJS) Makefile - npm install - npm run build + touch node_modules # fixes watch bug if you manually ran npm install clean: - rm -rf node_modules; rm dracula.css hacker.css; touch Makefile; make + rm -rf node_modules + rm dracula.css + rm hacker.css diff --git a/css/dracula.html b/css/dracula.html index c28c775..af82547 100644 --- a/css/dracula.html +++ b/css/dracula.html @@ -7,7 +7,7 @@ tilde theme - +