-
-
Notifications
You must be signed in to change notification settings - Fork 103
/
Copy pathMakefile.am
138 lines (105 loc) · 3.74 KB
/
Makefile.am
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = \
LICENSE \
README.md \
INSTALL \
configure.rb \
vendor/vendorize \
ext/gitsh/extconf.rb \
ext/gitsh/src/line_editor.c \
src/gitsh.rb.in \
lib/gitsh/version.rb.in \
man/man1/gitsh.1.in \
man/man5/gitsh_completions.5.in
bin_PROGRAMS = gitsh
gitsh_SOURCES = src/gitsh.c
gitsh_CPPFLAGS = $(RUBY_CFLAGS) \
-DGITSH_RB_PATH="\"$(rubydir)/$(PACKAGE).rb\""
gitsh_LDFLAGS = $(RUBY_LIBS)
LDADD = $(RUBY_LDADD)
man_MANS = man/man1/gitsh.1 man/man5/gitsh_completions.5
nobase_dist_pkgdata_DATA = $(vendorfiles)
nobase_dist_ruby_DATA = $(libfiles)
pkgrubylib_DATA = lib/gitsh/version.rb
ruby_DATA = src/gitsh.rb
dist_pkgsysconf_DATA = etc/completions
CLEANFILES = src/gitsh.rb lib/gitsh/version.rb
substitute_values = sed \
-e 's|@RUBY[@]|$(RUBY)|g' \
-e 's|@rubylibdir[@]|$(rubylibdir)|g' \
-e 's|@pkgsysconfdir[@]|$(pkgsysconfdir)|g' \
-e 's|@gemsetuppath[@]|$(gemsetuppath)|g' \
-e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g'
src/gitsh.rb: Makefile src/gitsh.rb.in
$(substitute_values) $(srcdir)/$@.in > $@
lib/gitsh/version.rb: Makefile lib/gitsh/version.rb.in
$(substitute_values) $(srcdir)/$@.in > $@
all-local:
cd ext/gitsh && $(MAKE)
clean-local:
cd ext/gitsh && $(MAKE) clean
install-data-local:
mkdir -p "$(DESTDIR)$(pkgrubylibdir)"
cp ext/gitsh/line_editor_native.* "$(DESTDIR)$(pkgrubylibdir)"
distclean-local:
rm -rf vendor/gems
rm -f ext/gitsh/Makefile
man/man1/gitsh.1: Makefile man/man1/gitsh.1.in
$(substitute_values) $(srcdir)/$@.in > $@
man/man5/gitsh_completions.5: Makefile man/man5/gitsh_completions.5.in
$(substitute_values) $(srcdir)/$@.in > $@
# Test
TESTS = $(testfiles)
TEST_EXTENSIONS = .rb
RB_LOG_COMPILER = bundle exec rspec
AM_RB_LOG_FLAGS = -I $(abs_top_builddir)/spec -I $(abs_top_builddir)/lib
# Release
.PHONY: release \
release_build release_push release_clean \
release_build_tarball release_build_homebrew release_build_arch \
release_push_tarball release_push_homebrew release_push_arch \
release_clean_tarball release_clean_homebrew release_clean_arch
substitute_package_values = sed \
-e 's|@PACKAGE[@]|$(PACKAGE)|g' \
-e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \
-e 's|@DIST_ARCHIVES[@]|$(DIST_ARCHIVES)|g' \
-e 's|@DIST_SHA[@]|$(DIST_SHA)|g'
release: release_build release_push release_clean
release_build: release_build_tarball release_build_homebrew release_build_arch
release_push: release_push_tarball release_push_homebrew release_push_arch
release_clean: release_clean_tarball release_clean_homebrew release_clean_arch
release_build_tarball: Makefile dist
git clone --branch gh-pages git@github.com:thoughtbot/gitsh.git gh-pages
cp $(DIST_ARCHIVES) gh-pages
cd gh-pages &&\
git add $(DIST_ARCHIVES) &&\
git commit -m "Release version $(PACKAGE_VERSION)"
release_push_tarball:
cd gh-pages &&\
git push
release_clean_tarball:
rm -rf gh-pages
release_build_homebrew: DIST_SHA
git clone git@github.com:thoughtbot/homebrew-formulae.git homebrew-formulae
$(substitute_package_values) homebrew/gitsh.rb.in > homebrew-formulae/Formula/gitsh.rb
cd homebrew-formulae &&\
git commit -am "gitsh: Release version $(PACKAGE_VERSION)"
release_push_homebrew:
cd homebrew-formulae &&\
git push
release_clean_homebrew:
rm -rf homebrew-formulae
release_build_arch: DIST_SHA
git clone --branch master git@github.com:thoughtbot/gitsh.git release-arch
cd release-arch &&\
$(substitute_package_values) arch/PKGBUILD.in > arch/PKGBUILD &&\
git commit -m "Arch package for version $(PACKAGE_VERSION)" -- arch/PKGBUILD &&\
git tag v$(PACKAGE_VERSION)
release_push_arch:
cd release-arch &&\
git push --tags &&\
git push
release_clean_arch:
rm -rf release-arch
DIST_SHA: Makefile dist
$(eval DIST_SHA := $(shell shasum -a 256 $(srcdir)/$(DIST_ARCHIVES) | cut -d' ' -f1))