4 GIT_URL
= git
://git.bogomips.org
/clogger.git
6 GIT-VERSION-FILE
: .FORCE-GIT-VERSION-FILE
8 -include GIT-VERSION-FILE
11 ifeq ($(DLEXT
),) # "so" for Linux
12 DLEXT
:= $(shell $(RUBY
) -rrbconfig
-e
'puts Config::CONFIG["DLEXT"]')
15 ext
/clogger_ext
/Makefile
: ext
/clogger_ext
/clogger.c ext
/clogger_ext
/extconf.rb
16 cd ext
/clogger_ext
&& $(RUBY
) extconf.rb
18 ext
/clogger_ext
/clogger.
$(DLEXT
): ext
/clogger_ext
/Makefile
19 $(MAKE
) -C ext
/clogger_ext
22 -$(MAKE
) -C ext
/clogger_ext
clean
23 $(RM
) ext
/clogger_ext
/Makefile lib
/clogger_ext.
$(DLEXT
)
25 test-ext
: ext
/clogger_ext
/clogger.
$(DLEXT
)
26 $(RUBY
) -Iext
/clogger_ext
:lib
test/test_clogger.rb
29 CLOGGER_PURE
=t
$(RUBY
) -Ilib
test/test_clogger.rb
31 test: test-ext test-pure
33 pkg_extra
:= GIT-VERSION-FILE NEWS ChangeLog
34 manifest
: $(pkg_extra
)
40 for i in
$@
$(pkg_extra
); \
41 do echo
$$i; done
) | LC_ALL
=C
sort > $@
+
42 cmp
$@
+ $@ || mv
$@
+ $@
45 NEWS
: GIT-VERSION-FILE .manifest
46 $(RAKE
) -s news_rdoc
> $@
+
50 ChangeLog
: log_range
= $(shell test -n
"$(SINCE)" && echo v
$(SINCE
)..
)
51 ChangeLog
: GIT-VERSION-FILE
52 @echo
"ChangeLog from $(GIT_URL) ($(SINCE)..$(GIT_VERSION))" > $@
+
54 git log
$(log_range
) | sed
-e
's/^/ /' >> $@
+
57 news_atom
:= http
://clogger.rubyforge.org
/NEWS.atom.xml
58 cgit_atom
:= http
://git.bogomips.org
/cgit
/clogger.git
/atom
/?h
=master
59 atom
= <link rel
="alternate" title
="Atom feed" href
="$(1)" \
60 type
="application/atom+xml"/>
62 doc
: .document NEWS ChangeLog
63 rdoc
-Na
-t
"$(shell sed -ne '1s/^= //p' README)"
64 install -m644 COPYING doc
/COPYING
65 install -m644
$(shell grep
'^[A-Z]' .document
) doc
/
67 '$$_.gsub!("</title>",%q{\&$(call atom,$(cgit_atom))})' \
70 '$$_.gsub!("</title>",%q{\&$(call atom,$(news_atom))})' \
71 doc
/NEWS.html doc
/README.html
72 $(RAKE
) -s news_atom
> doc
/NEWS.atom.xml
73 cd doc
&& ln README.html tmp
&& mv tmp index.html
75 # publishes docs to http://clogger.rubyforge.org/
76 # this preserves timestamps as best as possible to help HTTP caches out
77 # git set-file-times is here: http://git-scm.org/gitwiki/ExampleScripts
82 rsync
-av doc
/ rubyforge.org
:/var
/www
/gforge-projects
/clogger
/
83 git ls-files | xargs touch
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
) $(pkgtgz
)
141 $(rfproject
) $(rfpackage
) $(VERSION
) $(pkggem
)
143 gem install-gem
: GIT-VERSION-FILE
144 $(MAKE
) $@ VERSION
=$(GIT_VERSION
)
147 .PHONY
: .FORCE-GIT-VERSION-FILE
test doc manifest