add rule to generate html help
[opensuse:supportability-analysis-module.git] / Makefile
1
2 srcdir          = .
3 VERSION         = $(shell cat $(srcdir)/VERSION)
4 packdir         = package
5 packname        = suse-sam
6 datapackname    = $(packname)-data
7
8 DATA=data/*
9
10
11 .PHONY: all package $(packname) $(packname)-data
12
13 $(packdir)/%.spec: %.spec.in
14         sed -e "s/@VERSION@/$(VERSION)/g" < $< > $@
15
16 all:                    package
17
18 package:                $(packname) $(packname)-data
19
20 $(packname):            $(packdir)/$(packname)-$(VERSION).tar.bz2 $(packdir)/$(packname).spec
21
22 $(packname)-data:       $(packdir)/$(packname)-data-$(VERSION).tar.bz2 $(packdir)/$(packname)-data.spec
23
24 $(packdir)/$(packname)-$(VERSION).tar.bz2: Makefile VERSION COPYING sam
25         rm -f $(packdir)/$(packname)-[0-9]*.tar.bz2
26         rm -f $(packdir)/*~
27         rm -f $(packdir)/*.bak
28         rm -f $(packdir)/*.orig
29         rm -rf $(packdir)/$(packname)
30         mkdir $(packdir)/$(packname)
31         cp -p COPYING $(packdir)/$(packname)
32         cp -p sam $(packdir)/$(packname)
33         cp -p sam.1 $(packdir)/$(packname)
34         sed -e "s/@VERSION@/$(VERSION)/g" < sam > $(packdir)/$(packname)/sam
35         tar cCf $(packdir) - $(packname) | bzip2 -9 -c > $@
36         rm -rf $(packdir)/$(packname)
37
38 $(packdir)/$(packname).spec: Makefile VERSION $(packname).spec.in
39
40 $(packdir)/$(datapackname)-$(VERSION).tar.bz2: Makefile VERSION COPYING collect-product-metadata $(DATA)
41         rm -f $(packdir)/$(datapackname)-[0-9]*.tar.bz2
42         rm -f $(packdir)/*~
43         rm -f $(packdir)/*.bak
44         rm -f $(packdir)/*.orig
45         rm -rf $(packdir)/$(datapackname)
46         mkdir $(packdir)/$(datapackname)
47         cp -p COPYING $(packdir)/$(datapackname)
48         cp -a data $(packdir)/$(datapackname)
49         cp -p collect-product-metadata $(packdir)/$(datapackname)
50         sed -e "s/@VERSION@/$(VERSION)/g" < collect-product-metadata > $(packdir)/$(datapackname)/collect-product-metadata
51         tar cCf $(packdir) - $(datapackname) | bzip2 -9 -c > $@
52         rm -rf $(packdir)/$(datapackname)
53
54 $(packdir)/$(packname)-data.spec: Makefile VERSION $(packname)-data.spec.in
55
56 man:
57         pod2man --center 'SAM Documentation' --release `cat ./VERSION ` --section 1 sam > sam.1
58
59 html:
60         # not very clean yet ...
61         pod2html --title "SAM "`cat ./VERSION ` --infile=sam --outfile=sam.html