-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
58 lines (45 loc) · 1.45 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
PROJECT_NAME := amazonka-contrib-rds-utils
# https://www.gnu.org/software/make/manual/html_node/Special-Variables.html
# https://ftp.gnu.org/old-gnu/Manuals/make-3.80/html_node/make_17.html
PROJECT_MKFILE_PATH := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
PROJECT_MKFILE_DIR := $(shell cd $(shell dirname $(PROJECT_MKFILE_PATH)); pwd)
PROJECT_ROOT := $(PROJECT_MKFILE_DIR)
DISTRIBUTIONS := $(PROJECT_MKFILE_DIR)/dist-newstyle/sdist
$(PROJECT_ROOT)/cabal.project.local:
cabal v2-update
cabal v2-configure
build: $(PROJECT_ROOT)/src \
$(PROJECT_ROOT)/$(PROJECT_NAME).cabal \
$(PROJECT_ROOT)/cabal.project.local
cabal v2-build
.PHONY: run
run:
cabal v2-run generate-db-auth-token -- --help
.PHONY: run-example
run-example:
AWS_ACCESS_KEY_ID=111 AWS_SECRET_ACCESS_KEY=222 \
cabal v2-run \
generate-db-auth-token -- \
--hostname example-host.com \
--port 6543 \
--username example_user \
--region eu-west-2
cabal v2-run \
generate-db-auth-token -- \
--discover \
--hostname example-host.com \
--port 6543 \
--username example_user \
--region eu-west-2
.PHONY: distribute
distribute:
cabal v2-sdist
.PHONY: publish
publish: | cleanall distribute
cabal upload $(DISTRIBUTIONS)/$(PROJECT_NAME)-*.tar.gz
.PHONY: release
release:
cabal upload $(DISTRIBUTIONS)/$(PROJECT_NAME)-*.tar.gz --publish
.PHONY: cleanall
cleanall:
rm -r $(DISTRIBUTIONS)