1 # use GNU Make to run tests in parallel, and without depending on Rubygems
5 GIT_URL
= git
://git.bogomips.org
/upr.git
7 GIT-VERSION-FILE
: .FORCE-GIT-VERSION-FILE
9 -include GIT-VERSION-FILE
13 $(warning ruby variable is deprecated
, use RUBY instead
)
17 ifeq ($(RUBY_VERSION
),)
18 RUBY_VERSION
:= $(shell $(RUBY
) -e
'puts RUBY_VERSION')
22 bins
:= $(addprefix bin
/, $(base_bins
))
28 cp
-p bin
/* .install-tmp
31 mv .install-tmp
/* bin
/
35 setup_rb_files
:= .config InstalledFiles
36 prep_setup_rb
:= @
-$(RM
) $(setup_rb_files
);$(MAKE
) -C
$(ext
) clean
39 -$(MAKE
) -C
$(ext
) clean
40 $(RM
) $(setup_rb_files
) $(t_log
)
42 pkg_extra
:= GIT-VERSION-FILE NEWS ChangeLog
43 manifest
: $(pkg_extra
)
49 for i in
$@
$(pkg_extra
); \
50 do echo
$$i; done
) | LC_ALL
=C
sort > $@
+
51 cmp
$@
+ $@ || mv
$@
+ $@
54 NEWS
: GIT-VERSION-FILE
55 $(rake
) -s news_rdoc
> $@
+
59 ChangeLog
: log_range
= $(shell test -n
"$(SINCE)" && echo v
$(SINCE
)..
)
60 ChangeLog
: GIT-VERSION-FILE
61 @echo
"ChangeLog from $(GIT_URL) ($(SINCE)..$(GIT_VERSION))" > $@
+
63 git log
$(log_range
) | sed
-e
's/^/ /' >> $@
+
66 news_atom
:= http
://upr.bogomips.org
/NEWS.atom.xml
67 cgit_atom
:= http
://git.bogomips.org
/cgit
/upr.git
/atom
/?h
=master
68 atom
= <link rel
="alternate" title
="Atom feed" href
="$(1)" \
69 type
="application/atom+xml"/>
72 doc
: .document NEWS ChangeLog
73 rdoc
-Na
-t
"$(shell sed -ne '1s/^= //p' README)"
74 install -m644 COPYING doc
/COPYING
75 install -m644
$(shell grep
'^[A-Z]' .document
) doc
/
77 '$$_.gsub!("</title>",%q{\&$(call atom,$(cgit_atom))})' \
80 '$$_.gsub!("</title>",%q{\&$(call atom,$(news_atom))})' \
81 doc
/NEWS.html doc
/README.html
82 $(rake
) -s news_atom
> doc
/NEWS.atom.xml
83 cd doc
&& ln README.html tmp
&& mv tmp index.html
88 pkggem
:= pkg
/$(rfpackage
)-$(VERSION
).gem
89 pkgtgz
:= pkg
/$(rfpackage
)-$(VERSION
).tgz
90 release_notes
:= release_notes-
$(VERSION
)
91 release_changes
:= release_changes-
$(VERSION
)
93 release-notes
: $(release_notes
)
94 release-changes
: $(release_changes
)
96 $(rake
) -s release_changes
> $@
+
97 $(VISUAL
) $@
+ && test -s
$@
+ && mv
$@
+ $@
99 GIT_URL
=$(GIT_URL
) $(rake
) -s release_notes
> $@
+
100 $(VISUAL
) $@
+ && test -s
$@
+ && mv
$@
+ $@
102 # ensures we're actually on the tagged $(VERSION), only used for release
104 test x
"$(shell umask)" = x0022
105 git rev-parse
--verify refs
/tags/v
$(VERSION
)^
{}
106 git diff-index
--quiet HEAD^
0
107 test `git rev-parse --verify HEAD^0` = \
108 `git rev-parse --verify refs/tags/v$(VERSION)^{}`
111 -git ls-tree
-r HEAD | awk
'/^100644 / {print $$NF}' | xargs chmod
644
112 -git ls-tree
-r HEAD | awk
'/^100755 / {print $$NF}' | xargs chmod
755
116 install-gem
: $(pkggem
)
117 gem
install $(CURDIR
)/$<
119 $(pkggem
): manifest fix-perms
120 gem build
$(rfpackage
).gemspec
124 $(pkgtgz
): distdir
= $(basename $@
)
125 $(pkgtgz
): HEAD
= v
$(VERSION
)
126 $(pkgtgz
): manifest fix-perms
127 @
test -n
"$(distdir)"
130 tar c
`cat .manifest` |
(cd
$(distdir
) && tar x
)
131 cd pkg
&& tar c
$(basename $(@F
)) | gzip
-9 > $(@F
)+
134 package
: $(pkgtgz
) $(pkggem
)
136 release
: verify package
$(release_notes
) $(release_changes
)
137 rubyforge add_release
-f
-n
$(release_notes
) -a
$(release_changes
) \
138 $(rfproject
) $(rfpackage
) $(VERSION
) $(pkggem
)
140 $(rfproject
) $(rfpackage
) $(VERSION
) $(pkgtgz
)
142 gem install-gem
: GIT-VERSION-FILE
143 $(MAKE
) $@ VERSION
=$(GIT_VERSION
)
150 .PHONY
: .FORCE-GIT-VERSION-FILE doc manifest
test