This repository has been archived by the owner on Dec 4, 2023. It is now read-only.
forked from mysql-otp/mysql-otp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (57 loc) · 2.28 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
59
60
61
62
63
64
65
# MySQL/OTP
#
# This Makefile should be complete enough for this project to be used as an
# erlang.mk dependency.
#
# Additional targets:
#
# - tests-report: Creates doc/eunit.html with the coverage and eunit output.
# - gh-pages: Generates docs and eunit reports and commits these in the
# gh-pages which Github publishes automatically when pushed.
# - CHANGELOG.md: Generates a changelog from the git commits and tags.
.PHONY: gh-pages tests-report tests-prep CHANGELOG.md
PROJECT = mysql
EDOC_OPTS = {stylesheet_file,"priv/edoc-style.css"},{todo,true}
EUNIT_OPTS = {verbose,true}
PLT_APPS = crypto ssl inets public_key
SHELL_PATH = -pa ebin
ERLANG_MK_BUILD_CONFIG = erlang-mk.build.config
include erlang.mk
# Generate keys for SSL tests. Requires configuring and restarting MySQL.
tests-prep:
$(MAKE) -C test/ssl
distclean::
$(MAKE) -C test/ssl clean
CHANGELOG.md:
./changelog.sh > $@
# Update the local 'gh-pages' branch with pregenerated output files
# (trick from https://groups.google.com/forum/#!topic/github/XYxkdzxpgCo)
gh-pages: docs tests-report
@if [ $$(git name-rev --name-only HEAD) != master ] ; then \
echo "Not on master. Aborting." ; \
false ; \
fi
@git update-ref refs/heads/gh-pages origin/gh-pages '' 2>/dev/null || true
@GIT_INDEX_FILE=gitindex.tmp; export GIT_INDEX_FILE; \
rm -f $${GIT_INDEX_FILE} && \
git add -f doc/*.html doc/stylesheet.css doc/erlang.png && \
git update-ref refs/heads/gh-pages \
$$(echo "Autogenerated html pages for $$(git describe --tags)" \
| git commit-tree $$(git write-tree --prefix=doc) \
-p refs/heads/gh-pages)
@rm gitindex.tmp
@echo "Committed $$(git describe --tags) in the gh-pages branch."
# Build eunit.html containing the coverage report and the test output in the
# doc directory.
tests-report: test_command=$(MAKE) --no-print-directory tests COVER=1 \
COVER_REPORT_DIR=
tests-report:
@rm -f cover/*.html
@$(test_command) | tee tests.output
@$(MAKE) --no-print-directory cover-report
@(cat cover/index.html | sed 's!</body></html>!!' ; \
echo '<h3>Output of <code>$(test_command)</code></h3><pre>' ; \
sed 's/&/\&/g; s/</\</g; s/>/\>/g;' tests.output ; \
echo '</pre>' ; \
echo '</body></html>') > doc/eunit.html
@cp cover/*.COVER.html doc/