c1a9f5620d4430b78513a0e377eb02fe1c4a0fb1
[virt-top.git] / Makefile.in
1 # virt-top
2 # Copyright (C) 2007-2008 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 SUBDIRS         = virt-top
26
27 all opt depend install:
28         for d in $(SUBDIRS); do \
29           $(MAKE) -C $$d $@; \
30           if [ $$? -ne 0 ]; then exit 1; fi; \
31         done
32
33 clean:
34         for d in . $(SUBDIRS); do \
35           (cd $$d; rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so *.opt *~ *.dll *.exe core); \
36         done
37         rm -f virt-top/virt-top
38
39 distclean: clean
40         rm -f config.h config.log config.status configure
41         rm -rf autom4te.cache
42         rm -f Makefile
43         rm -f virt-top/Makefile
44
45 # Windows installer (requires NSIS).
46
47 WININSTALLER := $(PACKAGE)-$(VERSION).exe
48
49 ifneq ($(MAKENSIS),)
50 wininstaller: $(WININSTALLER)
51
52 $(WININSTALLER): wininstaller.nsis all opt
53         "$(MAKENSIS)" \
54           //DPACKAGE=$(PACKAGE) //DVERSION=$(VERSION) \
55           //DOUTFILE=$@ $<
56         ls -l $@
57 endif
58
59 # Distribution.
60
61 dist: ChangeLog
62         $(MAKE) check-manifest
63         rm -rf $(PACKAGE)-$(VERSION)
64         mkdir $(PACKAGE)-$(VERSION)
65         tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
66         $(INSTALL) -m 0755 configure $(PACKAGE)-$(VERSION)/
67         tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
68         rm -rf $(PACKAGE)-$(VERSION)
69         ls -l $(PACKAGE)-$(VERSION).tar.gz
70
71 check-manifest:
72         git ls-files | sort > .check-manifest; \
73         sort MANIFEST > .orig-manifest; \
74         diff -u .orig-manifest .check-manifest; rv=$$?; \
75         rm -f .orig-manifest .check-manifest; \
76         exit $$rv
77
78 ChangeLog: $(shell find -type f)
79         ./gitlog-to-changelog > $@.new
80         mv $@.new $@
81
82 .PHONY: all opt depend install clean distclean force