2 # Copyright (C) 2007 Red Hat Inc., Richard W.M. Jones
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.
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.
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
18 PACKAGE = @PACKAGE_NAME@
19 VERSION = @PACKAGE_VERSION@
26 OCAMLDOCFLAGS := -html -sort
28 SUBDIRS = libvirt examples
30 all opt depend install-opt install-byte:
31 for d in $(SUBDIRS); do \
33 if [ $$? -ne 0 ]; then exit 1; fi; \
37 for d in . $(SUBDIRS); do \
38 (cd $$d; rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so *.opt *~ *.dll *.exe core); \
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 rm -f examples/get_all_domain_stats
47 rm -f config.h config.log config.status configure
50 rm -f libvirt/libvirt_version.ml
53 rm -f libvirt/Makefile
54 rm -f examples/Makefile
56 # Developer documentation (in html/ subdirectory).
63 $(OCAMLDOC) $(OCAMLDOCFLAGS) -d ../html \
64 libvirt.{ml,mli} libvirt_version.{ml,mli}
67 # Windows installer (requires NSIS).
69 WININSTALLER := $(PACKAGE)-$(VERSION).exe
72 wininstaller: $(WININSTALLER)
74 $(WININSTALLER): wininstaller.nsis all opt
76 //DPACKAGE=$(PACKAGE) //DVERSION=$(VERSION) \
81 # Update configure and rerun.
87 --enable-debug=yes --with-libvirt=/home/rjones/local
92 $(MAKE) check-manifest
93 rm -rf $(PACKAGE)-$(VERSION)
94 mkdir $(PACKAGE)-$(VERSION)
95 tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
96 $(INSTALL) -m 0755 configure $(PACKAGE)-$(VERSION)/
97 tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
98 rm -rf $(PACKAGE)-$(VERSION)
99 ls -l $(PACKAGE)-$(VERSION).tar.gz
102 git ls-files | sort > .check-manifest; \
103 sort MANIFEST > .orig-manifest; \
104 diff -u .orig-manifest .check-manifest; rv=$$?; \
105 rm -f .orig-manifest .check-manifest; \
109 hg log --style changelog > $@.new
112 # Do a release (update the website).
115 $(MAKE) release_stage_2
117 release_stage_2: clean all opt doc dist
118 $(MAKE) release_stage_3
120 WEBSITE = ../redhat/websites
123 rm -f $(WEBSITE)/ocaml-libvirt/html/*.{html,css}
124 cp html/*.{html,css} $(WEBSITE)/ocaml-libvirt/html/
125 cp README $(WEBSITE)/ocaml-libvirt/README.txt
126 cp ChangeLog $(WEBSITE)/ocaml-libvirt/ChangeLog.txt
128 # Upload to main website.
131 cd $(WEBSITE)/ocaml-libvirt && \
132 scp ChangeLog.txt index.html README.txt Screenshot*.png \
133 libvirt.org:/data/www/libvirt.org/ocaml && \
135 libvirt.org:/data/www/libvirt.org/ocaml/css/ && \
136 scp html/*.html html/*.css \
137 libvirt.org:/data/www/libvirt.org/ocaml/html/
138 scp $(PACKAGE)-$(VERSION).tar.gz libvirt.org:/data/ftp/libvirt/ocaml/
140 # Upload Windows binary installer to main website.
143 scp $(WININSTALLER) libvirt.org:/data/ftp/libvirt/ocaml/
147 .PHONY: all opt depend install clean distclean configure dist check-manifest \
148 release release_stage_2 release_stage_3 force