Update MANIFEST.
[ocaml-libvirt.git] / Makefile.in
1 # ocaml-libvirt
2 # Copyright (C) 2007 Red Hat Inc., Richard W.M. Jones
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
17
18 PACKAGE         = @PACKAGE_NAME@
19 VERSION         = @PACKAGE_VERSION@
20
21 INSTALL         = @INSTALL@
22
23 MAKENSIS        = @MAKENSIS@
24
25 OCAMLDOC        = @OCAMLDOC@
26 OCAMLDOCFLAGS   := -html -sort
27
28 SUBDIRS         = libvirt examples
29
30 all opt depend install-opt install-byte:
31         for d in $(SUBDIRS); do \
32           $(MAKE) -C $$d $@; \
33           if [ $$? -ne 0 ]; then exit 1; fi; \
34         done
35
36 clean:
37         for d in . $(SUBDIRS); do \
38           (cd $$d; rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so *.opt *~ *.dll *.exe core); \
39         done
40         rm -f examples/list_domains
41         rm -f examples/node_info
42         rm -f examples/get_cpu_stats
43         rm -f examples/domain_events
44
45 distclean: clean
46         rm -f config.h config.log config.status configure
47         rm -rf autom4te.cache
48         rm -f META
49         rm -f libvirt/libvirt_version.ml
50         rm -f Makefile
51         rm -f Make.rules
52         rm -f libvirt/Makefile
53         rm -f examples/Makefile
54
55 # Developer documentation (in html/ subdirectory).
56
57 ifneq ($(OCAMLDOC),)
58 doc:
59         rm -rf html
60         mkdir html
61         -cd libvirt; \
62         $(OCAMLDOC) $(OCAMLDOCFLAGS) -d ../html \
63           libvirt.{ml,mli} libvirt_version.{ml,mli}
64 endif
65
66 # Windows installer (requires NSIS).
67
68 WININSTALLER := $(PACKAGE)-$(VERSION).exe
69
70 ifneq ($(MAKENSIS),)
71 wininstaller: $(WININSTALLER)
72
73 $(WININSTALLER): wininstaller.nsis all opt
74         "$(MAKENSIS)" \
75           //DPACKAGE=$(PACKAGE) //DVERSION=$(VERSION) \
76           //DOUTFILE=$@ $<
77         ls -l $@
78 endif
79
80 # Update configure and rerun.
81
82 configure: force
83         autoreconf
84         CFLAGS=-g \
85           ./configure \
86           --enable-debug=yes --with-libvirt=/home/rjones/local
87
88 # Distribution.
89
90 dist: ChangeLog
91         $(MAKE) check-manifest
92         rm -rf $(PACKAGE)-$(VERSION)
93         mkdir $(PACKAGE)-$(VERSION)
94         tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
95         $(INSTALL) -m 0755 configure $(PACKAGE)-$(VERSION)/
96         tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
97         rm -rf $(PACKAGE)-$(VERSION)
98         ls -l $(PACKAGE)-$(VERSION).tar.gz
99
100 check-manifest:
101         git ls-files | sort > .check-manifest; \
102         sort MANIFEST > .orig-manifest; \
103         diff -u .orig-manifest .check-manifest; rv=$$?; \
104         rm -f .orig-manifest .check-manifest; \
105         exit $$rv
106
107 ChangeLog:
108         hg log --style changelog > $@.new
109         mv $@.new $@
110
111 # Do a release (update the website).
112
113 release: configure
114         $(MAKE) release_stage_2
115
116 release_stage_2: clean all opt doc dist
117         $(MAKE) release_stage_3
118
119 WEBSITE = ../redhat/websites
120
121 release_stage_3:
122         rm -f $(WEBSITE)/ocaml-libvirt/html/*.{html,css}
123         cp html/*.{html,css} $(WEBSITE)/ocaml-libvirt/html/
124         cp README $(WEBSITE)/ocaml-libvirt/README.txt
125         cp ChangeLog $(WEBSITE)/ocaml-libvirt/ChangeLog.txt
126
127 # Upload to main website.
128
129 upload:
130         cd $(WEBSITE)/ocaml-libvirt && \
131         scp ChangeLog.txt index.html README.txt Screenshot*.png \
132           libvirt.org:/data/www/libvirt.org/ocaml && \
133         scp css/*.css \
134           libvirt.org:/data/www/libvirt.org/ocaml/css/ && \
135         scp html/*.html html/*.css \
136           libvirt.org:/data/www/libvirt.org/ocaml/html/
137         scp $(PACKAGE)-$(VERSION).tar.gz libvirt.org:/data/ftp/libvirt/ocaml/
138
139 # Upload Windows binary installer to main website.
140
141 winupload:
142         scp $(WININSTALLER) libvirt.org:/data/ftp/libvirt/ocaml/
143
144 force:
145
146 .PHONY: all opt depend install clean distclean configure dist check-manifest \
147         release release_stage_2 release_stage_3 force