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.

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