Moving Makefile dist infrastructure to a separate branch
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
VERSION-FILE
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Based on git's GIT-VERSION-GEN.
|
|
||||||
|
|
||||||
VF=VERSION-FILE
|
|
||||||
DEF_VER=v2.2
|
|
||||||
|
|
||||||
LF='
|
|
||||||
'
|
|
||||||
|
|
||||||
if test -d .git -o -f .git &&
|
|
||||||
VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
|
|
||||||
case "$VN" in
|
|
||||||
*$LF*) (exit 1) ;;
|
|
||||||
v[0-9]*)
|
|
||||||
git update-index -q --refresh
|
|
||||||
test -z "$(git diff-index --name-only HEAD --)" ||
|
|
||||||
VN="$VN-dirty" ;;
|
|
||||||
esac
|
|
||||||
then
|
|
||||||
VN=$(echo "$VN" | sed -e 's/-/./g');
|
|
||||||
else
|
|
||||||
VN="$DEF_VER"
|
|
||||||
fi
|
|
||||||
|
|
||||||
VN=$(expr "$VN" : v*'\(.*\)')
|
|
||||||
|
|
||||||
if test -r $VF
|
|
||||||
then
|
|
||||||
VC=$(sed -e 's/^VERSION=//' <$VF)
|
|
||||||
else
|
|
||||||
VC=unset
|
|
||||||
fi
|
|
||||||
test "$VN" = "$VC" || {
|
|
||||||
echo >&2 "VERSION=$VN"
|
|
||||||
echo "VERSION=$VN" >$VF
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
34
Makefile
34
Makefile
@@ -1,34 +0,0 @@
|
|||||||
#
|
|
||||||
# Makefile for todo.txt
|
|
||||||
#
|
|
||||||
|
|
||||||
# Dynamically detect/generate version file as necessary
|
|
||||||
# This file will define a variable called VERSION.
|
|
||||||
.PHONY: .FORCE-VERSION-FILE
|
|
||||||
VERSION-FILE: .FORCE-VERSION-FILE
|
|
||||||
@./GEN-VERSION-FILE
|
|
||||||
-include VERSION-FILE
|
|
||||||
|
|
||||||
# Maybe this will include the version in it.
|
|
||||||
todo.sh: VERSION-FILE
|
|
||||||
|
|
||||||
# For packaging
|
|
||||||
DISTFILES := todo.cfg
|
|
||||||
|
|
||||||
DISTNAME=todo.txt_cli-$(VERSION)
|
|
||||||
dist: $(DISTFILES) todo.sh
|
|
||||||
mkdir -p $(DISTNAME)
|
|
||||||
cp -f $(DISTFILES) $(DISTNAME)/
|
|
||||||
sed -e 's/@DEV_VERSION@/'$(VERSION)'/' todo.sh > $(DISTNAME)/todo.sh
|
|
||||||
tar cf $(DISTNAME).tar $(DISTNAME)/
|
|
||||||
gzip -f -9 $(DISTNAME).tar
|
|
||||||
zip -9r $(DISTNAME).zip $(DISTNAME)/
|
|
||||||
rm -r $(DISTNAME)
|
|
||||||
|
|
||||||
.PHONY: clean
|
|
||||||
clean:
|
|
||||||
rm -f $(DISTNAME).tar.gz $(DISTNAME).zip
|
|
||||||
|
|
||||||
.PHONY: test
|
|
||||||
test:
|
|
||||||
@echo "TBD!"
|
|
||||||
Reference in New Issue
Block a user