hubl/Makefile

50 lines
1.0 KiB
Makefile
Raw Normal View History

2018-09-07 17:53:41 +00:00
default: build
2018-09-06 09:25:52 +00:00
config.pug:
2018-09-21 11:29:45 +00:00
cp -n config-sample.pug config.pug
2018-09-06 09:25:52 +00:00
2018-09-07 17:53:41 +00:00
node_modules:
npm install
2018-09-06 09:25:52 +00:00
2018-09-07 17:53:41 +00:00
install: node_modules
2018-09-06 09:25:52 +00:00
git submodule update --init --recursive
2018-09-21 11:29:45 +00:00
update:
cd dist/lib/sib-chat; \
git pull origin master
cd dist/lib/sib-core; \
git pull origin master
cd dist/lib/sib-router; \
git pull origin master
2018-09-07 17:53:41 +00:00
dist/css/hd-app.css: $(wildcard src/scss/*.scss)
2018-09-21 11:29:45 +00:00
npx node-sass src/scss/main.scss dist/css/hd-app.css --source-map true || touch dist/css/hd-app.css
2018-09-07 17:53:41 +00:00
2018-09-09 11:51:56 +00:00
index.html: config.pug index.pug $(wildcard src/pug/*.pug)
2018-09-21 11:29:45 +00:00
npx pug --pretty index.pug || touch index.html
2018-09-07 17:53:41 +00:00
build: index.html dist/css/hd-app.css
2018-09-09 11:51:56 +00:00
prod:
npx pug index.pug
npx node-sass src/scss/main.scss dist/css/hd-app.css --output-style compressed
2018-09-07 17:53:41 +00:00
watch:
@echo 'watching for change'
@echo 'press ctrl+C to stop'
@while true; do \
2018-09-11 23:34:13 +00:00
$(MAKE) build --silent; \
2018-09-07 17:53:41 +00:00
sleep 0.5; \
done
2018-09-06 09:25:52 +00:00
serve: dist/css/hd-app.css
php -S 127.0.0.1:8080 router.php
2018-09-11 23:34:13 +00:00
dev-mt: watch serve
2018-09-09 11:51:56 +00:00
dev:
2018-09-11 23:34:13 +00:00
@$(MAKE) dev-mt -j --no-print-directory
2018-09-09 11:51:56 +00:00
2018-09-06 09:25:52 +00:00
2018-09-07 17:53:41 +00:00
.PHONY: default install build build-prod watch serve