Ticket #14239: patch-Makefile

File patch-Makefile, 4.2 KB (added by michipili (Michael Grünewald), 17 years ago)
Line 
1--- Makefile.orig       2008-02-09 10:54:51.000000000 +0100
2+++ Makefile    2008-02-09 11:44:23.000000000 +0100
3@@ -6,9 +6,9 @@
4 CFLAGS=
5 # If you have Icon, you should use the Icon versions of the noweb pipeline.
6 # Set LIBSRC=icon
7-LIBSRC=awk
8+LIBSRC=icon
9 # If you have no Icon compiler, but do have icont, make ICONC=icont
10-ICONC=iconc
11+ICONC=icont
12 ICONT=icont
13 
14 # BIN is where the commands (notangle, noweave, nountangle, noroots) land
15@@ -18,13 +18,15 @@
16 # MAN7EXT is the extension for the nowebstyle man page (usually 7)
17 # TEXINPUTS is the directory for TeX macro files
18 # ELISP is the directory for emacs lisp files, or /dev/null not to install
19-BIN=/usr/local/noweb
20-LIB=/usr/local/noweb/lib
21-MAN=/usr/local/noweb/man
22+PREFIX?=/opt/local
23+NOWEBPREFIX=${DESTDIR}${PREFIX}
24+BIN=${NOWEBPREFIX}/bin
25+LIB=${NOWEBPREFIX}/libexec/noweb
26+MAN=${NOWEBPREFIX}/share/man
27 MANEXT=1
28 MAN7EXT=7
29-TEXINPUTS=/usr/local/tex/inputs
30-ELISP=/dev/null
31+TEXINPUTS=${NOWEBPREFIX}/share/texmf/tex/generic/noweb
32+ELISP=${NOWEBPREFIX}/share/emacs/site-lisp
33 
34 # change WEAVE if you want a different version of noweave to be installed
35 WEAVE=noweave         
36@@ -39,6 +41,7 @@
37 CAT7DIR=$(MAN)/cat$(MAN7EXT)
38 LIBNAME=$(LIB)
39 TEXNAME=$(TEXINPUTS)
40+INSTALLDIR=install -d
41 
42 all:
43        cd c; make "CC=$(CC)" "CFLAGS=$(CFLAGS)" all
44@@ -58,7 +61,7 @@
45        -rmdir $(BIN) $(LIB) 2>/dev/null
46 
47 install-shell:
48-       -mkdir $(BIN) $(LIB) 2>/dev/null
49+       -$(INSTALLDIR) $(BIN) $(LIB) 2>/dev/null
50        sed "s@|LIBDIR|@$(LIBNAME)@" shell/noweb > $(BIN)/noweb
51        chmod +x $(BIN)/noweb
52        sed "s@|LIBDIR|@$(LIBNAME)@" shell/notangle > $(BIN)/notangle
53@@ -98,7 +101,7 @@
54        rm $(LIB)/tmac.w
55 
56 install-code: install-shell
57-       -mkdir $(BIN) $(LIB) 2>/dev/null
58+       -$(INSTALLDIR) $(BIN) $(LIB) 2>/dev/null
59        strip c/nt c/markup c/mnt c/finduses
60        cp c/nt c/markup c/mnt c/finduses $(LIB)
61        cd $(LIBSRC); make ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) install
62@@ -109,7 +112,7 @@
63        cd $(LIBSRC); make ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) uninstall
64        cd lib; make LIB=$(LIB) uninstall
65 install-man:
66-       -mkdir $(MAN) $(MANDIR) $(MAN7DIR) 2>/dev/null
67+       -$(INSTALLDIR) $(MAN) $(MANDIR) $(MAN7DIR) 2>/dev/null
68        sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/cpif.1 > $(MANDIR)/cpif.$(MANEXT)
69        sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nodefs.1 > $(MANDIR)/nodefs.$(MANEXT)
70        sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noroots.1 > $(MANDIR)/noroots.$(MANEXT)
71@@ -142,7 +145,7 @@
72        rm -f $(MANDIR)/noweave.$(MANEXT)
73        rm -f $(MANDIR)/nountangle.$(MANEXT)
74 install-gzipped-man:
75-       -mkdir $(MAN) $(MANDIR) $(MAN7DIR) 2>/dev/null
76+       -$(INSTALLDIR) $(MAN) $(MANDIR) $(MAN7DIR) 2>/dev/null
77        sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/cpif.1  | gzip -9 > $(MANDIR)/cpif.$(MANEXT).gz
78        sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nodefs.1  | gzip -9 > $(MANDIR)/nodefs.$(MANEXT).gz
79        sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noroots.1  | gzip -9 > $(MANDIR)/noroots.$(MANEXT).gz
80@@ -161,7 +164,7 @@
81        (cd $(MANDIR); ln notangle.$(MANEXT).gz nountangle.$(MANEXT).gz)
82 install-preformat-man:
83        -echo "Warning: install-preformat-man is obsolete, even on Slackware systems" 1>&2
84-       -mkdir $(MAN) $(CATDIR) $(CAT7DIR) 2>/dev/null
85+       -$(INSTALLDIR) $(MAN) $(CATDIR) $(CAT7DIR) 2>/dev/null
86        sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/cpif.txt  | gzip > $(CATDIR)/cpif.$(MANEXT).gz
87        sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nodefs.txt  | gzip > $(CATDIR)/nodefs.$(MANEXT).gz
88        sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noroots.txt  | gzip > $(CATDIR)/noroots.$(MANEXT).gz
89@@ -179,7 +182,7 @@
90        rm -f $(CATDIR)/nountangle.$(MANEXT).gz
91        (cd $(CATDIR); ln notangle.$(MANEXT).gz nountangle.$(MANEXT).gz)
92 install-tex:
93-       -mkdir $(TEXINPUTS) 2>/dev/null
94+       -$(INSTALLDIR) $(TEXINPUTS) 2>/dev/null
95        cp tex/nwmac.tex tex/noweb.sty $(TEXINPUTS)
96        -texhash || echo "Program texhash not found or failed"
97 
98@@ -187,7 +190,7 @@
99        rm -f $(TEXINPUTS)/nwmac.tex $(TEXINPUTS)/noweb.sty
100 
101 install-elisp:
102-       -mkdir $(ELISP) 2>/dev/null
103+       -$(INSTALLDIR) $(ELISP) 2>/dev/null
104        cp elisp/noweb-mode.el $(ELISP)
105 
106 uninstall-elisp: