You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

449 lines
16 KiB

9 years ago
9 years ago
9 years ago
9 years ago
  1. DIST := dist
  2. IMPORT := code.gitea.io/gitea
  3. export GO111MODULE=off
  4. GO ?= go
  5. SED_INPLACE := sed -i
  6. SHASUM ?= shasum -a 256
  7. export PATH := $($(GO) env GOPATH)/bin:$(PATH)
  8. ifeq ($(OS), Windows_NT)
  9. EXECUTABLE := gitea.exe
  10. else
  11. EXECUTABLE := gitea
  12. UNAME_S := $(shell uname -s)
  13. ifeq ($(UNAME_S),Darwin)
  14. SED_INPLACE := sed -i ''
  15. endif
  16. endif
  17. BINDATA := modules/{options,public,templates}/bindata.go
  18. GOFILES := $(shell find . -name "*.go" -type f ! -path "./vendor/*" ! -path "*/bindata.go")
  19. GOFMT ?= gofmt -s
  20. GOFLAGS := -i -v
  21. EXTRA_GOFLAGS ?=
  22. MAKE_VERSION := $(shell make -v | head -n 1)
  23. ifneq ($(DRONE_TAG),)
  24. VERSION ?= $(subst v,,$(DRONE_TAG))
  25. GITEA_VERSION ?= $(VERSION)
  26. else
  27. ifneq ($(DRONE_BRANCH),)
  28. VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
  29. else
  30. VERSION ?= master
  31. endif
  32. GITEA_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
  33. endif
  34. LDFLAGS := -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)"
  35. PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations/migration-test,$(filter-out code.gitea.io/gitea/integrations,$(shell $(GO) list ./... | grep -v /vendor/)))
  36. SOURCES ?= $(shell find . -name "*.go" -type f)
  37. TAGS ?=
  38. TMPDIR := $(shell mktemp -d 2>/dev/null || mktemp -d -t 'gitea-temp')
  39. SWAGGER_SPEC := templates/swagger/v1_json.tmpl
  40. SWAGGER_SPEC_S_TMPL := s|"basePath": *"/api/v1"|"basePath": "{{AppSubUrl}}/api/v1"|g
  41. SWAGGER_SPEC_S_JSON := s|"basePath": *"{{AppSubUrl}}/api/v1"|"basePath": "/api/v1"|g
  42. SWAGGER_NEWLINE_COMMAND := -e '$$a\'
  43. TEST_MYSQL_HOST ?= mysql:3306
  44. TEST_MYSQL_DBNAME ?= testgitea
  45. TEST_MYSQL_USERNAME ?= root
  46. TEST_MYSQL_PASSWORD ?=
  47. TEST_MYSQL8_HOST ?= mysql8:3306
  48. TEST_MYSQL8_DBNAME ?= testgitea
  49. TEST_MYSQL8_USERNAME ?= root
  50. TEST_MYSQL8_PASSWORD ?=
  51. TEST_PGSQL_HOST ?= pgsql:5432
  52. TEST_PGSQL_DBNAME ?= testgitea
  53. TEST_PGSQL_USERNAME ?= postgres
  54. TEST_PGSQL_PASSWORD ?= postgres
  55. TEST_MSSQL_HOST ?= mssql:1433
  56. TEST_MSSQL_DBNAME ?= gitea
  57. TEST_MSSQL_USERNAME ?= sa
  58. TEST_MSSQL_PASSWORD ?= MwantsaSecurePassword1
  59. ifeq ($(OS), Windows_NT)
  60. EXECUTABLE := gitea.exe
  61. else
  62. EXECUTABLE := gitea
  63. endif
  64. # $(call strip-suffix,filename)
  65. strip-suffix = $(firstword $(subst ., ,$(1)))
  66. .PHONY: all
  67. all: build
  68. include docker/Makefile
  69. .PHONY: clean
  70. clean:
  71. $(GO) clean -i ./...
  72. rm -rf $(EXECUTABLE) $(DIST) $(BINDATA) \
  73. integrations*.test \
  74. integrations/gitea-integration-pgsql/ integrations/gitea-integration-mysql/ integrations/gitea-integration-mysql8/ integrations/gitea-integration-sqlite/ \
  75. integrations/gitea-integration-mssql/ integrations/indexers-mysql/ integrations/indexers-mysql8/ integrations/indexers-pgsql integrations/indexers-sqlite \
  76. integrations/indexers-mssql integrations/mysql.ini integrations/mysql8.ini integrations/pgsql.ini integrations/mssql.ini
  77. .PHONY: fmt
  78. fmt:
  79. $(GOFMT) -w $(GOFILES)
  80. .PHONY: vet
  81. vet:
  82. $(GO) vet $(PACKAGES)
  83. .PHONY: generate
  84. generate:
  85. @hash go-bindata > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  86. $(GO) get -u github.com/jteeuwen/go-bindata/go-bindata; \
  87. fi
  88. $(GO) generate $(PACKAGES)
  89. .PHONY: generate-swagger
  90. generate-swagger:
  91. @hash swagger > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  92. $(GO) get -u github.com/go-swagger/go-swagger/cmd/swagger; \
  93. fi
  94. swagger generate spec -o './$(SWAGGER_SPEC)'
  95. $(SED_INPLACE) '$(SWAGGER_SPEC_S_TMPL)' './$(SWAGGER_SPEC)'
  96. $(SED_INPLACE) $(SWAGGER_NEWLINE_COMMAND) './$(SWAGGER_SPEC)'
  97. .PHONY: swagger-check
  98. swagger-check: generate-swagger
  99. @diff=$$(git diff '$(SWAGGER_SPEC)'); \
  100. if [ -n "$$diff" ]; then \
  101. echo "Please run 'make generate-swagger' and commit the result:"; \
  102. echo "$${diff}"; \
  103. exit 1; \
  104. fi;
  105. .PHONY: swagger-validate
  106. swagger-validate:
  107. @hash swagger > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  108. $(GO) get -u github.com/go-swagger/go-swagger/cmd/swagger; \
  109. fi
  110. $(SED_INPLACE) '$(SWAGGER_SPEC_S_JSON)' './$(SWAGGER_SPEC)'
  111. swagger validate './$(SWAGGER_SPEC)'
  112. $(SED_INPLACE) '$(SWAGGER_SPEC_S_TMPL)' './$(SWAGGER_SPEC)'
  113. .PHONY: errcheck
  114. errcheck:
  115. @hash errcheck > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  116. $(GO) get -u github.com/kisielk/errcheck; \
  117. fi
  118. errcheck $(PACKAGES)
  119. .PHONY: lint
  120. lint:
  121. @hash revive > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  122. $(GO) get -u github.com/mgechev/revive; \
  123. fi
  124. revive -config .revive.toml -exclude=./vendor/... ./... || exit 1
  125. .PHONY: misspell-check
  126. misspell-check:
  127. @hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  128. $(GO) get -u github.com/client9/misspell/cmd/misspell; \
  129. fi
  130. misspell -error -i unknwon $(GOFILES)
  131. .PHONY: misspell
  132. misspell:
  133. @hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  134. $(GO) get -u github.com/client9/misspell/cmd/misspell; \
  135. fi
  136. misspell -w -i unknwon $(GOFILES)
  137. .PHONY: fmt-check
  138. fmt-check:
  139. # get all go files and run go fmt on them
  140. @diff=$$($(GOFMT) -d $(GOFILES)); \
  141. if [ -n "$$diff" ]; then \
  142. echo "Please run 'make fmt' and commit the result:"; \
  143. echo "$${diff}"; \
  144. exit 1; \
  145. fi;
  146. .PHONY: test
  147. test:
  148. GO111MODULE=on $(GO) test -mod=vendor -tags='sqlite sqlite_unlock_notify' $(PACKAGES)
  149. .PHONY: coverage
  150. coverage:
  151. @hash gocovmerge > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  152. $(GO) get -u github.com/wadey/gocovmerge; \
  153. fi
  154. gocovmerge integration.coverage.out $(shell find . -type f -name "coverage.out") > coverage.all;\
  155. .PHONY: unit-test-coverage
  156. unit-test-coverage:
  157. $(GO) test -tags='sqlite sqlite_unlock_notify' -cover -coverprofile coverage.out $(PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
  158. .PHONY: vendor
  159. vendor:
  160. GO111MODULE=on $(GO) mod tidy && GO111MODULE=on $(GO) mod vendor
  161. .PHONY: test-vendor
  162. test-vendor: vendor
  163. @diff=$$(git diff vendor/); \
  164. if [ -n "$$diff" ]; then \
  165. echo "Please run 'make vendor' and commit the result:"; \
  166. echo "$${diff}"; \
  167. exit 1; \
  168. fi;
  169. .PHONY: test-sqlite
  170. test-sqlite: integrations.sqlite.test
  171. GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test
  172. .PHONY: test-sqlite\#%
  173. test-sqlite\#%: integrations.sqlite.test
  174. GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.run $*
  175. .PHONY: test-sqlite-migration
  176. test-sqlite-migration: migrations.sqlite.test
  177. GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./migrations.sqlite.test
  178. generate-ini:
  179. sed -e 's|{{TEST_MYSQL_HOST}}|${TEST_MYSQL_HOST}|g' \
  180. -e 's|{{TEST_MYSQL_DBNAME}}|${TEST_MYSQL_DBNAME}|g' \
  181. -e 's|{{TEST_MYSQL_USERNAME}}|${TEST_MYSQL_USERNAME}|g' \
  182. -e 's|{{TEST_MYSQL_PASSWORD}}|${TEST_MYSQL_PASSWORD}|g' \
  183. integrations/mysql.ini.tmpl > integrations/mysql.ini
  184. sed -e 's|{{TEST_MYSQL8_HOST}}|${TEST_MYSQL8_HOST}|g' \
  185. -e 's|{{TEST_MYSQL8_DBNAME}}|${TEST_MYSQL8_DBNAME}|g' \
  186. -e 's|{{TEST_MYSQL8_USERNAME}}|${TEST_MYSQL8_USERNAME}|g' \
  187. -e 's|{{TEST_MYSQL8_PASSWORD}}|${TEST_MYSQL8_PASSWORD}|g' \
  188. integrations/mysql8.ini.tmpl > integrations/mysql8.ini
  189. sed -e 's|{{TEST_PGSQL_HOST}}|${TEST_PGSQL_HOST}|g' \
  190. -e 's|{{TEST_PGSQL_DBNAME}}|${TEST_PGSQL_DBNAME}|g' \
  191. -e 's|{{TEST_PGSQL_USERNAME}}|${TEST_PGSQL_USERNAME}|g' \
  192. -e 's|{{TEST_PGSQL_PASSWORD}}|${TEST_PGSQL_PASSWORD}|g' \
  193. integrations/pgsql.ini.tmpl > integrations/pgsql.ini
  194. sed -e 's|{{TEST_MSSQL_HOST}}|${TEST_MSSQL_HOST}|g' \
  195. -e 's|{{TEST_MSSQL_DBNAME}}|${TEST_MSSQL_DBNAME}|g' \
  196. -e 's|{{TEST_MSSQL_USERNAME}}|${TEST_MSSQL_USERNAME}|g' \
  197. -e 's|{{TEST_MSSQL_PASSWORD}}|${TEST_MSSQL_PASSWORD}|g' \
  198. integrations/mssql.ini.tmpl > integrations/mssql.ini
  199. .PHONY: test-mysql
  200. test-mysql: integrations.test generate-ini
  201. GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.test
  202. .PHONY: test-mysql-migration
  203. test-mysql-migration: migrations.test generate-ini
  204. GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./migrations.test
  205. .PHONY: test-mysql8
  206. test-mysql8: integrations.test generate-ini
  207. GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql8.ini ./integrations.test
  208. .PHONY: test-mysql8-migration
  209. test-mysql8-migration: migrations.test generate-ini
  210. GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql8.ini ./migrations.test
  211. .PHONY: test-pgsql
  212. test-pgsql: integrations.test generate-ini
  213. GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.test
  214. .PHONY: test-pgsql-migration
  215. test-pgsql-migration: migrations.test generate-ini
  216. GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./migrations.test
  217. .PHONY: test-mssql
  218. test-mssql: integrations.test generate-ini
  219. GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./integrations.test
  220. .PHONY: test-mssql-migration
  221. test-mssql-migration: migrations.test generate-ini
  222. GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./migrations.test
  223. .PHONY: bench-sqlite
  224. bench-sqlite: integrations.sqlite.test
  225. GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
  226. .PHONY: bench-mysql
  227. bench-mysql: integrations.test generate-ini
  228. GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
  229. .PHONY: bench-mssql
  230. bench-mssql: integrations.test generate-ini
  231. GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./integrations.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
  232. .PHONY: bench-pgsql
  233. bench-pgsql: integrations.test generate-ini
  234. GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
  235. .PHONY: integration-test-coverage
  236. integration-test-coverage: integrations.cover.test generate-ini
  237. GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.cover.test -test.coverprofile=integration.coverage.out
  238. integrations.test: $(SOURCES)
  239. GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.test
  240. integrations.sqlite.test: $(SOURCES)
  241. GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags 'sqlite sqlite_unlock_notify'
  242. integrations.cover.test: $(SOURCES)
  243. GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(PACKAGES) | tr ' ' ',') -o integrations.cover.test
  244. .PHONY: migrations.test
  245. migrations.test: $(SOURCES)
  246. $(GO) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.test
  247. .PHONY: migrations.sqlite.test
  248. migrations.sqlite.test: $(SOURCES)
  249. $(GO) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.sqlite.test -tags 'sqlite sqlite_unlock_notify'
  250. .PHONY: check
  251. check: test
  252. .PHONY: install
  253. install: $(wildcard *.go)
  254. $(GO) install -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)'
  255. .PHONY: build
  256. build: $(EXECUTABLE)
  257. $(EXECUTABLE): $(SOURCES)
  258. GO111MODULE=on $(GO) build -mod=vendor $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
  259. .PHONY: release
  260. release: release-dirs release-windows release-linux release-darwin release-copy release-compress release-check
  261. .PHONY: release-dirs
  262. release-dirs:
  263. mkdir -p $(DIST)/binaries $(DIST)/release
  264. .PHONY: release-windows
  265. release-windows:
  266. @hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  267. $(GO) get -u src.techknowlogick.com/xgo; \
  268. fi
  269. xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) .
  270. ifeq ($(CI),drone)
  271. cp /build/* $(DIST)/binaries
  272. endif
  273. .PHONY: release-linux
  274. release-linux:
  275. @hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  276. $(GO) get -u src.techknowlogick.com/xgo; \
  277. fi
  278. xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'linux/*' -out gitea-$(VERSION) .
  279. ifeq ($(CI),drone)
  280. cp /build/* $(DIST)/binaries
  281. endif
  282. .PHONY: release-darwin
  283. release-darwin:
  284. @hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  285. $(GO) get -u src.techknowlogick.com/xgo; \
  286. fi
  287. xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin/*' -out gitea-$(VERSION) .
  288. ifeq ($(CI),drone)
  289. cp /build/* $(DIST)/binaries
  290. endif
  291. .PHONY: release-copy
  292. release-copy:
  293. cd $(DIST); for file in `find /build -type f -name "*"`; do cp $${file} ./release/; done;
  294. .PHONY: release-check
  295. release-check:
  296. cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "checksumming $${file}" && $(SHASUM) `echo $${file} | sed 's/^..//'` > $${file}.sha256; done;
  297. .PHONY: release-compress
  298. release-compress:
  299. @hash gxz > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  300. $(GO) get -u github.com/ulikunitz/xz/cmd/gxz; \
  301. fi
  302. cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && gxz -k -9 $${file}; done;
  303. .PHONY: javascripts
  304. javascripts: public/js/index.js
  305. .IGNORE: public/js/index.js
  306. public/js/index.js: $(JAVASCRIPTS)
  307. cat $< >| $@
  308. .PHONY: stylesheets-check
  309. stylesheets-check: generate-stylesheets
  310. @diff=$$(git diff public/css/*); \
  311. if [ -n "$$diff" ]; then \
  312. echo "Please run 'make generate-stylesheets' and commit the result:"; \
  313. echo "$${diff}"; \
  314. exit 1; \
  315. fi;
  316. .PHONY: generate-stylesheets
  317. generate-stylesheets:
  318. @hash npx > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  319. echo "Please install npm version 5.2+"; \
  320. exit 1; \
  321. fi;
  322. $(eval BROWSERS := "> 1%, last 2 firefox versions, last 2 safari versions, ie 11")
  323. npx lessc --clean-css public/less/index.less public/css/index.css
  324. $(foreach file, $(filter-out public/less/themes/_base.less, $(wildcard public/less/themes/*)),npx lessc --clean-css public/less/themes/$(notdir $(file)) > public/css/theme-$(notdir $(call strip-suffix,$(file))).css;)
  325. $(foreach file, $(wildcard public/css/*),npx postcss --use autoprefixer --autoprefixer.browsers $(BROWSERS) -o $(file) $(file);)
  326. .PHONY: swagger-ui
  327. swagger-ui:
  328. rm -Rf public/vendor/assets/swagger-ui
  329. git clone --depth=10 -b v3.13.4 --single-branch https://github.com/swagger-api/swagger-ui.git $(TMPDIR)/swagger-ui
  330. mv $(TMPDIR)/swagger-ui/dist public/vendor/assets/swagger-ui
  331. rm -Rf $(TMPDIR)/swagger-ui
  332. $(SED_INPLACE) "s;http://petstore.swagger.io/v2/swagger.json;../../../swagger.v1.json;g" public/vendor/assets/swagger-ui/index.html
  333. .PHONY: update-translations
  334. update-translations:
  335. mkdir -p ./translations
  336. cd ./translations && curl -L https://crowdin.com/download/project/gitea.zip > gitea.zip && unzip gitea.zip
  337. rm ./translations/gitea.zip
  338. $(SED_INPLACE) -e 's/="/=/g' -e 's/"$$//g' ./translations/*.ini
  339. $(SED_INPLACE) -e 's/\\"/"/g' ./translations/*.ini
  340. mv ./translations/*.ini ./options/locale/
  341. rmdir ./translations
  342. .PHONY: generate-images
  343. generate-images:
  344. mkdir -p $(TMPDIR)/images
  345. inkscape -f $(PWD)/assets/logo.svg -w 880 -h 880 -e $(PWD)/public/img/gitea-lg.png
  346. inkscape -f $(PWD)/assets/logo.svg -w 512 -h 512 -e $(PWD)/public/img/gitea-512.png
  347. inkscape -f $(PWD)/assets/logo.svg -w 192 -h 192 -e $(PWD)/public/img/gitea-192.png
  348. inkscape -f $(PWD)/assets/logo.svg -w 120 -h 120 -jC -i layer1 -e $(TMPDIR)/images/sm-1.png
  349. inkscape -f $(PWD)/assets/logo.svg -w 120 -h 120 -jC -i layer2 -e $(TMPDIR)/images/sm-2.png
  350. composite -compose atop $(TMPDIR)/images/sm-2.png $(TMPDIR)/images/sm-1.png $(PWD)/public/img/gitea-sm.png
  351. inkscape -f $(PWD)/assets/logo.svg -w 200 -h 200 -e $(PWD)/public/img/avatar_default.png
  352. inkscape -f $(PWD)/assets/logo.svg -w 180 -h 180 -e $(PWD)/public/img/favicon.png
  353. inkscape -f $(PWD)/assets/logo.svg -w 128 -h 128 -e $(TMPDIR)/images/128-raw.png
  354. inkscape -f $(PWD)/assets/logo.svg -w 64 -h 64 -e $(TMPDIR)/images/64-raw.png
  355. inkscape -f $(PWD)/assets/logo.svg -w 32 -h 32 -jC -i layer1 -e $(TMPDIR)/images/32-1.png
  356. inkscape -f $(PWD)/assets/logo.svg -w 32 -h 32 -jC -i layer2 -e $(TMPDIR)/images/32-2.png
  357. composite -compose atop $(TMPDIR)/images/32-2.png $(TMPDIR)/images/32-1.png $(TMPDIR)/images/32-raw.png
  358. inkscape -f $(PWD)/assets/logo.svg -w 16 -h 16 -jC -i layer1 -e $(TMPDIR)/images/16-raw.png
  359. zopflipng -m -y $(TMPDIR)/images/128-raw.png $(TMPDIR)/images/128.png
  360. zopflipng -m -y $(TMPDIR)/images/64-raw.png $(TMPDIR)/images/64.png
  361. zopflipng -m -y $(TMPDIR)/images/32-raw.png $(TMPDIR)/images/32.png
  362. zopflipng -m -y $(TMPDIR)/images/16-raw.png $(TMPDIR)/images/16.png
  363. rm -f $(TMPDIR)/images/*-*.png
  364. convert $(TMPDIR)/images/16.png $(TMPDIR)/images/32.png \
  365. $(TMPDIR)/images/64.png $(TMPDIR)/images/128.png \
  366. $(PWD)/public/img/favicon.ico
  367. rm -rf $(TMPDIR)/images
  368. $(foreach file, $(shell find public/img -type f -name '*.png'),zopflipng -m -y $(file) $(file);)
  369. .PHONY: pr
  370. pr:
  371. $(GO) run contrib/pr/checkout.go $(PR)