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.

Makefile 31KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805
  1. ifeq ($(USE_REPO_TEST_DIR),1)
  2. # This rule replaces the whole Makefile when we're trying to use /tmp repository temporary files
  3. location = $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
  4. self := $(location)
  5. %:
  6. @tmpdir=`mktemp --tmpdir -d` ; \
  7. echo Using temporary directory $$tmpdir for test repositories ; \
  8. USE_REPO_TEST_DIR= $(MAKE) -f $(self) --no-print-directory REPO_TEST_DIR=$$tmpdir/ $@ ; \
  9. STATUS=$$? ; rm -r "$$tmpdir" ; exit $$STATUS
  10. else
  11. # This is the "normal" part of the Makefile
  12. DIST := dist
  13. DIST_DIRS := $(DIST)/binaries $(DIST)/release
  14. IMPORT := code.gitea.io/gitea
  15. export GO111MODULE=on
  16. GO ?= go
  17. SHASUM ?= shasum -a 256
  18. HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
  19. COMMA := ,
  20. XGO_VERSION := go-1.18.x
  21. AIR_PACKAGE ?= github.com/cosmtrek/air@v1.29.0
  22. EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@2.4.0
  23. ERRCHECK_PACKAGE ?= github.com/kisielk/errcheck@v1.6.0
  24. GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.3.1
  25. GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.46.0
  26. GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.10
  27. MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/misspell@v0.3.4
  28. SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.29.0
  29. XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
  30. DOCKER_IMAGE ?= gitea/gitea
  31. DOCKER_TAG ?= latest
  32. DOCKER_REF := $(DOCKER_IMAGE):$(DOCKER_TAG)
  33. ifeq ($(HAS_GO), GO)
  34. GOPATH ?= $(shell $(GO) env GOPATH)
  35. export PATH := $(GOPATH)/bin:$(PATH)
  36. CGO_EXTRA_CFLAGS := -DSQLITE_MAX_VARIABLE_NUMBER=32766
  37. CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
  38. endif
  39. ifeq ($(OS), Windows_NT)
  40. GOFLAGS := -v -buildmode=exe
  41. EXECUTABLE ?= gitea.exe
  42. else ifeq ($(OS), Windows)
  43. GOFLAGS := -v -buildmode=exe
  44. EXECUTABLE ?= gitea.exe
  45. else
  46. GOFLAGS := -v
  47. EXECUTABLE ?= gitea
  48. endif
  49. ifeq ($(shell sed --version 2>/dev/null | grep -q GNU && echo gnu),gnu)
  50. SED_INPLACE := sed -i
  51. else
  52. SED_INPLACE := sed -i ''
  53. endif
  54. EXTRA_GOFLAGS ?=
  55. MAKE_VERSION := $(shell "$(MAKE)" -v | head -n 1)
  56. MAKE_EVIDENCE_DIR := .make_evidence
  57. ifeq ($(RACE_ENABLED),true)
  58. GOFLAGS += -race
  59. GOTESTFLAGS += -race
  60. endif
  61. STORED_VERSION_FILE := VERSION
  62. ifneq ($(DRONE_TAG),)
  63. VERSION ?= $(subst v,,$(DRONE_TAG))
  64. GITEA_VERSION ?= $(VERSION)
  65. else
  66. ifneq ($(DRONE_BRANCH),)
  67. VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
  68. else
  69. VERSION ?= main
  70. endif
  71. STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null)
  72. ifneq ($(STORED_VERSION),)
  73. GITEA_VERSION ?= $(STORED_VERSION)
  74. else
  75. GITEA_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
  76. endif
  77. endif
  78. LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)"
  79. LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64
  80. GO_PACKAGES ?= $(filter-out code.gitea.io/gitea/models/migrations code.gitea.io/gitea/integrations/migration-test code.gitea.io/gitea/integrations,$(shell $(GO) list ./... | grep -v /vendor/))
  81. FOMANTIC_WORK_DIR := web_src/fomantic
  82. WEBPACK_SOURCES := $(shell find web_src/js web_src/less -type f)
  83. WEBPACK_CONFIGS := webpack.config.js
  84. WEBPACK_DEST := public/js/index.js public/css/index.css
  85. WEBPACK_DEST_ENTRIES := public/js public/css public/fonts public/img/webpack public/serviceworker.js
  86. BINDATA_DEST := modules/public/bindata.go modules/options/bindata.go modules/templates/bindata.go
  87. BINDATA_HASH := $(addsuffix .hash,$(BINDATA_DEST))
  88. SVG_DEST_DIR := public/img/svg
  89. AIR_TMP_DIR := .air
  90. TAGS ?=
  91. TAGS_SPLIT := $(subst $(COMMA), ,$(TAGS))
  92. TAGS_EVIDENCE := $(MAKE_EVIDENCE_DIR)/tags
  93. TEST_TAGS ?= sqlite sqlite_unlock_notify
  94. TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(FOMANTIC_WORK_DIR)/node_modules $(DIST) $(MAKE_EVIDENCE_DIR) $(AIR_TMP_DIR)
  95. GO_DIRS := cmd integrations models modules routers build services tools
  96. GO_SOURCES := $(wildcard *.go)
  97. GO_SOURCES += $(shell find $(GO_DIRS) -type f -name "*.go" -not -path modules/options/bindata.go -not -path modules/public/bindata.go -not -path modules/templates/bindata.go)
  98. ifeq ($(filter $(TAGS_SPLIT),bindata),bindata)
  99. GO_SOURCES += $(BINDATA_DEST)
  100. endif
  101. SWAGGER_SPEC := templates/swagger/v1_json.tmpl
  102. SWAGGER_SPEC_S_TMPL := s|"basePath": *"/api/v1"|"basePath": "{{AppSubUrl \| JSEscape \| Safe}}/api/v1"|g
  103. SWAGGER_SPEC_S_JSON := s|"basePath": *"{{AppSubUrl \| JSEscape \| Safe}}/api/v1"|"basePath": "/api/v1"|g
  104. SWAGGER_EXCLUDE := code.gitea.io/sdk
  105. SWAGGER_NEWLINE_COMMAND := -e '$$a\'
  106. TEST_MYSQL_HOST ?= mysql:3306
  107. TEST_MYSQL_DBNAME ?= testgitea
  108. TEST_MYSQL_USERNAME ?= root
  109. TEST_MYSQL_PASSWORD ?=
  110. TEST_MYSQL8_HOST ?= mysql8:3306
  111. TEST_MYSQL8_DBNAME ?= testgitea
  112. TEST_MYSQL8_USERNAME ?= root
  113. TEST_MYSQL8_PASSWORD ?=
  114. TEST_PGSQL_HOST ?= pgsql:5432
  115. TEST_PGSQL_DBNAME ?= testgitea
  116. TEST_PGSQL_USERNAME ?= postgres
  117. TEST_PGSQL_PASSWORD ?= postgres
  118. TEST_PGSQL_SCHEMA ?= gtestschema
  119. TEST_MSSQL_HOST ?= mssql:1433
  120. TEST_MSSQL_DBNAME ?= gitea
  121. TEST_MSSQL_USERNAME ?= sa
  122. TEST_MSSQL_PASSWORD ?= MwantsaSecurePassword1
  123. .PHONY: all
  124. all: build
  125. .PHONY: help
  126. help:
  127. @echo "Make Routines:"
  128. @echo " - \"\" equivalent to \"build\""
  129. @echo " - build build everything"
  130. @echo " - frontend build frontend files"
  131. @echo " - backend build backend files"
  132. @echo " - watch watch everything and continuously rebuild"
  133. @echo " - watch-frontend watch frontend files and continuously rebuild"
  134. @echo " - watch-backend watch backend files and continuously rebuild"
  135. @echo " - clean delete backend and integration files"
  136. @echo " - clean-all delete backend, frontend and integration files"
  137. @echo " - deps install dependencies"
  138. @echo " - deps-frontend install frontend dependencies"
  139. @echo " - deps-backend install backend dependencies"
  140. @echo " - lint lint everything"
  141. @echo " - lint-frontend lint frontend files"
  142. @echo " - lint-backend lint backend files"
  143. @echo " - checks run various consistency checks"
  144. @echo " - checks-frontend check frontend files"
  145. @echo " - checks-backend check backend files"
  146. @echo " - test test everything"
  147. @echo " - test-frontend test frontend files"
  148. @echo " - test-backend test backend files"
  149. @echo " - webpack build webpack files"
  150. @echo " - svg build svg files"
  151. @echo " - fomantic build fomantic files"
  152. @echo " - generate run \"go generate\""
  153. @echo " - fmt format the Go code"
  154. @echo " - generate-license update license files"
  155. @echo " - generate-gitignore update gitignore files"
  156. @echo " - generate-manpage generate manpage"
  157. @echo " - generate-swagger generate the swagger spec from code comments"
  158. @echo " - swagger-validate check if the swagger spec is valid"
  159. @echo " - golangci-lint run golangci-lint linter"
  160. @echo " - vet examines Go source code and reports suspicious constructs"
  161. @echo " - tidy run go mod tidy"
  162. @echo " - test[\#TestSpecificName] run unit test"
  163. @echo " - test-sqlite[\#TestSpecificName] run integration test for sqlite"
  164. @echo " - pr#<index> build and start gitea from a PR with integration test data loaded"
  165. .PHONY: go-check
  166. go-check:
  167. $(eval MIN_GO_VERSION_STR := $(shell grep -Eo '^go\s+[0-9]+\.[0-9.]+' go.mod | cut -d' ' -f2))
  168. $(eval MIN_GO_VERSION := $(shell printf "%03d%03d%03d" $(shell echo '$(MIN_GO_VERSION_STR)' | tr '.' ' ')))
  169. $(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell $(GO) version | grep -Eo '[0-9]+\.[0-9.]+' | tr '.' ' ');))
  170. @if [ "$(GO_VERSION)" -lt "$(MIN_GO_VERSION)" ]; then \
  171. echo "Gitea requires Go $(MIN_GO_VERSION_STR) or greater to build. You can get it at https://go.dev/dl/"; \
  172. exit 1; \
  173. fi
  174. .PHONY: git-check
  175. git-check:
  176. @if git lfs >/dev/null 2>&1 ; then : ; else \
  177. echo "Gitea requires git with lfs support to run tests." ; \
  178. exit 1; \
  179. fi
  180. .PHONY: node-check
  181. node-check:
  182. $(eval MIN_NODE_VERSION_STR := $(shell grep -Eo '"node":.*[0-9.]+"' package.json | sed -n 's/.*[^0-9.]\([0-9.]*\)"/\1/p'))
  183. $(eval MIN_NODE_VERSION := $(shell printf "%03d%03d%03d" $(shell echo '$(MIN_NODE_VERSION_STR)' | tr '.' ' ')))
  184. $(eval NODE_VERSION := $(shell printf "%03d%03d%03d" $(shell node -v | cut -c2- | tr '.' ' ');))
  185. $(eval NPM_MISSING := $(shell hash npm > /dev/null 2>&1 || echo 1))
  186. @if [ "$(NODE_VERSION)" -lt "$(MIN_NODE_VERSION)" -o "$(NPM_MISSING)" = "1" ]; then \
  187. echo "Gitea requires Node.js $(MIN_NODE_VERSION_STR) or greater and npm to build. You can get it at https://nodejs.org/en/download/"; \
  188. exit 1; \
  189. fi
  190. .PHONY: clean-all
  191. clean-all: clean
  192. rm -rf $(WEBPACK_DEST_ENTRIES) node_modules
  193. .PHONY: clean
  194. clean:
  195. $(GO) clean -i ./...
  196. rm -rf $(EXECUTABLE) $(DIST) $(BINDATA_DEST) $(BINDATA_HASH) \
  197. integrations*.test \
  198. integrations/gitea-integration-pgsql/ integrations/gitea-integration-mysql/ integrations/gitea-integration-mysql8/ integrations/gitea-integration-sqlite/ \
  199. integrations/gitea-integration-mssql/ integrations/indexers-mysql/ integrations/indexers-mysql8/ integrations/indexers-pgsql integrations/indexers-sqlite \
  200. integrations/indexers-mssql integrations/mysql.ini integrations/mysql8.ini integrations/pgsql.ini integrations/mssql.ini man/
  201. .PHONY: fmt
  202. fmt:
  203. @echo "Running gitea-fmt (with gofumpt)..."
  204. @MISSPELL_PACKAGE=$(MISSPELL_PACKAGE) GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -w '{file-list}'
  205. .PHONY: vet
  206. vet:
  207. @echo "Running go vet..."
  208. @GOOS= GOARCH= $(GO) build code.gitea.io/gitea-vet
  209. @$(GO) vet -vettool=gitea-vet $(GO_PACKAGES)
  210. .PHONY: $(TAGS_EVIDENCE)
  211. $(TAGS_EVIDENCE):
  212. @mkdir -p $(MAKE_EVIDENCE_DIR)
  213. @echo "$(TAGS)" > $(TAGS_EVIDENCE)
  214. ifneq "$(TAGS)" "$(shell cat $(TAGS_EVIDENCE) 2>/dev/null)"
  215. TAGS_PREREQ := $(TAGS_EVIDENCE)
  216. endif
  217. .PHONY: generate-swagger
  218. generate-swagger:
  219. $(GO) run $(SWAGGER_PACKAGE) generate spec -x "$(SWAGGER_EXCLUDE)" -o './$(SWAGGER_SPEC)'
  220. $(SED_INPLACE) '$(SWAGGER_SPEC_S_TMPL)' './$(SWAGGER_SPEC)'
  221. $(SED_INPLACE) $(SWAGGER_NEWLINE_COMMAND) './$(SWAGGER_SPEC)'
  222. .PHONY: swagger-check
  223. swagger-check: generate-swagger
  224. @diff=$$(git diff '$(SWAGGER_SPEC)'); \
  225. if [ -n "$$diff" ]; then \
  226. echo "Please run 'make generate-swagger' and commit the result:"; \
  227. echo "$${diff}"; \
  228. exit 1; \
  229. fi
  230. .PHONY: swagger-validate
  231. swagger-validate:
  232. $(SED_INPLACE) '$(SWAGGER_SPEC_S_JSON)' './$(SWAGGER_SPEC)'
  233. $(GO) run $(SWAGGER_PACKAGE) validate './$(SWAGGER_SPEC)'
  234. $(SED_INPLACE) '$(SWAGGER_SPEC_S_TMPL)' './$(SWAGGER_SPEC)'
  235. .PHONY: errcheck
  236. errcheck:
  237. @echo "Running errcheck..."
  238. $(GO) run $(ERRCHECK_PACKAGE) $(GO_PACKAGES)
  239. .PHONY: fmt-check
  240. fmt-check:
  241. # get all go files and run gitea-fmt (with gofmt) on them
  242. @diff=$$(MISSPELL_PACKAGE=$(MISSPELL_PACKAGE) GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -l '{file-list}'); \
  243. if [ -n "$$diff" ]; then \
  244. echo "Please run 'make fmt' and commit the result:"; \
  245. echo "$${diff}"; \
  246. exit 1; \
  247. fi
  248. .PHONY: checks
  249. checks: checks-frontend checks-backend
  250. .PHONY: checks-frontend
  251. checks-frontend: lockfile-check svg-check
  252. .PHONY: checks-backend
  253. checks-backend: gomod-check swagger-check swagger-validate
  254. .PHONY: lint
  255. lint: lint-frontend lint-backend
  256. .PHONY: lint-frontend
  257. lint-frontend: node_modules
  258. npx eslint --color --max-warnings=0 web_src/js build templates *.config.js docs/assets/js
  259. npx stylelint --color --max-warnings=0 web_src/less
  260. .PHONY: lint-backend
  261. lint-backend: golangci-lint vet editorconfig-checker
  262. .PHONY: watch
  263. watch:
  264. bash tools/watch.sh
  265. .PHONY: watch-frontend
  266. watch-frontend: node-check node_modules
  267. rm -rf $(WEBPACK_DEST_ENTRIES)
  268. NODE_ENV=development npx webpack --watch --progress
  269. .PHONY: watch-backend
  270. watch-backend: go-check
  271. $(GO) run $(AIR_PACKAGE) -c .air.toml
  272. .PHONY: test
  273. test: test-frontend test-backend
  274. .PHONY: test-backend
  275. test-backend:
  276. @echo "Running go test with $(GOTESTFLAGS) -tags '$(TEST_TAGS)'..."
  277. @$(GO) test $(GOTESTFLAGS) -tags='$(TEST_TAGS)' $(GO_PACKAGES)
  278. .PHONY: test-frontend
  279. test-frontend: node_modules
  280. @NODE_OPTIONS="--experimental-vm-modules --no-warnings" npx jest --color
  281. .PHONY: test-check
  282. test-check:
  283. @echo "Running test-check...";
  284. @diff=$$(git status -s); \
  285. if [ -n "$$diff" ]; then \
  286. echo "make test-backend has changed files in the source tree:"; \
  287. echo "$${diff}"; \
  288. echo "You should change the tests to create these files in a temporary directory."; \
  289. echo "Do not simply add these files to .gitignore"; \
  290. exit 1; \
  291. fi
  292. .PHONY: test\#%
  293. test\#%:
  294. @echo "Running go test with -tags '$(TEST_TAGS)'..."
  295. @$(GO) test $(GOTESTFLAGS) -tags='$(TEST_TAGS)' -run $(subst .,/,$*) $(GO_PACKAGES)
  296. .PHONY: coverage
  297. coverage:
  298. grep '^\(mode: .*\)\|\(.*:[0-9]\+\.[0-9]\+,[0-9]\+\.[0-9]\+ [0-9]\+ [0-9]\+\)$$' coverage.out > coverage-bodged.out
  299. grep '^\(mode: .*\)\|\(.*:[0-9]\+\.[0-9]\+,[0-9]\+\.[0-9]\+ [0-9]\+ [0-9]\+\)$$' integration.coverage.out > integration.coverage-bodged.out
  300. GO111MODULE=on $(GO) run build/gocovmerge.go integration.coverage-bodged.out coverage-bodged.out > coverage.all || (echo "gocovmerge failed"; echo "integration.coverage.out"; cat integration.coverage.out; echo "coverage.out"; cat coverage.out; exit 1)
  301. .PHONY: unit-test-coverage
  302. unit-test-coverage:
  303. @echo "Running unit-test-coverage $(GOTESTFLAGS) -tags '$(TEST_TAGS)'..."
  304. @$(GO) test $(GOTESTFLAGS) -timeout=20m -tags='$(TEST_TAGS)' -cover -coverprofile coverage.out $(GO_PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
  305. .PHONY: tidy
  306. tidy:
  307. $(eval MIN_GO_VERSION := $(shell grep -Eo '^go\s+[0-9]+\.[0-9.]+' go.mod | cut -d' ' -f2))
  308. $(GO) mod tidy -compat=$(MIN_GO_VERSION)
  309. .PHONY: vendor
  310. vendor: tidy
  311. $(GO) mod vendor
  312. .PHONY: gomod-check
  313. gomod-check: tidy
  314. @diff=$$(git diff go.sum); \
  315. if [ -n "$$diff" ]; then \
  316. echo "Please run 'make tidy' and commit the result:"; \
  317. echo "$${diff}"; \
  318. exit 1; \
  319. fi
  320. generate-ini-sqlite:
  321. sed -e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \
  322. integrations/sqlite.ini.tmpl > integrations/sqlite.ini
  323. .PHONY: test-sqlite
  324. test-sqlite: integrations.sqlite.test generate-ini-sqlite
  325. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test
  326. .PHONY: test-sqlite\#%
  327. test-sqlite\#%: integrations.sqlite.test generate-ini-sqlite
  328. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.run $(subst .,/,$*)
  329. .PHONY: test-sqlite-migration
  330. test-sqlite-migration: migrations.sqlite.test migrations.individual.sqlite.test generate-ini-sqlite
  331. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/sqlite.ini ./migrations.sqlite.test
  332. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/sqlite.ini ./migrations.individual.sqlite.test
  333. .PHONY: test-sqlite-migration\#%
  334. test-sqlite-migration\#%: migrations.sqlite.test migrations.individual.sqlite.test generate-ini-sqlite
  335. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/sqlite.ini ./migrations.individual.sqlite.test -test.run $(subst .,/,$*)
  336. generate-ini-mysql:
  337. sed -e 's|{{TEST_MYSQL_HOST}}|${TEST_MYSQL_HOST}|g' \
  338. -e 's|{{TEST_MYSQL_DBNAME}}|${TEST_MYSQL_DBNAME}|g' \
  339. -e 's|{{TEST_MYSQL_USERNAME}}|${TEST_MYSQL_USERNAME}|g' \
  340. -e 's|{{TEST_MYSQL_PASSWORD}}|${TEST_MYSQL_PASSWORD}|g' \
  341. -e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \
  342. integrations/mysql.ini.tmpl > integrations/mysql.ini
  343. .PHONY: test-mysql
  344. test-mysql: integrations.mysql.test generate-ini-mysql
  345. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mysql.ini ./integrations.mysql.test
  346. .PHONY: test-mysql\#%
  347. test-mysql\#%: integrations.mysql.test generate-ini-mysql
  348. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mysql.ini ./integrations.mysql.test -test.run $(subst .,/,$*)
  349. .PHONY: test-mysql-migration
  350. test-mysql-migration: migrations.mysql.test migrations.individual.mysql.test generate-ini-mysql
  351. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mysql.ini ./migrations.mysql.test
  352. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mysql.ini ./migrations.individual.mysql.test
  353. generate-ini-mysql8:
  354. sed -e 's|{{TEST_MYSQL8_HOST}}|${TEST_MYSQL8_HOST}|g' \
  355. -e 's|{{TEST_MYSQL8_DBNAME}}|${TEST_MYSQL8_DBNAME}|g' \
  356. -e 's|{{TEST_MYSQL8_USERNAME}}|${TEST_MYSQL8_USERNAME}|g' \
  357. -e 's|{{TEST_MYSQL8_PASSWORD}}|${TEST_MYSQL8_PASSWORD}|g' \
  358. -e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \
  359. integrations/mysql8.ini.tmpl > integrations/mysql8.ini
  360. .PHONY: test-mysql8
  361. test-mysql8: integrations.mysql8.test generate-ini-mysql8
  362. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mysql8.ini ./integrations.mysql8.test
  363. .PHONY: test-mysql8\#%
  364. test-mysql8\#%: integrations.mysql8.test generate-ini-mysql8
  365. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mysql8.ini ./integrations.mysql8.test -test.run $(subst .,/,$*)
  366. .PHONY: test-mysql8-migration
  367. test-mysql8-migration: migrations.mysql8.test migrations.individual.mysql8.test generate-ini-mysql8
  368. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mysql8.ini ./migrations.mysql8.test
  369. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mysql8.ini ./migrations.individual.mysql8.test
  370. generate-ini-pgsql:
  371. sed -e 's|{{TEST_PGSQL_HOST}}|${TEST_PGSQL_HOST}|g' \
  372. -e 's|{{TEST_PGSQL_DBNAME}}|${TEST_PGSQL_DBNAME}|g' \
  373. -e 's|{{TEST_PGSQL_USERNAME}}|${TEST_PGSQL_USERNAME}|g' \
  374. -e 's|{{TEST_PGSQL_PASSWORD}}|${TEST_PGSQL_PASSWORD}|g' \
  375. -e 's|{{TEST_PGSQL_SCHEMA}}|${TEST_PGSQL_SCHEMA}|g' \
  376. -e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \
  377. integrations/pgsql.ini.tmpl > integrations/pgsql.ini
  378. .PHONY: test-pgsql
  379. test-pgsql: integrations.pgsql.test generate-ini-pgsql
  380. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/pgsql.ini ./integrations.pgsql.test
  381. .PHONY: test-pgsql\#%
  382. test-pgsql\#%: integrations.pgsql.test generate-ini-pgsql
  383. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/pgsql.ini ./integrations.pgsql.test -test.run $(subst .,/,$*)
  384. .PHONY: test-pgsql-migration
  385. test-pgsql-migration: migrations.pgsql.test migrations.individual.pgsql.test generate-ini-pgsql
  386. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/pgsql.ini ./migrations.pgsql.test
  387. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/pgsql.ini ./migrations.individual.pgsql.test
  388. generate-ini-mssql:
  389. sed -e 's|{{TEST_MSSQL_HOST}}|${TEST_MSSQL_HOST}|g' \
  390. -e 's|{{TEST_MSSQL_DBNAME}}|${TEST_MSSQL_DBNAME}|g' \
  391. -e 's|{{TEST_MSSQL_USERNAME}}|${TEST_MSSQL_USERNAME}|g' \
  392. -e 's|{{TEST_MSSQL_PASSWORD}}|${TEST_MSSQL_PASSWORD}|g' \
  393. -e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \
  394. integrations/mssql.ini.tmpl > integrations/mssql.ini
  395. .PHONY: test-mssql
  396. test-mssql: integrations.mssql.test generate-ini-mssql
  397. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mssql.ini ./integrations.mssql.test
  398. .PHONY: test-mssql\#%
  399. test-mssql\#%: integrations.mssql.test generate-ini-mssql
  400. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mssql.ini ./integrations.mssql.test -test.run $(subst .,/,$*)
  401. .PHONY: test-mssql-migration
  402. test-mssql-migration: migrations.mssql.test migrations.individual.mssql.test generate-ini-mssql
  403. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mssql.ini ./migrations.mssql.test -test.failfast
  404. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mssql.ini ./migrations.individual.mssql.test -test.failfast
  405. .PHONY: bench-sqlite
  406. bench-sqlite: integrations.sqlite.test generate-ini-sqlite
  407. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
  408. .PHONY: bench-mysql
  409. bench-mysql: integrations.mysql.test generate-ini-mysql
  410. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mysql.ini ./integrations.mysql.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
  411. .PHONY: bench-mssql
  412. bench-mssql: integrations.mssql.test generate-ini-mssql
  413. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mssql.ini ./integrations.mssql.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
  414. .PHONY: bench-pgsql
  415. bench-pgsql: integrations.pgsql.test generate-ini-pgsql
  416. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/pgsql.ini ./integrations.pgsql.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
  417. .PHONY: integration-test-coverage
  418. integration-test-coverage: integrations.cover.test generate-ini-mysql
  419. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mysql.ini ./integrations.cover.test -test.coverprofile=integration.coverage.out
  420. .PHONY: integration-test-coverage-sqlite
  421. integration-test-coverage-sqlite: integrations.cover.sqlite.test generate-ini-sqlite
  422. GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/sqlite.ini ./integrations.cover.sqlite.test -test.coverprofile=integration.coverage.out
  423. integrations.mysql.test: git-check $(GO_SOURCES)
  424. $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations -o integrations.mysql.test
  425. integrations.mysql8.test: git-check $(GO_SOURCES)
  426. $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations -o integrations.mysql8.test
  427. integrations.pgsql.test: git-check $(GO_SOURCES)
  428. $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations -o integrations.pgsql.test
  429. integrations.mssql.test: git-check $(GO_SOURCES)
  430. $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations -o integrations.mssql.test
  431. integrations.sqlite.test: git-check $(GO_SOURCES)
  432. $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags '$(TEST_TAGS)'
  433. integrations.cover.test: git-check $(GO_SOURCES)
  434. $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(GO_PACKAGES) | tr ' ' ',') -o integrations.cover.test
  435. integrations.cover.sqlite.test: git-check $(GO_SOURCES)
  436. $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(GO_PACKAGES) | tr ' ' ',') -o integrations.cover.sqlite.test -tags '$(TEST_TAGS)'
  437. .PHONY: migrations.mysql.test
  438. migrations.mysql.test: $(GO_SOURCES)
  439. $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations/migration-test -o migrations.mysql.test
  440. .PHONY: migrations.mysql8.test
  441. migrations.mysql8.test: $(GO_SOURCES)
  442. $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations/migration-test -o migrations.mysql8.test
  443. .PHONY: migrations.pgsql.test
  444. migrations.pgsql.test: $(GO_SOURCES)
  445. $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations/migration-test -o migrations.pgsql.test
  446. .PHONY: migrations.mssql.test
  447. migrations.mssql.test: $(GO_SOURCES)
  448. $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations/migration-test -o migrations.mssql.test
  449. .PHONY: migrations.sqlite.test
  450. migrations.sqlite.test: $(GO_SOURCES)
  451. $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations/migration-test -o migrations.sqlite.test -tags '$(TEST_TAGS)'
  452. .PHONY: migrations.individual.mysql.test
  453. migrations.individual.mysql.test: $(GO_SOURCES)
  454. $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/models/migrations -o migrations.individual.mysql.test
  455. .PHONY: migrations.individual.mysql8.test
  456. migrations.individual.mysql8.test: $(GO_SOURCES)
  457. $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/models/migrations -o migrations.individual.mysql8.test
  458. .PHONY: migrations.individual.pgsql.test
  459. migrations.individual.pgsql.test: $(GO_SOURCES)
  460. $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/models/migrations -o migrations.individual.pgsql.test
  461. .PHONY: migrations.individual.mssql.test
  462. migrations.individual.mssql.test: $(GO_SOURCES)
  463. $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/models/migrations -o migrations.individual.mssql.test
  464. .PHONY: migrations.individual.sqlite.test
  465. migrations.individual.sqlite.test: $(GO_SOURCES)
  466. $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/models/migrations -o migrations.individual.sqlite.test -tags '$(TEST_TAGS)'
  467. .PHONY: check
  468. check: test
  469. .PHONY: install $(TAGS_PREREQ)
  470. install: $(wildcard *.go)
  471. CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) install -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)'
  472. .PHONY: build
  473. build: frontend backend
  474. .PHONY: frontend
  475. frontend: $(WEBPACK_DEST)
  476. .PHONY: backend
  477. backend: go-check generate $(EXECUTABLE)
  478. .PHONY: generate
  479. generate: $(TAGS_PREREQ)
  480. @echo "Running go generate..."
  481. @CC= GOOS= GOARCH= $(GO) generate -tags '$(TAGS)' $(GO_PACKAGES)
  482. $(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
  483. CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
  484. .PHONY: release
  485. release: frontend generate release-windows release-linux release-darwin release-copy release-compress vendor release-sources release-docs release-check
  486. $(DIST_DIRS):
  487. mkdir -p $(DIST_DIRS)
  488. .PHONY: release-windows
  489. release-windows: | $(DIST_DIRS)
  490. CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -buildmode exe -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) .
  491. ifeq (,$(findstring gogit,$(TAGS)))
  492. CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -buildmode exe -dest $(DIST)/binaries -tags 'netgo osusergo gogit $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION)-gogit .
  493. endif
  494. ifeq ($(CI),drone)
  495. cp /build/* $(DIST)/binaries
  496. endif
  497. .PHONY: release-linux
  498. release-linux: | $(DIST_DIRS)
  499. CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out gitea-$(VERSION) .
  500. ifeq ($(CI),drone)
  501. cp /build/* $(DIST)/binaries
  502. endif
  503. .PHONY: release-darwin
  504. release-darwin: | $(DIST_DIRS)
  505. CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin-10.12/amd64,darwin-10.12/arm64' -out gitea-$(VERSION) .
  506. ifeq ($(CI),drone)
  507. cp /build/* $(DIST)/binaries
  508. endif
  509. .PHONY: release-copy
  510. release-copy: | $(DIST_DIRS)
  511. cd $(DIST); for file in `find /build -type f -name "*"`; do cp $${file} ./release/; done;
  512. .PHONY: release-check
  513. release-check: | $(DIST_DIRS)
  514. cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "checksumming $${file}" && $(SHASUM) `echo $${file} | sed 's/^..//'` > $${file}.sha256; done;
  515. .PHONY: release-compress
  516. release-compress: | $(DIST_DIRS)
  517. cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && $(GO) run $(GXZ_PAGAGE) -k -9 $${file}; done;
  518. .PHONY: release-sources
  519. release-sources: | $(DIST_DIRS)
  520. echo $(VERSION) > $(STORED_VERSION_FILE)
  521. # bsdtar needs a ^ to prevent matching subdirectories
  522. $(eval EXCL := --exclude=$(shell tar --help | grep -q bsdtar && echo "^")./)
  523. # use transform to a add a release-folder prefix; in bsdtar the transform parameter equivalent is -s
  524. $(eval TRANSFORM := $(shell tar --help | grep -q bsdtar && echo "-s '/^./gitea-src-$(VERSION)/'" || echo "--transform 's|^./|gitea-src-$(VERSION)/|'"))
  525. tar $(addprefix $(EXCL),$(TAR_EXCLUDES)) $(TRANSFORM) -czf $(DIST)/release/gitea-src-$(VERSION).tar.gz .
  526. rm -f $(STORED_VERSION_FILE)
  527. .PHONY: release-docs
  528. release-docs: | $(DIST_DIRS) docs
  529. tar -czf $(DIST)/release/gitea-docs-$(VERSION).tar.gz -C ./docs/public .
  530. .PHONY: docs
  531. docs:
  532. @hash hugo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
  533. curl -sL https://github.com/gohugoio/hugo/releases/download/v0.74.3/hugo_0.74.3_Linux-64bit.tar.gz | tar zxf - -C /tmp && mv /tmp/hugo /usr/bin/hugo && chmod +x /usr/bin/hugo; \
  534. fi
  535. cd docs; make trans-copy clean build-offline;
  536. .PHONY: deps
  537. deps: deps-frontend deps-backend
  538. .PHONY: deps-frontend
  539. deps-frontend: node_modules
  540. .PHONY: deps-backend
  541. deps-backend:
  542. $(GO) mod download
  543. $(GO) install $(AIR_PACKAGE)
  544. $(GO) install $(EDITORCONFIG_CHECKER_PACKAGE)
  545. $(GO) install $(ERRCHECK_PACKAGE)
  546. $(GO) install $(GOFUMPT_PACKAGE)
  547. $(GO) install $(GOLANGCI_LINT_PACKAGE)
  548. $(GO) install $(GXZ_PAGAGE)
  549. $(GO) install $(MISSPELL_PACKAGE)
  550. $(GO) install $(SWAGGER_PACKAGE)
  551. $(GO) install $(XGO_PACKAGE)
  552. node_modules: package-lock.json
  553. npm install --no-save
  554. @touch node_modules
  555. .PHONY: npm-update
  556. npm-update: node-check | node_modules
  557. npx updates -cu
  558. rm -rf node_modules package-lock.json
  559. npm install --package-lock
  560. @touch node_modules
  561. .PHONY: fomantic
  562. fomantic:
  563. rm -rf $(FOMANTIC_WORK_DIR)/build
  564. cd $(FOMANTIC_WORK_DIR) && npm install --no-save
  565. cp -f $(FOMANTIC_WORK_DIR)/theme.config.less $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/theme.config
  566. cp -rf $(FOMANTIC_WORK_DIR)/_site $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/
  567. cp -f web_src/js/vendor/dropdown.js $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/definitions/modules
  568. cd $(FOMANTIC_WORK_DIR) && npx gulp -f node_modules/fomantic-ui/gulpfile.js build
  569. rm -f $(FOMANTIC_WORK_DIR)/build/*.min.*
  570. .PHONY: webpack
  571. webpack: $(WEBPACK_DEST)
  572. $(WEBPACK_DEST): $(WEBPACK_SOURCES) $(WEBPACK_CONFIGS) package-lock.json
  573. @$(MAKE) -s node-check node_modules
  574. rm -rf $(WEBPACK_DEST_ENTRIES)
  575. npx webpack
  576. @touch $(WEBPACK_DEST)
  577. .PHONY: svg
  578. svg: node-check | node_modules
  579. rm -rf $(SVG_DEST_DIR)
  580. node build/generate-svg.js
  581. .PHONY: svg-check
  582. svg-check: svg
  583. @git add $(SVG_DEST_DIR)
  584. @diff=$$(git diff --cached $(SVG_DEST_DIR)); \
  585. if [ -n "$$diff" ]; then \
  586. echo "Please run 'make svg' and 'git add $(SVG_DEST_DIR)' and commit the result:"; \
  587. echo "$${diff}"; \
  588. exit 1; \
  589. fi
  590. .PHONY: lockfile-check
  591. lockfile-check:
  592. npm install --package-lock-only
  593. @diff=$$(git diff package-lock.json); \
  594. if [ -n "$$diff" ]; then \
  595. echo "package-lock.json is inconsistent with package.json"; \
  596. echo "Please run 'npm install --package-lock-only' and commit the result:"; \
  597. echo "$${diff}"; \
  598. exit 1; \
  599. fi
  600. .PHONY: update-translations
  601. update-translations:
  602. mkdir -p ./translations
  603. cd ./translations && curl -L https://crowdin.com/download/project/gitea.zip > gitea.zip && unzip gitea.zip
  604. rm ./translations/gitea.zip
  605. $(SED_INPLACE) -e 's/="/=/g' -e 's/"$$//g' ./translations/*.ini
  606. $(SED_INPLACE) -e 's/\\"/"/g' ./translations/*.ini
  607. mv ./translations/*.ini ./options/locale/
  608. rmdir ./translations
  609. .PHONY: generate-license
  610. generate-license:
  611. GO111MODULE=on $(GO) run build/generate-licenses.go
  612. .PHONY: generate-gitignore
  613. generate-gitignore:
  614. GO111MODULE=on $(GO) run build/generate-gitignores.go
  615. .PHONY: generate-images
  616. generate-images: | node_modules
  617. npm install --no-save --no-package-lock fabric@4 imagemin-zopfli@7
  618. node build/generate-images.js $(TAGS)
  619. .PHONY: generate-manpage
  620. generate-manpage:
  621. @[ -f gitea ] || make backend
  622. @mkdir -p man/man1/ man/man5
  623. @./gitea docs --man > man/man1/gitea.1
  624. @gzip -9 man/man1/gitea.1 && echo man/man1/gitea.1.gz created
  625. @#TODO A smal script witch format config-cheat-sheet.en-us.md nicely to suit as config man page
  626. .PHONY: pr\#%
  627. pr\#%: clean-all
  628. $(GO) run contrib/pr/checkout.go $*
  629. .PHONY: golangci-lint
  630. golangci-lint:
  631. $(GO) run $(GOLANGCI_LINT_PACKAGE) run
  632. # workaround step for the lint-backend-windows CI task because 'go run' can not
  633. # have distinct GOOS/GOARCH for its build and run steps
  634. .PHONY: golangci-lint-windows
  635. golangci-lint-windows:
  636. @GOOS= GOARCH= $(GO) install $(GOLANGCI_LINT_PACKAGE)
  637. golangci-lint run
  638. .PHONY: editorconfig-checker
  639. editorconfig-checker:
  640. $(GO) run $(EDITORCONFIG_CHECKER_PACKAGE) templates
  641. .PHONY: docker
  642. docker:
  643. docker build --disable-content-trust=false -t $(DOCKER_REF) .
  644. # support also build args docker build --build-arg GITEA_VERSION=v1.2.3 --build-arg TAGS="bindata sqlite sqlite_unlock_notify" .
  645. .PHONY: docker-build
  646. docker-build:
  647. docker run -ti --rm -v "$(CURDIR):/srv/app/src/code.gitea.io/gitea" -w /srv/app/src/code.gitea.io/gitea -e TAGS="bindata $(TAGS)" LDFLAGS="$(LDFLAGS)" CGO_EXTRA_CFLAGS="$(CGO_EXTRA_CFLAGS)" webhippie/golang:edge make clean build
  648. # This endif closes the if at the top of the file
  649. endif