Added initial Makefile
This commit is contained in:
parent
5f8a13b59a
commit
bfdfe9b77f
1 changed files with 55 additions and 0 deletions
55
Makefile
Normal file
55
Makefile
Normal file
|
@ -0,0 +1,55 @@
|
|||
NAME=ca-scripts
|
||||
VERSION=1.0.0
|
||||
|
||||
DIRS=bin lib tpl
|
||||
INSTALL_DIRS=`find $(DIRS) -type d 2>/dev/null`
|
||||
INSTALL_FILES=`find $(DIRS) -type f 2>/dev/null`
|
||||
DOC_FILES=*.md doc/*.pod
|
||||
|
||||
PKG_DIR=ca-scripts
|
||||
PKG_NAME=$(NAME)-$(VERSION)
|
||||
PKG=$(PKG_DIR)/$(PKG_NAME)_$(VERSION).tar.gz
|
||||
SIG=$(PKG_DIR)/$(PKG_NAME).asc
|
||||
|
||||
PREFIX?=/usr/local
|
||||
DOC_DIR=$(PREFIX)/share/doc/$(PKG_NAME)
|
||||
|
||||
pkg:
|
||||
mkdir -p $(PKG_DIR)
|
||||
|
||||
$(PKG): pkg
|
||||
git archive --output=$(PKG) --prefix=$(PKG_NAME)/ HEAD
|
||||
|
||||
build: $(PKG)
|
||||
|
||||
$(SIG): $(PKG)
|
||||
gpg --sign --detach-sign --armor $(PKG)
|
||||
|
||||
sign: $(SIG)
|
||||
|
||||
clean:
|
||||
rm -f $(PKG) $(SIG)
|
||||
|
||||
all: $(PKG) $(SIG)
|
||||
|
||||
test:
|
||||
|
||||
tag:
|
||||
git tag v$(VERSION)
|
||||
git push --tags
|
||||
|
||||
release: $(PKG) $(SIG) tag
|
||||
|
||||
install:
|
||||
for dir in $(INSTALL_DIRS); do mkdir -p $(PREFIX)/$$dir; done
|
||||
for file in $(INSTALL_FILES); do cp $$file $(PREFIX)/$$file; done
|
||||
mkdir -p $(DOC_DIR)
|
||||
cp -r $(DOC_FILES) $(DOC_DIR)/
|
||||
|
||||
uninstall:
|
||||
for file in $(INSTALL_FILES); do rm -f $(PREFIX)/$$file; done
|
||||
rm -rf $(DOC_DIR)
|
||||
|
||||
|
||||
.PHONY: build sign clean test tag release install uninstall all
|
||||
|
Loading…
Reference in a new issue