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_unit
:= $(wildcard test/test_
*.rb
)
26 test-unit
: $(test_unit
)
28 ifeq ($(CLOGGER_PURE
),)
29 $(test_unit
): export RUBYLIB
:= ext
/clogger_ext
:lib
30 $(test_unit
): ext
/clogger_ext
/clogger.
$(DLEXT
)
32 $(test_unit
): export RUBYLIB
:= lib
42 CLOGGER_PURE
=t
$(MAKE
) test-unit
44 test: test-ext test-pure
46 pkg_extra
:= GIT-VERSION-FILE NEWS ChangeLog
47 manifest
: $(pkg_extra
)
53 for i in
$@
$(pkg_extra
); \
54 do echo
$$i; done
) | LC_ALL
=C
sort > $@
+
55 cmp
$@
+ $@ || mv
$@
+ $@
58 NEWS
: GIT-VERSION-FILE .manifest
59 $(RAKE
) -s news_rdoc
> $@
+
63 ChangeLog
: log_range
= $(shell test -n
"$(SINCE)" && echo v
$(SINCE
)..
)
64 ChangeLog
: GIT-VERSION-FILE
65 @echo
"ChangeLog from $(GIT_URL) ($(SINCE)..$(GIT_VERSION))" > $@
+
67 git log
$(log_range
) | sed
-e
's/^/ /' >> $@
+
70 news_atom
:= http
://clogger.rubyforge.org
/NEWS.atom.xml
71 cgit_atom
:= http
://git.bogomips.org
/cgit
/clogger.git
/atom
/?h
=master
72 atom
= <link rel
="alternate" title
="Atom feed" href
="$(1)" \
73 type
="application/atom+xml"/>
75 doc
: .document NEWS ChangeLog
76 rdoc
-a
-t
"$(shell sed -ne '1s/^= //p' README)"
77 install -m644 COPYING doc
/COPYING
78 install -m644
$(shell grep
'^[A-Z]' .document
) doc
/
80 '$$_.gsub!("</title>",%q{\&$(call atom,$(cgit_atom))})' \
83 '$$_.gsub!("</title>",%q{\&$(call atom,$(news_atom))})' \
84 doc
/NEWS.html doc
/README.html
85 $(RAKE
) -s news_atom
> doc
/NEWS.atom.xml
86 cd doc
&& ln README.html tmp
&& mv tmp index.html
88 # publishes docs to http://clogger.rubyforge.org/
89 # this preserves timestamps as best as possible to help HTTP caches out
90 # git set-file-times is here: http://git-scm.org/gitwiki/ExampleScripts
95 rsync
-av doc
/ rubyforge.org
:/var
/www
/gforge-projects
/clogger
/
96 git ls-files | xargs touch
101 pkggem
:= pkg
/$(rfpackage
)-$(VERSION
).gem
102 pkgtgz
:= pkg
/$(rfpackage
)-$(VERSION
).tgz
103 release_notes
:= release_notes-
$(VERSION
)
104 release_changes
:= release_changes-
$(VERSION
)
106 release-notes
: $(release_notes
)
107 release-changes
: $(release_changes
)
109 $(RAKE
) -s release_changes
> $@
+
110 $(VISUAL
) $@
+ && test -s
$@
+ && mv
$@
+ $@
112 GIT_URL
=$(GIT_URL
) $(RAKE
) -s release_notes
> $@
+
113 $(VISUAL
) $@
+ && test -s
$@
+ && mv
$@
+ $@
115 # ensures we're actually on the tagged $(VERSION), only used for release
117 test x
"$(shell umask)" = x0022
118 git rev-parse
--verify refs
/tags/v
$(VERSION
)^
{}
119 git diff-index
--quiet HEAD^
0
120 test `git rev-parse --verify HEAD^0` = \
121 `git rev-parse --verify refs/tags/v$(VERSION)^{}`
124 -git ls-tree
-r HEAD | awk
'/^100644 / {print $$NF}' | xargs chmod
644
125 -git ls-tree
-r HEAD | awk
'/^100755 / {print $$NF}' | xargs chmod
755
129 install-gem
: $(pkggem
)
130 gem
install $(CURDIR
)/$<
132 $(pkggem
): manifest fix-perms
133 gem build
$(rfpackage
).gemspec
137 $(pkgtgz
): distdir
= $(basename $@
)
138 $(pkgtgz
): HEAD
= v
$(VERSION
)
139 $(pkgtgz
): manifest fix-perms
140 @
test -n
"$(distdir)"
143 tar c
`cat .manifest` |
(cd
$(distdir
) && tar x
)
144 cd pkg
&& tar c
$(basename $(@F
)) | gzip
-9 > $(@F
)+
147 package
: $(pkgtgz
) $(pkggem
)
149 release
: verify package
$(release_notes
) $(release_changes
)
150 rubyforge add_release
-f
-n
$(release_notes
) -a
$(release_changes
) \
151 $(rfproject
) $(rfpackage
) $(VERSION
) $(pkgtgz
)
154 $(rfproject
) $(rfpackage
) $(VERSION
) $(pkggem
)
156 gem install-gem
: GIT-VERSION-FILE
157 $(MAKE
) $@ VERSION
=$(GIT_VERSION
)
160 .PHONY
: .FORCE-GIT-VERSION-FILE
test doc manifest
161 .PHONY
: test test-ext test-pure
$(test_unit
)