aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 9a981d73c734e6a46dbe2888bcb7ddcf0ba9664f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
VERSION ?= 0.2
SOURCE_DATE_EPOCH ?= $(shell date +%s)

all: gocgi-${VERSION}.tar.gz clean

gocgi-${VERSION}.tar.gz: gocgi-${VERSION}
	tar --sort=name \
	 	--numeric-owner \
	 	--owner=0 \
		--group=0 \
		--gzip \
		--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \
		-cf gocgi-${VERSION}.tar.gz \
		gocgi-${VERSION}

gocgi-${VERSION}:
	mkdir gocgi-${VERSION}
	cp main.go gocgi-${VERSION}/
	cp README.md gocgi-${VERSION}/
	cp go.mod gocgi-${VERSION}/
	cp Makefile gocgi-${VERSION}/
	find gocgi-${VERSION} -print0 | \
		xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}"

clean:
	rm -R gocgi-${VERSION}