cyp/Makefile

42 lines
869 B
Makefile
Raw Permalink Normal View History

2019-04-23 18:31:01 +08:00
LESS := $(shell npm bin)/lessc
2020-03-15 05:18:54 +08:00
ROLLUP := $(shell npm bin)/rollup
2019-04-23 18:31:01 +08:00
APP := app
2020-03-10 05:24:31 +08:00
CSS := $(APP)/cyp.css
2020-03-15 05:18:54 +08:00
JS := $(APP)/cyp.js
2020-03-10 17:07:30 +08:00
ICONS := $(APP)/js/icons.js
2019-04-23 18:31:01 +08:00
SYSD_USER := ~/.config/systemd/user
SERVICE := cyp.service
2020-03-15 05:18:54 +08:00
all: $(CSS) $(JS)
2019-04-23 18:31:01 +08:00
icons: $(ICONS)
$(ICONS): $(APP)/icons/*
$(APP)/svg2js.sh $(APP)/icons > $@
2020-03-15 05:18:54 +08:00
$(JS): $(APP)/js/* $(APP)/js/elements/*
$(ROLLUP) -i $(APP)/js/cyp.js > $@
2020-03-10 05:24:31 +08:00
$(CSS): $(APP)/css/* $(APP)/css/elements/*
2020-03-11 05:11:36 +08:00
$(LESS) -x $(APP)/css/cyp.less > $@
2019-04-23 18:31:01 +08:00
service: $(SERVICE)
2019-04-25 20:43:07 +08:00
systemctl --user enable $(PWD)/$(SERVICE)
2019-04-23 18:31:01 +08:00
$(SERVICE): misc/cyp.service.template
cat $^ | envsubst > $@
watch: all
while inotifywait -e MODIFY -r $(APP)/css $(APP)/js ; do make $^ ; done
clean:
2020-03-15 05:18:54 +08:00
rm -f $(SERVICE) $(CSS) $(JS)
2019-04-23 18:31:01 +08:00
2019-10-29 15:49:04 +08:00
docker-image:
docker build -t cyp .
docker-run:
docker run --network=host -v "$$(pwd)"/_youtube:/cyp/_youtube cyp
2019-04-23 18:31:01 +08:00
.PHONY: all watch icons service clean