sway-ipc/Makefile

61 lines
1.8 KiB
Makefile

APP=sway-ipc
BOOTSTRAP=v5.2.3
JQUERY=3.6.0
INTER=3.19
PREFIX=/usr/local
run:
cargo run
build:
cargo build
test:
cargo test
doc:
cargo doc
clean:
rm -rf target/
clean-assets:
rm -rf ./assets/stylesheets
rm -rf $(shell find ./assets/javascript -maxdepth 1 -type f -name "*" ! -name "application.js")
rm -rf ./assets/fonts
rm -rf ./scss/bootstrap
clone-bootstrap:
ifeq ($(shell test ! -e ./scss/bootstrap && echo -n yes),yes)
git clone --quiet --depth=1 https://github.com/twbs/bootstrap.git -b $(BOOTSTRAP) ./scss/bootstrap
endif
css: clone-bootstrap
install -dm755 -- ./static/stylesheets
sassc --style compressed scss/application.scss > static/stylesheets/application.css
bootstrap: clone-bootstrap
install -dm755 -- ./static/stylesheets
install -dm755 -- ./static/javascript
install -m664 -- ./scss/bootstrap/dist/css/bootstrap.min.css ./static/stylesheets/
install -m664 -- ./scss/bootstrap/dist/css/bootstrap.min.css.map ./static/stylesheets/
install -m664 -- ./scss/bootstrap/dist/js/bootstrap.bundle.min.js ./static/javascript/
rm -f ./static/javascript/jquery-$(JQUERY).slim.min.js
wget -4 -P ./static/javascript/ https://code.jquery.com/jquery-$(JQUERY).slim.min.js
fonts: clean-fonts
wget https://github.com/rsms/inter/releases/download/v$(INTER)/Inter-$(INTER).zip
unzip Inter-$(INTER).zip -d Inter-$(INTER)
install -dm755 -- ./static/fonts
install -dm755 -- ./static/stylesheets
install -m664 -- Inter-$(INTER)/Inter\ Web/*.woff ./static/fonts/
install -m664 -- Inter-$(INTER)/Inter\ Web/*.woff2 ./static/fonts/
install -m664 -- Inter-$(INTER)/Inter\ Web/inter.css ./static/stylesheets/
sed -i 's/url(\"/url(\"\/public\/fonts\//g' ./static/stylesheets/inter.css
rm -rf ./Inter*
clean-fonts:
rm -rf ./static/fonts
rm -rf ./Inter*
rm -rf ./static/stylesheets/inter.css