Last active
March 4, 2024 14:42
-
-
Save postmodern/3224049 to your computer and use it in GitHub Desktop.
A generic Makefile for building/signing/install bash scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NAME=project | |
VERSION=0.0.1 | |
FILES=$(shell git ls-files) | |
PKG=$(NAME)-$(VERSION).tar.bz2 | |
SIG=$(PKG).asc | |
PREFIX=/usr/local | |
$(PKG): $(FILES) | |
tar -cjvf $(PKG) $(FILES) | |
pkg: $(PKG) | |
$(SIG): $(PKG) | |
gpg --sign --detach-sign --armor $(PKG) | |
sign: $(SIG) | |
all: pkg sign | |
clean: | |
rm -f $(PKG) $(SIG) | |
install: | |
for file in `find {lib,bin,sbin,share} -type f`; do install -D $$file $(PREFIX)/$$file; done | |
install -d $(PREFIX)/share/doc/$(NAME)-$(VERSION)/ | |
cp -r doc/* *.{md,tt,txt} $(PREFIX)/share/doc/$(NAME)-$(VERSION)/ | |
uninstall: | |
for file in `find {lib,bin,sbin,share} -type f`; do rm $(PREFIX)/$$file; done | |
rm -rf $(PREFIX)/share/doc/$(NAME)-$(VERSION)/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment