'make install' installs programs and man pages
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 10 Jun 2008 14:24:19 +0000 (15:24 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Tue, 10 Jun 2008 14:24:19 +0000 (15:24 +0100)
Makefile.in
dmesg/Makefile.in
lib/Makefile.in
uname/Makefile.in

index 192b027..84461c4 100644 (file)
@@ -20,31 +20,40 @@ PACKAGE             = @PACKAGE_NAME@
 VERSION                = @PACKAGE_VERSION@
 
 INSTALL                = @INSTALL@
 VERSION                = @PACKAGE_VERSION@
 
 INSTALL                = @INSTALL@
+datarootdir    = @datarootdir@
+mandir         = @mandir@
 
 HAVE_PERLDOC    = @HAVE_PERLDOC@
 
 TOOLS          = uname dmesg
 
 
 HAVE_PERLDOC    = @HAVE_PERLDOC@
 
 TOOLS          = uname dmesg
 
-SUBDIRS                = lib $(TOOLS)
-
 ifeq ($(HAVE_PERLDOC),perldoc)
 ifeq ($(HAVE_PERLDOC),perldoc)
-TARGETS         += virt-mem.1 virt-mem.txt $(TOOLS:%=virt-%.1)
+MANPAGES        = virt-mem.1 $(TOOLS:%=virt-%.1)
+TEXTMANPAGES   = virt-mem.txt
 endif
 
 endif
 
-all install: $(TARGETS)
-       for d in $(SUBDIRS) po; do \
+TARGETS                = $(MANPAGES) $(TEXTMANPAGES)
+
+all: $(TARGETS)
+       for d in lib $(TOOLS) po; do \
+         $(MAKE) -C $$d $@; \
+         if [ $$? -ne 0 ]; then exit 1; fi; \
+       done
+
+install: install-man
+       for d in lib $(TOOLS) po; do \
          $(MAKE) -C $$d $@; \
          if [ $$? -ne 0 ]; then exit 1; fi; \
        done
 
 depend doc:
          $(MAKE) -C $$d $@; \
          if [ $$? -ne 0 ]; then exit 1; fi; \
        done
 
 depend doc:
-       for d in $(SUBDIRS); do \
+       for d in lib $(TOOLS); do \
          $(MAKE) -C $$d $@; \
          if [ $$? -ne 0 ]; then exit 1; fi; \
        done
 
 clean:
          $(MAKE) -C $$d $@; \
          if [ $$? -ne 0 ]; then exit 1; fi; \
        done
 
 clean:
-       for d in . $(SUBDIRS); do \
+       for d in . lib $(TOOLS); do \
          (cd $$d; rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a \
            *.so *.opt *~ *.dll *.exe *.annot core); \
        done
          (cd $$d; rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a \
            *.so *.opt *~ *.dll *.exe *.annot core); \
        done
@@ -72,6 +81,14 @@ virt-mem.txt: virt-mem.pod
 
 virt-%.1:
        echo '.so man1/virt-mem.1' > $@
 
 virt-%.1:
        echo '.so man1/virt-mem.1' > $@
+
+install-man:
+       $(INSTALL) -m 0644 $(MANPAGES) $(DESTDIR)$(mandir)/man1/
+
+else
+
+install-man:
+
 endif
 
 # Distribution.
 endif
 
 # Distribution.
index 9425703..8917154 100644 (file)
@@ -20,6 +20,7 @@ PACKAGE               = @PACKAGE_NAME@
 VERSION                = @PACKAGE_VERSION@
 
 INSTALL                = @INSTALL@
 VERSION                = @PACKAGE_VERSION@
 
 INSTALL                = @INSTALL@
+bindir         = @bindir@
 
 SYNTAX         = -pp "camlp4o -I$$(ocamlc -where)/bitmatch bitmatch.cma pa_bitmatch.cmo"
 
 
 SYNTAX         = -pp "camlp4o -I$$(ocamlc -where)/bitmatch bitmatch.cma pa_bitmatch.cmo"
 
@@ -56,4 +57,9 @@ virt-dmesg.opt: $(XOBJS) ../lib/virt_mem.cmxa
        ocamlfind ocamlopt \
          $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) $(XOBJS) -o $@
 
        ocamlfind ocamlopt \
          $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) $(XOBJS) -o $@
 
+install:
+       if [ -x virt-dmesg.opt ]; then \
+         $(INSTALL) -m 0755 virt-dmesg.opt $(DESTDIR)$(bindir)/virt-dmesg; \
+       fi
+
 include ../Make.rules
\ No newline at end of file
 include ../Make.rules
\ No newline at end of file
index 1a20d23..bc3cce8 100644 (file)
@@ -60,4 +60,6 @@ virt_mem.cma: $(OBJS)
 virt_mem.cmxa: $(XOBJS)
        ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) -a -o $@ $^
 
 virt_mem.cmxa: $(XOBJS)
        ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) -a -o $@ $^
 
+install:
+
 include ../Make.rules
\ No newline at end of file
 include ../Make.rules
\ No newline at end of file
index 0211b30..2bec44d 100644 (file)
@@ -20,6 +20,7 @@ PACKAGE               = @PACKAGE_NAME@
 VERSION                = @PACKAGE_VERSION@
 
 INSTALL                = @INSTALL@
 VERSION                = @PACKAGE_VERSION@
 
 INSTALL                = @INSTALL@
+bindir         = @bindir@
 
 SYNTAX         = -pp "camlp4o -I$$(ocamlc -where)/bitmatch bitmatch.cma pa_bitmatch.cmo"
 
 
 SYNTAX         = -pp "camlp4o -I$$(ocamlc -where)/bitmatch bitmatch.cma pa_bitmatch.cmo"
 
@@ -56,4 +57,9 @@ virt-uname.opt: $(XOBJS) ../lib/virt_mem.cmxa
        ocamlfind ocamlopt \
          $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) $(XOBJS) -o $@
 
        ocamlfind ocamlopt \
          $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) $(XOBJS) -o $@
 
+install:
+       if [ -x virt-uname.opt ]; then \
+         $(INSTALL) -m 0755 virt-uname.opt $(DESTDIR)$(bindir)/virt-uname; \
+       fi
+
 include ../Make.rules
\ No newline at end of file
 include ../Make.rules
\ No newline at end of file