~strahinja/ste

983972e846db643162eafb770acc95aa0e410d28 — Страхиња Радић 5 days ago 8c0669c master v0.7.4
Makefile,lib/: Synchronize changes to build files from sled
4 files changed, 28 insertions(+), 6 deletions(-)

M Makefile
M lib/makedate
M lib/makeversion
M lib/mkpack
M Makefile => Makefile +1 -1
@@ 56,7 56,7 @@ uninstall:
	cd $(BINDIR) && rm -f $(PROGS) && cd -
	rmdir $(BINDIR) 2>/dev/null || true

pack: all
pack:
	sh -x lib/mkpack

.PHONY: clean install makedate makeversion pack uninstall

M lib/makedate => lib/makedate +14 -1
@@ 9,7 9,20 @@ if [ -d .got ] && command -v got >/dev/null 2>&1; then
	awk '
	/^date: / {
		sub(/^date: /,"",$0)
		print $2 " " $3 ", " $5
		# Convert to proper form for `mandoc -Tlint`
		month_names["Jan"] = "January"
		month_names["Feb"] = "February"
		month_names["Mar"] = "March"
		month_names["Apr"] = "April"
		month_names["May"] = "May"
		month_names["Jun"] = "June"
		month_names["Jul"] = "July"
		month_names["Aug"] = "August"
		month_names["Sep"] = "September"
		month_names["Oct"] = "October"
		month_names["Nov"] = "November"
		month_names["Dec"] = "December"
		print month_names[$2] " " $3 ", " $5
		exit
	}' >date.new
elif [ -d .git ] && command -v git >/dev/null 2>&1; then

M lib/makeversion => lib/makeversion +3 -2
@@ 4,13 4,13 @@ FALLBACKVER=${FALLBACKVER:-unknown}

if [ -d .got ] && command -v got >/dev/null 2>&1; then
	lastcommit=$(got log |
		awk '/^commit/ {print substr($2,1,9); exit}')
		awk '/^commit/ {print substr($2,1,7); exit}')
	got tag -l |
		awk -v lastcommit="$lastcommit" '
		/^object: commit/ {
			if (!lasttagcom)
			{
				lasttagcom = substr($3,1,9)
				lasttagcom = substr($3,1,7)
			}
			next
		}


@@ 28,6 28,7 @@ if [ -d .got ] && command -v got >/dev/null 2>&1; then
			{
				printf "-g%s", lastcommit
			}
			printf "\n"
		}' >version.new
elif [ -d .git ] && command -v git >/dev/null 2>&1; then
	LC_ALL=C

M lib/mkpack => lib/mkpack +10 -2
@@ 1,9 1,17 @@
#!/bin/sh -x
# vim: set ft=bash:
DISTDIR=$(grep '^PROG[[:space:]]' config.mk |
DISTDIR=$(grep '^PROG[[:space:]]\{1,\}=' config.mk |
	sed -E 's,.*=[[:space:]]+([[:alpha:]]+),\1,')-$(cat version)
mkdir "$DISTDIR"
for f in $(git ls-files); do
if [ -d .got ] && command -v got >/dev/null 2>&1; then
	files=$(got tree | sed -e 's,[@/*$]$,,g')
elif [ -d .git ] && command -v git >/dev/null 2>&1; then
	files=$(git ls-files)
else
	printf "Either got or git are required for 'make pack'\n" >&2
	exit 1
fi
for f in $files; do
	d="$DISTDIR"/"$(dirname "$f")"
	mkdir -p "$d"
	cp "$f" "$d"/