Ticket #14459: patch-Makefile.diff

File patch-Makefile.diff, 4.3 KB (added by michipili (Michael Grünewald), 17 years ago)

The actual correction

  • Makefile

    old new  
    66CFLAGS=
    77# If you have Icon, you should use the Icon versions of the noweb pipeline.
    88# Set LIBSRC=icon
    9 LIBSRC=awk
     9LIBSRC=icon
    1010# If you have no Icon compiler, but do have icont, make ICONC=icont
    11 ICONC=iconc
     11ICONC=icont
    1212ICONT=icont
    1313
    1414# BIN is where the commands (notangle, noweave, nountangle, noroots) land
     
    1818# MAN7EXT is the extension for the nowebstyle man page (usually 7)
    1919# TEXINPUTS is the directory for TeX macro files
    2020# ELISP is the directory for emacs lisp files, or /dev/null not to install
    21 BIN=/usr/local/noweb
    22 LIB=/usr/local/noweb/lib
    23 MAN=/usr/local/noweb/man
     21PREFIX?=@PREFIX@
     22NOWEBPREFIX=$(DESTDIR)$(PREFIX)
     23BIN=$(NOWEBPREFIX)/bin
     24LIB=$(NOWEBPREFIX)/libexec/noweb
     25MAN=$(NOWEBPREFIX)/share/man
    2426MANEXT=1
    2527MAN7EXT=7
    26 TEXINPUTS=/usr/local/tex/inputs
    27 ELISP=/dev/null
     28TEXINPUTS=$(NOWEBPREFIX)/share/texmf/tex/generic/noweb
     29ELISP=$(NOWEBPREFIX)/share/emacs/site-lisp
    2830
    2931# change WEAVE if you want a different version of noweave to be installed
    3032WEAVE=noweave           
     
    3739MAN7DIR=$(MAN)/man$(MAN7EXT)
    3840CATDIR=$(MAN)/cat$(MANEXT)
    3941CAT7DIR=$(MAN)/cat$(MAN7EXT)
    40 LIBNAME=$(LIB)
    41 TEXNAME=$(TEXINPUTS)
     42LIBNAME=$(PREFIX)/libexec/noweb
     43TEXNAME=$(PREFIX)/share/texmf/tex/generic/noweb
     44INSTALLDIR=install -d
    4245
    4346all:
    4447        cd c; make "CC=$(CC)" "CFLAGS=$(CFLAGS)" all
     
    5861        -rmdir $(BIN) $(LIB) 2>/dev/null
    5962
    6063install-shell:
    61         -mkdir $(BIN) $(LIB) 2>/dev/null
     64        -$(INSTALLDIR) $(BIN) $(LIB) 2>/dev/null
    6265        sed "s@|LIBDIR|@$(LIBNAME)@" shell/noweb > $(BIN)/noweb
    6366        chmod +x $(BIN)/noweb
    6467        sed "s@|LIBDIR|@$(LIBNAME)@" shell/notangle > $(BIN)/notangle
     
    98101        rm $(LIB)/tmac.w
    99102
    100103install-code: install-shell
    101         -mkdir $(BIN) $(LIB) 2>/dev/null
     104        -$(INSTALLDIR) $(BIN) $(LIB) 2>/dev/null
    102105        strip c/nt c/markup c/mnt c/finduses
    103106        cp c/nt c/markup c/mnt c/finduses $(LIB)
    104107        cd $(LIBSRC); make ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) install
     
    109112        cd $(LIBSRC); make ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) uninstall
    110113        cd lib; make LIB=$(LIB) uninstall
    111114install-man:
    112         -mkdir $(MAN) $(MANDIR) $(MAN7DIR) 2>/dev/null
     115        -$(INSTALLDIR) $(MAN) $(MANDIR) $(MAN7DIR) 2>/dev/null
    113116        sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/cpif.1 > $(MANDIR)/cpif.$(MANEXT)
    114117        sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nodefs.1 > $(MANDIR)/nodefs.$(MANEXT)
    115118        sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noroots.1 > $(MANDIR)/noroots.$(MANEXT)
     
    142145        rm -f $(MANDIR)/noweave.$(MANEXT)
    143146        rm -f $(MANDIR)/nountangle.$(MANEXT)
    144147install-gzipped-man:
    145         -mkdir $(MAN) $(MANDIR) $(MAN7DIR) 2>/dev/null
     148        -$(INSTALLDIR) $(MAN) $(MANDIR) $(MAN7DIR) 2>/dev/null
    146149        sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/cpif.1  | gzip -9 > $(MANDIR)/cpif.$(MANEXT).gz
    147150        sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nodefs.1  | gzip -9 > $(MANDIR)/nodefs.$(MANEXT).gz
    148151        sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noroots.1  | gzip -9 > $(MANDIR)/noroots.$(MANEXT).gz
     
    161164        (cd $(MANDIR); ln notangle.$(MANEXT).gz nountangle.$(MANEXT).gz)
    162165install-preformat-man:
    163166        -echo "Warning: install-preformat-man is obsolete, even on Slackware systems" 1>&2
    164         -mkdir $(MAN) $(CATDIR) $(CAT7DIR) 2>/dev/null
     167        -$(INSTALLDIR) $(MAN) $(CATDIR) $(CAT7DIR) 2>/dev/null
    165168        sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/cpif.txt  | gzip > $(CATDIR)/cpif.$(MANEXT).gz
    166169        sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nodefs.txt  | gzip > $(CATDIR)/nodefs.$(MANEXT).gz
    167170        sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noroots.txt  | gzip > $(CATDIR)/noroots.$(MANEXT).gz
     
    179182        rm -f $(CATDIR)/nountangle.$(MANEXT).gz
    180183        (cd $(CATDIR); ln notangle.$(MANEXT).gz nountangle.$(MANEXT).gz)
    181184install-tex:
    182         -mkdir $(TEXINPUTS) 2>/dev/null
     185        -$(INSTALLDIR) $(TEXINPUTS) 2>/dev/null
    183186        cp tex/nwmac.tex tex/noweb.sty $(TEXINPUTS)
    184187        -texhash || echo "Program texhash not found or failed"
    185188
     
    187190        rm -f $(TEXINPUTS)/nwmac.tex $(TEXINPUTS)/noweb.sty
    188191
    189192install-elisp:
    190         -mkdir $(ELISP) 2>/dev/null
     193        -$(INSTALLDIR) $(ELISP) 2>/dev/null
    191194        cp elisp/noweb-mode.el $(ELISP)
    192195
    193196uninstall-elisp: