DoorAdmin/Makefile

25 lines
806 B
Makefile

VERSION ?= $(shell git rev-parse --short HEAD)
release: door_admin_v$(VERSION).tar.gz
TEMPLATE_FILES = $(shell find -name '*.html')
STATIC_FILES = $(shell find -name '*.png' -o -name '*.js')
PYTHON_FILES = $(shell find -name '*.py')
ALL_FILES = $(TEMPLATE_FILES) $(STATIC_FILES) $(PYTHON_FILES)
door_admin_v$(VERSION).tar.gz: Makefile $(ALL_FILES)
tar czf $@ --transform='s,^,door_admin_$(VERSION)/,' $^
install: install_templates install_static install_python
install_static:
install -D -m 0755 -t $(PREFIX)/usr/share/door_admin/static $(STATIC_FILES)
install_templates:
install -D -m 0755 -t $(PREFIX)/usr/share/door_admin/templates $(TEMPLATE_FILES)
install_python:
install -D -m 0755 -t $(PREFIX)/bin $(PYTHON_FILES)
.PHONY: release install install_static install_templates install_python