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
): mylib
:= ext
/clogger_ext
:lib
30 $(test_unit
): ext
/clogger_ext
/clogger.
$(DLEXT
)
32 $(test_unit
): mylib
:= lib
36 $(RUBY
) -I
$(mylib
) $@
39 CLOGGER_PURE
= $(MAKE
) test-unit
42 CLOGGER_PURE
=1 $(MAKE
) test-unit
44 test: test-ext test-pure
46 pkg_extra
:= GIT-VERSION-FILE NEWS ChangeLog LATEST
47 manifest
: $(pkg_extra
)
53 for i in
$@
$(pkg_extra
); \
54 do echo
$$i; done
) | LC_ALL
=C
sort > $@
+
55 cmp
$@
+ $@ || mv
$@
+ $@
58 ChangeLog
: GIT-VERSION-FILE .wrongdoc.yml
61 doc
: .document .wrongdoc.yml
62 find lib ext
-type f
-name
'*.rbc' -exec
rm -f
'{}' ';'
65 install -m644 COPYING doc
/COPYING
66 install -m644
$(shell grep
'^[A-Z]' .document
) doc
/
68 # publishes docs to http://clogger.rubyforge.org/
69 # this preserves timestamps as best as possible to help HTTP caches out
70 # git set-file-times is here: http://git-scm.org/gitwiki/ExampleScripts
74 -find doc
/images
-type f | \
75 TZ
=UTC xargs touch
-d
'1970-01-01 00:00:03' doc
/rdoc.css
76 $(RSYNC
) -av doc
/ rubyforge.org
:/var
/www
/gforge-projects
/clogger
/
77 git ls-files | xargs touch
82 pkggem
:= pkg
/$(rfpackage
)-$(VERSION
).gem
83 pkgtgz
:= pkg
/$(rfpackage
)-$(VERSION
).tgz
84 release_notes
:= release_notes-
$(VERSION
)
85 release_changes
:= release_changes-
$(VERSION
)
87 release-notes
: $(release_notes
)
88 release-changes
: $(release_changes
)
90 wrongdoc release_changes
> $@
+
91 $(VISUAL
) $@
+ && test -s
$@
+ && mv
$@
+ $@
93 wrongdoc release_notes
> $@
+
94 $(VISUAL
) $@
+ && test -s
$@
+ && mv
$@
+ $@
96 # ensures we're actually on the tagged $(VERSION), only used for release
98 test x
"$(shell umask)" = x0022
99 git rev-parse
--verify refs
/tags/v
$(VERSION
)^
{}
100 git diff-index
--quiet HEAD^
0
101 test `git rev-parse --verify HEAD^0` = \
102 `git rev-parse --verify refs/tags/v$(VERSION)^{}`
105 -git ls-tree
-r HEAD | awk
'/^100644 / {print $$NF}' | xargs chmod
644
106 -git ls-tree
-r HEAD | awk
'/^100755 / {print $$NF}' | xargs chmod
755
110 install-gem
: $(pkggem
)
111 gem
install $(CURDIR
)/$<
113 $(pkggem
): manifest fix-perms
114 gem build
$(rfpackage
).gemspec
118 $(pkgtgz
): distdir
= $(basename $@
)
119 $(pkgtgz
): HEAD
= v
$(VERSION
)
120 $(pkgtgz
): manifest fix-perms
121 @
test -n
"$(distdir)"
124 tar cf
- `cat .manifest` |
(cd
$(distdir
) && tar xf
-)
125 cd pkg
&& tar cf
- $(basename $(@F
)) | gzip
-9 > $(@F
)+
128 package
: $(pkgtgz
) $(pkggem
)
130 release
: verify package
$(release_notes
) $(release_changes
)
131 rubyforge add_release
-f
-n
$(release_notes
) -a
$(release_changes
) \
132 $(rfproject
) $(rfpackage
) $(VERSION
) $(pkgtgz
)
135 $(rfproject
) $(rfpackage
) $(VERSION
) $(pkggem
)
136 $(RAKE
) publish_news VERSION
=$(VERSION
)
138 gem install-gem
: GIT-VERSION-FILE
139 $(MAKE
) $@ VERSION
=$(GIT_VERSION
)
142 .PHONY
: .FORCE-GIT-VERSION-FILE
test doc manifest
143 .PHONY
: test test-ext test-pure
$(test_unit
)