From 8bd81b64dd11b27840b53208db19432dc9f6e06b Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] 'make install' installs programs and man pages --- Makefile.in | 31 ++++++++++++++++++++++++------- dmesg/Makefile.in | 6 ++++++ lib/Makefile.in | 2 ++ uname/Makefile.in | 6 ++++++ 4 files changed, 38 insertions(+), 7 deletions(-) diff --git a/Makefile.in b/Makefile.in index 192b027..84461c4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -20,31 +20,40 @@ PACKAGE = @PACKAGE_NAME@ VERSION = @PACKAGE_VERSION@ INSTALL = @INSTALL@ +datarootdir = @datarootdir@ +mandir = @mandir@ HAVE_PERLDOC = @HAVE_PERLDOC@ TOOLS = uname dmesg -SUBDIRS = lib $(TOOLS) - 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 -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: - for d in $(SUBDIRS); do \ + for d in lib $(TOOLS); do \ $(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 @@ -72,6 +81,14 @@ virt-mem.txt: virt-mem.pod virt-%.1: echo '.so man1/virt-mem.1' > $@ + +install-man: + $(INSTALL) -m 0644 $(MANPAGES) $(DESTDIR)$(mandir)/man1/ + +else + +install-man: + endif # Distribution. diff --git a/dmesg/Makefile.in b/dmesg/Makefile.in index 9425703..8917154 100644 --- a/dmesg/Makefile.in +++ b/dmesg/Makefile.in @@ -20,6 +20,7 @@ PACKAGE = @PACKAGE_NAME@ VERSION = @PACKAGE_VERSION@ INSTALL = @INSTALL@ +bindir = @bindir@ 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 $@ +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 diff --git a/lib/Makefile.in b/lib/Makefile.in index 1a20d23..bc3cce8 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -60,4 +60,6 @@ virt_mem.cma: $(OBJS) virt_mem.cmxa: $(XOBJS) ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) -a -o $@ $^ +install: + include ../Make.rules \ No newline at end of file diff --git a/uname/Makefile.in b/uname/Makefile.in index 0211b30..2bec44d 100644 --- a/uname/Makefile.in +++ b/uname/Makefile.in @@ -20,6 +20,7 @@ PACKAGE = @PACKAGE_NAME@ VERSION = @PACKAGE_VERSION@ INSTALL = @INSTALL@ +bindir = @bindir@ 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 $@ +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 -- 1.8.3.1