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

Makefile 16 kB

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