-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
54 lines (43 loc) · 1.61 KB
/
Makefile
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# wtplan
# See LICENSE file for copyright and license details.
include config.mk
export GOPATH=$(shell pwd)
export VERSIONSTR=${VERSION}
all: wtplan wtplan-web
wtplan: src/wtplan/main.go
${GO} generate ./src/wtplan/main.go
${GO} build ./src/wtplan/main.go ./src/wtplan/version.go
@mv main wtplan
wtplan-web: $(wildcard src/wtplan-web/*.go src/wtplan-web/*.js)
${GO} generate ./src/wtplan-web/main.go
${GO} build ./src/wtplan-web/main.go ./src/wtplan-web/textfiles.go
@mv main wtplan-web
clean:
@echo cleaning
@rm -f wtplan
@rm -f wtplan-web
dist: clean
@echo creating dist tarball
@mkdir -p wtplan-${VERSION}
@cp -R src LICENSE Makefile config.mk README.md wtplan.1 wtplan-${VERSION}
@tar -cf wtplan-${VERSION}.tar wtplan-${VERSION}
@gzip wtplan-${VERSION}.tar
@rm -rf wtplan-${VERSION}
install: all
@echo installing executable files wtplan and wtplan-web to ${DESTDIR}${PREFIX}/bin
@mkdir -p ${DESTDIR}${PREFIX}/bin
@cp -f wtplan ${DESTDIR}${PREFIX}/bin
@chmod 755 ${DESTDIR}${PREFIX}/bin/wtplan
@cp -f wtplan-web ${DESTDIR}${PREFIX}/bin
@chmod 755 ${DESTDIR}${PREFIX}/bin/wtplan-web
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
@sed "s/VERSION/${VERSION}/g" < wtplan.1 > ${DESTDIR}${MANPREFIX}/man1/wtplan.1
@chmod 644 ${DESTDIR}${MANPREFIX}/man1/wtplan.1
uninstall:
@echo removing executable files from ${DESTDIR}${PREFIX}/bin
@rm -f ${DESTDIR}${PREFIX}/bin/wtplan
@rm -f ${DESTDIR}${PREFIX}/bin/wtplan-web
@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
@rm -f ${DESTDIR}${MANPREFIX}/man1/wtplan.1
.PHONY: all clean dist install uninstall