diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9c0932c --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +SHELL:=/bin/bash # Use bash syntax, mitigates dash's printf on Debian +ver:=$(shell git describe --tags --always --match='v[0-9]*.[0-9]*' | cut -c 2-) + + +help: + @echo + @echo "▍Help" + @echo "▀▀▀▀▀▀" + @echo + @echo "Available targets:" + @echo " dist: create source distribution package in dist/" + @echo " rpm: create an RPM package" + @echo + @echo " clean: clean all generated files" + @echo + @echo "Version $(ver)." +.PHONY: help + + +.PHONY: dist +dist: + test -d dist || mkdir dist + git archive --prefix="profile.d-$(ver)/" HEAD | xz -9v > "dist/profile.d-$(ver).tar.xz" + + +.PHONY: rpm +rpm: dist + rpmbuild -ta "dist/profile.d-$(ver).tar.xz" + + +.PHONY: clean +clean: + rm -rf dist