-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
152 lines (118 loc) · 4.1 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
DIRS = db rtags rlib rrpt rcsv worker bizlogic ws admin importers webclient tools test
RLNK = admin tools test
TOP = .
COUNTOL=${TOP}/tools/bashtools/countol.sh
THISDIR=.
DIST=tmp
GITHOOKDIR=.git/hooks
.PHONY: test
rentroll: *.go config
@find . -name "fail" -exec rm -r "{}" \;
@touch fail
for dir in $(DIRS); do make -C $$dir;done
@${COUNTOL} "go vet"
@${COUNTOL} golint
go build
@rm -f fail
@tools/bashtools/buildcheck.sh BUILD
all: clean rentroll test stats
config:
@/usr/local/accord/bin/getfile.sh accord/db/confdev.json
@/usr/local/accord/bin/getfile.sh accord/db/conflocal.json
@cp confdev.json config.json
relink: dolnk package
dolnk:
@for dir in $(RLNK); do make -C $$dir relink;done
@go build
jshint:
@touch fail
@${COUNTOL} "jshint --extract=always ./webclient/html/*.html ./webclient/html/test/*.html ./webclient/js/elems/*.js"
@rm -rf fail
try: build db4
db4:
cd tools/dbgen;./dbgen -f db4.json
build: clean rentroll package githook
testdb:
cd test/ws;mysql --no-defaults rentroll < restore.sql
receiptsdb:
mysql --no-defaults rentroll < receipts.sql
rrdb:
mysql --no-defaults rentroll < rr.sql
ctags:
ctags -R --exclude=test/webclient --exclude=.git --exclude=webclient
dbschemachange:
cd test/testdb;make clean test dbbackup;cd ../ws;make get
@tools/bashtools/buildcheck.sh SCHEMA_UPDATE
stats:
@echo "GO SOURCE CODE STATISTICS"
@echo "----------------------------------------"
@find . -name "*.go" | srcstats
@echo "----------------------------------------"
clean:
for dir in $(DIRS); do make -C $$dir clean;done
go clean
rm -f rentroll .tags ver.go config.json rentroll.log *.out restore.sql rrbkup rrnewdb rrrestore example fail GoAnalyzerError.log *.json
test: package
@find . -name "fail" -exec rm -r "{}" \;
@rm -f test/*/err.txt
for dir in $(DIRS); do make -C $$dir test;done
@tools/bashtools/buildcheck.sh TEST
@./errcheck.sh
man: rentroll.1
cp rentroll.1 /usr/local/share/man/man1
dev:
ln -s ./webclient/js
ln -s ./webclient/html
instman:
pushd ${DIST}/rentroll;./installman.sh;popd
package: rentroll
@find . -name "fail" -exec rm -r "{}" \;
@touch fail
rm -rf ${DIST}
mkdir -p ${DIST}/rentroll
mkdir -p ${DIST}/rentroll/man/man1/
mkdir -p ${DIST}/rentroll/example/csv
cp rentroll.1 ${DIST}/rentroll/man/man1
for dir in $(DIRS); do make -C $$dir package;done
cp rentroll ./${DIST}/rentroll/
cp ../gotable/pdfinstall.sh ${DIST}/rentroll/
cp activate.sh update.sh ./${DIST}/rentroll/
cp prodsetup.sh ./${DIST}/rentroll/
cp sbsetup.sh ./${DIST}/rentroll/
rm -f ./rrnewdb ./rrbkup ./rrrestore
ln -s ${DIST}/rentroll/rrnewdb
ln -s ${DIST}/rentroll/rrbkup
ln -s ${DIST}/rentroll/rrrestore
@rm -f fail
@echo "*** PACKAGE COMPLETED ***"
@tools/bashtools/buildcheck.sh PACKAGE
publish: package tarzip
cd ${DIST};/usr/local/accord/bin/deployfile.sh rentroll.tar.gz jenkins-snapshot/rentroll/latest
tarzip:
cd ${DIST};if [ -f ./rentroll/config.json ]; then mv ./rentroll/config.json .; fi
cd ${DIST};rm -f rentroll.tar*;tar czf rentroll.tar.gz rentroll
cd ${DIST};if [ -f ./config.json ]; then mv ./config.json ./rentroll/config.json; fi
snapshot: tarzip
cd ${DIST}; /usr/local/accord/bin/snapshot.sh rentroll.tar.gz
release:
/usr/local/accord/bin/release.sh rentroll
pubimages:
cd ${DIST}/rentroll;find . -name "*.png" | tar -cf rrimages.tar -T - ;gzip rrimages.tar ;/usr/local/accord/bin/deployfile.sh rrimages.tar.gz jenkins-snapshot/rentroll/latest
pubjs:
cd ${DIST}/rentroll;mv js/bundle*.js .;tar czvf rrjs.tar.gz ./js;mv bundle*.js js/;/usr/local/accord/bin/deployfile.sh rrjs.tar.gz jenkins-snapshot/rentroll/latest
pubdb:
# testing db
cd ./test/testdb;make dbbackup
pubfa:
# font awesome
cd ${DIST}/rentroll;tar czvf fa.tar.gz ./webclient/html/fa;/usr/local/accord/bin/deployfile.sh fa.tar.gz jenkins-snapshot/rentroll/latest
# publish all the non-os-dependent files to the repo
pub: pubjs pubimages pubdb pubfa
secure:
for dir in $(DIRS); do make -C $${dir} secure;done
@rm -f config.json confdev.json confprod.json
@if [ -d ${DIST} ]; then find ${DIST}/ -name config.json -exec rm {} \;; fi
githook: addgspattern
./linkgithook.sh
addgspattern:
./addgspattern.sh