make_cleanup.diff 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662
  1. diff --git a/Makefile b/Makefile
  2. --- a/Makefile
  3. +++ b/Makefile
  4. @@ -9,14 +9,16 @@
  5. CINAME=-Nv`echo $(VERSION) | tr . _`
  6. CIMSG=-f -m'standard checkin preparing to export version $(VERSION)'
  7. -source: ; for i in src; do (cd $$i; make source); done
  8. -www: ; for i in src/xdoc examples; do (cd $$i; make www); done
  9. +source:
  10. + for i in src; do ($(MAKE) -C $$i source); done
  11. +www:
  12. + for i in src/xdoc examples; do ($(MAKE) -C $$i www); done
  13. clean:
  14. - for i in src examples contrib; do (cd $$i; make clean); done
  15. - rm -f nwsrcfilter *~ */*~
  16. + for i in src examples contrib; do ($(MAKE) -C $$i clean); done
  17. + $(RM) nwsrcfilter *~ */*~
  18. clobber: clean
  19. - for i in src examples contrib; do (cd $$i; make clobber); done
  20. + for i in src examples contrib; do ($(MAKE) -C $$i clobber); done
  21. DATE:
  22. (./echo -n "Version $(VERSION) of "; date) > DATE
  23. @@ -36,14 +38,14 @@
  24. tarnames: clean source nwsrcfilter DATE
  25. find . -not -type d -not -name FAQ.old -print | ./nwsrcfilter
  26. -tar: clean source nwsrcfilter DATE emacscheck
  27. +tar: clean source nwsrcfilter DATE emacscheck
  28. chmod +w src/Makefile
  29. rm -rf /tmp/noweb-$(VERSION)
  30. - mkdir /tmp/noweb-$(VERSION)
  31. + mkdir -p /tmp/noweb-$(VERSION)
  32. tar cvf - `find . ! -type d -not -name FAQ.old -print | ./nwsrcfilter` | (cd /tmp/noweb-$(VERSION) ; tar xf - )
  33. (cd /tmp; tar cf - noweb-$(VERSION) ) | gzip -v > ../noweb-$(VERSION).tgz
  34. - rm -f ../noweb.tgz
  35. - (cd .. ; ln -s noweb-$(VERSION).tgz noweb.tgz)
  36. + $(RM) ../noweb.tgz
  37. + (cd .. && ln -s noweb-$(VERSION).tgz noweb.tgz)
  38. chmod -w src/Makefile
  39. emacscheck:
  40. @@ -51,6 +53,4 @@
  41. diff src/elisp/noweb-mode.el $(HOME)/emacs/noweb-mode.el
  42. checkin:
  43. - (cd src; make "CINAME=$(CINAME)" "CIMSG=$(CIMSG)" checkin)
  44. -
  45. -
  46. + ($(MAKE) -C src "CINAME=$(CINAME)" "CIMSG=$(CIMSG)" checkin)
  47. diff --git a/contrib/Makefile b/contrib/Makefile
  48. --- a/contrib/Makefile
  49. +++ b/contrib/Makefile
  50. @@ -5,9 +5,12 @@
  51. # don't do kostas; it requires gnu make (ugh)
  52. -all: ; for i in $(DIRS); do (cd $$i; make ICONC=$(ICONC) all); done
  53. -install: ; for i in $(DIRS); do (cd $$i; make LIB=$(LIB) BIN=$(BIN) install); done
  54. -source: ; for i in $(DIRS); do (cd $$i; make source); done
  55. -clean: ; for i in $(DIRS); do (cd $$i; make clean); done
  56. +all:
  57. + for i in $(DIRS); do ($(MAKE) -C $$i ICONC=$(ICONC) all); done
  58. +install:
  59. + for i in $(DIRS); do ($(MAKE) -C $$i LIB=$(LIB) BIN=$(BIN) install); done
  60. +source:
  61. + for i in $(DIRS); do ($(MAKE) -C $$i source); done
  62. +clean:
  63. + for i in $(DIRS); do ($(MAKE) -C $$i clean); done
  64. clobber: clean
  65. -
  66. diff --git a/contrib/conrado/Makefile b/contrib/conrado/Makefile
  67. --- a/contrib/conrado/Makefile
  68. +++ b/contrib/conrado/Makefile
  69. @@ -1,7 +1,8 @@
  70. LIB=/dev/null # to be overridden by install
  71. .SUFFIXES: .nw .icn
  72. -.nw.icn: ; notangle -L'#line %-1L "%F"%N' $*.nw | cpif $*.icn
  73. +.nw.icn:
  74. + notangle -L'#line %-1L "%F"%N' $*.nw | cpif $*.icn
  75. all: d2tex
  76. source: d2tex
  77. @@ -10,6 +11,6 @@
  78. # TeX files.
  79. hospital.tex: hospital.nw d2tex
  80. - noweave -delay -filter ./d2tex hospital.nw > hospital.tex
  81. + noweave -delay -filter $^ > $@
  82. clean:
  83. - /bin/rm -f hospital.tex *.dvi *.aux *.log *.blg *.bbl *~
  84. + $(RM) hospital.tex *.dvi *.aux *.log *.blg *.bbl *~
  85. diff --git a/contrib/davelove/Makefile b/contrib/davelove/Makefile
  86. --- a/contrib/davelove/Makefile
  87. +++ b/contrib/davelove/Makefile
  88. @@ -3,4 +3,4 @@
  89. source:
  90. install:
  91. clean:
  92. - /bin/rm -f *.dvi *.log *.aux
  93. + $(RM) *.dvi *.log *.aux
  94. diff --git a/contrib/jobling/Makefile b/contrib/jobling/Makefile
  95. --- a/contrib/jobling/Makefile
  96. +++ b/contrib/jobling/Makefile
  97. @@ -1,9 +1,9 @@
  98. PROG = correct-refs
  99. -DOCSRC = $(PROG).tex
  100. -PROGSRC = $(PROG).csh
  101. +DOCSRC = $(PROG).tex
  102. +PROGSRC = $(PROG).csh
  103. SCRIPTS = list-anchors.awk awk-scripts.awk
  104. -all: correct-refs.tex correct-refs.csh all-scripts
  105. +all: correct-refs.tex correct-refs.csh all-scripts
  106. correct-refs.tex: correct-refs.nw
  107. noweave -delay -index $< > $@
  108. @@ -22,13 +22,13 @@
  109. cp *.awk $(HOME)/lib
  110. tidy:
  111. - -rm *~ *% *.bak *.log *.blg
  112. + $(RM) *~ *% *.bak *.log *.blg
  113. clean: tidy
  114. - -rm *.ps *.dvi *.toc *.aux *.bbl *.dep $(PROG).shar
  115. + $(RM) *.ps *.dvi *.toc *.aux *.bbl *.dep $(PROG).shar
  116. realclean: clean
  117. - -rm $(DOCSRC) $(PROGSRC) $(SCRIPTS)
  118. + $(RM) $(DOCSRC) $(PROGSRC) $(SCRIPTS)
  119. shar:
  120. shar README Makefile $(PROG).nw > $(PROG).shar
  121. diff --git a/contrib/jonkrom/Makefile b/contrib/jonkrom/Makefile
  122. --- a/contrib/jonkrom/Makefile
  123. +++ b/contrib/jonkrom/Makefile
  124. @@ -9,7 +9,7 @@
  125. source: noxref.krom
  126. noxref.krom: noxref.nw
  127. - notangle -Rnoxref noxref.nw > noxref.krom
  128. + notangle -Rnoxref $< > $@
  129. clean:
  130. - /bin/rm -f *.tex *.dvi *.ilg *.idx *.aux *.log *.blg *.bbl *~ *.ind noxref.krom
  131. + $(RM) *.tex *.dvi *.ilg *.idx *.aux *.log *.blg *.bbl *~ *.ind noxref.krom
  132. diff --git a/contrib/kostas/Makefile.make b/contrib/kostas/Makefile.make
  133. --- a/contrib/kostas/Makefile.make
  134. +++ b/contrib/kostas/Makefile.make
  135. @@ -10,8 +10,8 @@
  136. .SUFFIXES: .nw .icn .tex .dvi
  137. -all: C.filter C++.filter icon.filter oot.filter math.filter\
  138. - autodefs.oot autodefs.math
  139. +all: C.filter C++.filter icon.filter oot.filter math.filter \
  140. + autodefs.oot autodefs.math
  141. install:
  142. mv *.filter $(LIB)
  143. @@ -22,7 +22,7 @@
  144. %.tex : %.nw
  145. $(WEAVE) $< > $@
  146. pp.tex: pp.nw
  147. - noweave -delay -autodefs icon -filter icon.filter -index pp.nw > pp.tex
  148. + noweave -delay -autodefs icon -filter icon.filter -index $< > $@
  149. %.dvi : %.tex
  150. latex $<
  151. # Don't delete the intermediate .tex file.
  152. @@ -31,15 +31,15 @@
  153. # Icon files.
  154. C.icn: pp.nw C_translation_table
  155. - $(TANGLE) -R"C" pp.nw > $@
  156. + $(TANGLE) -R"C" $< > $@
  157. C++.icn: pp.nw C++_translation_table
  158. - $(TANGLE) -R"C++" pp.nw > $@
  159. + $(TANGLE) -R"C++" $< > $@
  160. icon.icn: pp.nw icon_translation_table
  161. - $(TANGLE) -R"Icon" pp.nw > $@
  162. + $(TANGLE) -R"Icon" $< > $@
  163. oot.icn: pp.nw oot_translation_table
  164. - $(TANGLE) -R"OOT" pp.nw > $@
  165. -math.icn: pp.nw math_translation_table
  166. - $(TANGLE) -R"Mathematica" pp.nw > $@
  167. + $(TANGLE) -R"OOT" $< > $@
  168. +math.icn: pp.nw math_translation_table
  169. + $(TANGLE) -R"Mathematica" $< > $@
  170. ootdefs.icn: ootdefs.nw
  171. $(TANGLE) $< $(defns) > $@
  172. @@ -48,14 +48,14 @@
  173. # Executables: filters.
  174. -%.filter : %.icn
  175. +%.filter: %.icn
  176. $(ICONC) -o $@ $<
  177. # Executables: autodefs.
  178. autodefs.oot: ootdefs.icn
  179. - $(ICONC) -o autodefs.oot ootdefs.icn
  180. + $(ICONC) -o $@ $<
  181. autodefs.math: mathdefs.icn
  182. - $(ICONC) -o autodefs.math mathdefs.icn
  183. + $(ICONC) -o $@ $<
  184. # Cleaning: remove all files that can be recreated from noweb sources.
  185. @@ -69,7 +69,4 @@
  186. # Also remove the Icon files for the filters.
  187. clean:
  188. - -rm -f $(rem) C.icn C++.icn icon.icn oot.icn math.icn *.filter autodefs.*
  189. -
  190. -
  191. -
  192. + $(RM) $(rem) C.icn C++.icn icon.icn oot.icn math.icn *.filter autodefs.*
  193. diff --git a/contrib/leew/Makefile b/contrib/leew/Makefile
  194. --- a/contrib/leew/Makefile
  195. +++ b/contrib/leew/Makefile
  196. @@ -3,4 +3,4 @@
  197. install:
  198. source:
  199. clean:
  200. - /bin/rm -f nocond *.dvi *.log *.aux *.toc *.tex *.tex nocond.1
  201. + $(RM) nocond *.dvi *.log *.aux *.toc *.tex *.tex nocond.1
  202. diff --git a/contrib/norman/Makefile b/contrib/norman/Makefile
  203. --- a/contrib/norman/Makefile
  204. +++ b/contrib/norman/Makefile
  205. @@ -1,10 +1,14 @@
  206. LIB=/dev/null # to be overridden
  207. DIRS=numarkup
  208. -all: ; for i in $(DIRS); do (cd $$i; make ICONC=$(ICONC) ICONT=$(ICONT) all); done
  209. -install: ; for i in $(DIRS); do (cd $$i; make LIB=$(LIB) BIN=$(BIN) install); done
  210. -source: ; for i in $(DIRS); do (cd $$i; make source); done
  211. -clean: ; for i in $(DIRS); do (cd $$i; make clean); done
  212. +all:
  213. + for i in $(DIRS); do ($(MAKE) -C $$i ICONC=$(ICONC) ICONT=$(ICONT) all); done
  214. +install:
  215. + for i in $(DIRS); do ($(MAKE) -C $$i LIB=$(LIB) BIN=$(BIN) install); done
  216. +source:
  217. + for i in $(DIRS); do ($(MAKE) -C $$i source); done
  218. +clean:
  219. + for i in $(DIRS); do ($(MAKE) -C $$i clean); done
  220. iconlib: # cheap hack for slackmake
  221. true
  222. diff --git a/contrib/norman/numarkup/Makefile b/contrib/norman/numarkup/Makefile
  223. --- a/contrib/norman/numarkup/Makefile
  224. +++ b/contrib/norman/numarkup/Makefile
  225. @@ -6,23 +6,25 @@
  226. OBJS = main.o pass1.o latex.o input.o scraps.o names.o arena.o global.o
  227. .SUFFIXES: .nw
  228. -.nw.c: ; notangle -R"$@"'*' -L $< | cpif $@
  229. -.nw.h: ; notangle -R"$@" $< | cpif $@
  230. +.nw.c:
  231. + notangle -R"$@"'*' -L $< | cpif $@
  232. +.nw.h:
  233. + notangle -R"$@" $< | cpif $@
  234. -all:
  235. +all:
  236. noweb -t numarkup.nw
  237. - make $(TARGET)
  238. + $(MAKE) $(TARGET)
  239. install:
  240. noweb -t numarkup.nw
  241. - make $(TARGET)
  242. + $(MAKE) $(TARGET)
  243. strip $(TARGET)
  244. cp $(TARGET) $(LIB)
  245. source: main.c pass1.c latex.c input.c scraps.c names.c arena.c global.c
  246. clean:
  247. - rm -f *.o *.c *.h *.tex *.log *.dvi *~ *.blg $(TARGET) *.html *~
  248. + $(RM) *.o *.c *.h *.tex *.log *.dvi *~ *.blg $(TARGET) *.html *~
  249. $(OBJS): global.h
  250. @@ -30,8 +32,7 @@
  251. $(CC) -o $(TARGET) $(OBJS)
  252. numarkup.html: numarkup.nw
  253. - noweave -filter l2h -html -index numarkup.nw > numarkup.html
  254. + noweave -filter l2h -html -index $< > $@
  255. numarkup.tex: numarkup.nw
  256. - noweb -o numarkup.nw
  257. -
  258. + noweb -o $@
  259. diff --git a/contrib/ydirson/Makefile b/contrib/ydirson/Makefile
  260. --- a/contrib/ydirson/Makefile
  261. +++ b/contrib/ydirson/Makefile
  262. @@ -1,6 +1,6 @@
  263. -LIB=/dev/null # to be overridden
  264. +LIB=/dev/null # to be overridden
  265. -FILTERS = guesslang inheritlang enscript-html
  266. +FILTERS = guesslang inheritlang enscript-html
  267. # nothing to tangle or weave
  268. all:
  269. diff --git a/examples/Makefile b/examples/Makefile
  270. --- a/examples/Makefile
  271. +++ b/examples/Makefile
  272. @@ -4,14 +4,19 @@
  273. NOWEAVE=noweave
  274. .SUFFIXES: .i3 .m3 .nw .tex .dvi .html
  275. -.nw.html: ; $(NOWEAVE) -filter l2h -filter btdefn -index -html $*.nw > $*.html
  276. -.nw.tex: ; $(NOWEAVE) -index -filter btdefn $*.nw > $*.tex
  277. -.nw.i3: ; $(NOTANGLE) -Rinterface -L'<* LINE %L "%F" *>%N' $*.nw > $*.i3
  278. -.nw.m3: ; $(NOTANGLE) -L'<* LINE %L "%F" *>%N' $*.nw > $*.m3
  279. -.tex.dvi: ; latex '\scrollmode \input '"$*"; while grep -s 'Rerun to get cross-references right' $*.log; do latex '\scrollmode \input '"$*"; done
  280. +.nw.html:
  281. + $(NOWEAVE) -filter l2h -filter btdefn -index -html $*.nw > $*.html
  282. +.nw.tex:
  283. + $(NOWEAVE) -index -filter btdefn $*.nw > $*.tex
  284. +.nw.i3:
  285. + $(NOTANGLE) -Rinterface -L'<* LINE %L "%F" *>%N' $*.nw > $*.i3
  286. +.nw.m3:
  287. + $(NOTANGLE) -L'<* LINE %L "%F" *>%N' $*.nw > $*.m3
  288. +.tex.dvi:
  289. + latex '\scrollmode \input '"$*"; while grep -s 'Rerun to get cross-references right' $*.log; do latex '\scrollmode \input '"$*"; done
  290. HTML=breakmodel.html compress.html dag.html graphs.html mipscoder.html primes.html \
  291. - scanner.html test.html tree.html wc.html wcni.html
  292. + scanner.html test.html tree.html wc.html wcni.html
  293. www: $(HTML)
  294. @@ -19,37 +24,37 @@
  295. copy -v README.h $(WWW)/index.html
  296. clean:
  297. - rm -f *~ *.aux *.tex *.dvi *.log *.html *.toc
  298. + $(RM) *~ *.aux *.tex *.dvi *.log *.html *.toc
  299. clobber: clean
  300. compress.html: compress.nw
  301. - $(NOWEAVE) -filter l2h -index -autodefs c -html compress.nw > compress.html
  302. + $(NOWEAVE) -filter l2h -index -autodefs c -html $< > $@
  303. compress.tex: compress.nw
  304. - $(NOWEAVE) -index -autodefs c compress.nw > compress.tex
  305. + $(NOWEAVE) -index -autodefs c $< > $@
  306. dag.html: dag.nw
  307. - $(NOWEAVE) -filter l2h -index -autodefs icon -html dag.nw > dag.html
  308. + $(NOWEAVE) -filter l2h -index -autodefs icon -html $< > $@
  309. dag.tex: dag.nw
  310. - $(NOWEAVE) -index -autodefs icon dag.nw > dag.tex
  311. + $(NOWEAVE) -index -autodefs icon $< > $@
  312. mipscoder.html: mipscoder.nw
  313. - $(NOWEAVE) -filter l2h -index -autodefs sml -html mipscoder.nw > mipscoder.html
  314. + $(NOWEAVE) -filter l2h -index -autodefs sml -html $< > $@
  315. mipscoder.tex: mipscoder.nw
  316. - $(NOWEAVE) -autodefs sml -index mipscoder.nw > mipscoder.tex
  317. + $(NOWEAVE) -autodefs sml -index $< > $@
  318. scanner.html: scanner.nw
  319. - $(NOWEAVE) -filter l2h -index -autodefs c -autodefs yacc -html scanner.nw > scanner.html
  320. + $(NOWEAVE) -filter l2h -index -autodefs c -autodefs yacc -html $< > $@
  321. scanner.tex: scanner.nw
  322. - $(NOWEAVE) -index -autodefs c -autodefs yacc scanner.nw > scanner.tex
  323. + $(NOWEAVE) -index -autodefs c -autodefs yacc $< > $@
  324. tree.html: tree.nw
  325. - $(NOWEAVE) -filter l2h -index -autodefs icon -html tree.nw > tree.html
  326. + $(NOWEAVE) -filter l2h -index -autodefs icon -html $< > $@
  327. tree.tex: tree.nw
  328. - $(NOWEAVE) -index -autodefs icon tree.nw > tree.tex
  329. + $(NOWEAVE) -index -autodefs icon $< > $@
  330. test.html: test.nw
  331. - $(NOWEAVE) -filter l2h -html test.nw > test.html
  332. + $(NOWEAVE) -filter l2h -html $< > $@
  333. test.tex: test.nw
  334. - $(NOWEAVE) test.nw > test.tex
  335. + $(NOWEAVE) $< > $@
  336. wc.html: wc.nw2html
  337. - $(NOWEAVE) -autodefs c -filter btdefn -index -html -n wc.nw2html > wc.html
  338. + $(NOWEAVE) -autodefs c -filter btdefn -index -html -n $< > $@
  339. wcni.html: wc.nw2html
  340. - $(NOWEAVE) -filter btdefn -x -html -n wc.nw2html > wcni.html
  341. + $(NOWEAVE) -filter btdefn -x -html -n $< > $@
  342. wc.tex: wc.nw
  343. - $(NOWEAVE) -autodefs c -filter btdefn -index wc.nw > wc.tex
  344. + $(NOWEAVE) -autodefs c -filter btdefn -index $< > $@
  345. diff --git a/examples/Makefile.awk b/examples/Makefile.awk
  346. --- a/examples/Makefile.awk
  347. +++ b/examples/Makefile.awk
  348. @@ -4,14 +4,19 @@
  349. NOWEAVE=noweave
  350. .SUFFIXES: .i3 .m3 .nw .tex .dvi .html
  351. -.nw.html: ; $(NOWEAVE) -filter btdefn -index -html $*.nw > $*.html
  352. -.nw.tex: ; $(NOWEAVE) -index -filter btdefn $*.nw > $*.tex
  353. -.nw.i3: ; $(NOTANGLE) -Rinterface -L'<* LINE %L "%F" *>%N' $*.nw > $*.i3
  354. -.nw.m3: ; $(NOTANGLE) -L'<* LINE %L "%F" *>%N' $*.nw > $*.m3
  355. -.tex.dvi: ; latex '\scrollmode \input '"$*"; while grep -s 'Rerun to get cross-references right' $*.log; do latex '\scrollmode \input '"$*"; done
  356. +.nw.html:
  357. + $(NOWEAVE) -filter btdefn -index -html $*.nw > $*.html
  358. +.nw.tex:
  359. + $(NOWEAVE) -index -filter btdefn $*.nw > $*.tex
  360. +.nw.i3:
  361. + $(NOTANGLE) -Rinterface -L'<* LINE %L "%F" *>%N' $*.nw > $*.i3
  362. +.nw.m3:
  363. + $(NOTANGLE) -L'<* LINE %L "%F" *>%N' $*.nw > $*.m3
  364. +.tex.dvi:
  365. + latex '\scrollmode \input '"$*"; while grep -s 'Rerun to get cross-references right' $*.log; do latex '\scrollmode \input '"$*"; done
  366. HTML=breakmodel.html compress.html dag.html graphs.html mipscoder.html primes.html \
  367. - scanner.html test.html tree.html wc.html wcni.html
  368. + scanner.html test.html tree.html wc.html wcni.html
  369. DVI=compress.dvi dag.dvi mipscoder.dvi scanner.dvi tree.dvi test.dvi wc.dvi
  370. @@ -22,37 +27,37 @@
  371. copy -v README.h $(WWW)/index.html
  372. clean:
  373. - rm -f *~ *.aux *.tex *.dvi *.log *.html *.toc
  374. + $(RM) *~ *.aux *.tex *.dvi *.log *.html *.toc
  375. clobber: clean
  376. compress.html: compress.nw
  377. - $(NOWEAVE) -index -html compress.nw > compress.html
  378. + $(NOWEAVE) -index -html $< > $@
  379. compress.tex: compress.nw
  380. - $(NOWEAVE) -index compress.nw > compress.tex
  381. + $(NOWEAVE) -index $< > $@
  382. dag.html: dag.nw
  383. - $(NOWEAVE) -index -html dag.nw > dag.html
  384. + $(NOWEAVE) -index -html $< > $@
  385. dag.tex: dag.nw
  386. - $(NOWEAVE) -index dag.nw > dag.tex
  387. + $(NOWEAVE) -index $< > $@
  388. mipscoder.html: mipscoder.nw
  389. - $(NOWEAVE) -index -html mipscoder.nw > mipscoder.html
  390. + $(NOWEAVE) -index -html $< > $@
  391. mipscoder.tex: mipscoder.nw
  392. - $(NOWEAVE) -index mipscoder.nw > mipscoder.tex
  393. + $(NOWEAVE) -index $< > $@
  394. scanner.html: scanner.nw
  395. - $(NOWEAVE) -index -html scanner.nw > scanner.html
  396. + $(NOWEAVE) -index -html $< > $@
  397. scanner.tex: scanner.nw
  398. - $(NOWEAVE) -index scanner.nw > scanner.tex
  399. + $(NOWEAVE) -index $< > $@
  400. tree.html: tree.nw
  401. - $(NOWEAVE) -index -html tree.nw > tree.html
  402. + $(NOWEAVE) -index -html $< > $@
  403. tree.tex: tree.nw
  404. - $(NOWEAVE) -index tree.nw > tree.tex
  405. + $(NOWEAVE) -index $< > $@
  406. test.html: test.nw
  407. - $(NOWEAVE) -html test.nw > test.html
  408. + $(NOWEAVE) -html $< > $@
  409. test.tex: test.nw
  410. - $(NOWEAVE) test.nw > test.tex
  411. + $(NOWEAVE) $< > $@
  412. wc.html: wc.nw2html
  413. - $(NOWEAVE) -filter btdefn -index -html -n wc.nw2html > wc.html
  414. + $(NOWEAVE) -filter btdefn -index -html -n $< > $@
  415. wcni.html: wc.nw2html
  416. - $(NOWEAVE) -filter btdefn -x -html -n wc.nw2html > wcni.html
  417. + $(NOWEAVE) -filter btdefn -x -html -n $< > $@
  418. wc.tex: wc.nw
  419. - $(NOWEAVE) -filter btdefn -index wc.nw > wc.tex
  420. + $(NOWEAVE) -filter btdefn -index $< > $@
  421. diff --git a/src/Makefile b/src/Makefile
  422. --- a/src/Makefile
  423. +++ b/src/Makefile
  424. @@ -27,7 +27,7 @@
  425. ELISP=/dev/null
  426. # change WEAVE if you want a different version of noweave to be installed
  427. -WEAVE=noweave
  428. +WEAVE=noweave
  429. # Stop editing. No user-serviceable parts below.
  430. SHELL=/bin/sh
  431. @@ -37,183 +37,181 @@
  432. MAN7DIR=$(MAN)/man$(MAN7EXT)
  433. CATDIR=$(MAN)/cat$(MANEXT)
  434. CAT7DIR=$(MAN)/cat$(MAN7EXT)
  435. -LIBNAME=$(LIB)
  436. -TEXNAME=$(TEXINPUTS)
  437. -all:
  438. - cd c; make "CC=$(CC)" "CFLAGS=$(CFLAGS)" all
  439. - for i in shell lib xdoc tex; do (cd $$i; make all); done
  440. - cd $(LIBSRC); make "ICONT=$(ICONT)" "ICONC=$(ICONC)" all
  441. +all:
  442. + $(MAKE) -C c "CC=$(CC)" "CFLAGS=$(CFLAGS)" all
  443. + for i in shell lib xdoc tex; do ($(MAKE) -C $$i all); done
  444. + $(MAKE) -C $(LIBSRC) "ICONT=$(ICONT)" "ICONC=$(ICONC)" all
  445. FAQ: FAQ.html
  446. - sleep 1; html2ascii FAQ.html > FAQ
  447. + sleep 1; html2ascii $< > $@
  448. FAQ.html: $(HOME)/www/noweb/FAQ.html
  449. - rm -f FAQ.html
  450. - /bin/cp $(HOME)/www/noweb/FAQ.html FAQ.html
  451. - chmod -w FAQ.html
  452. + $(RM) $@
  453. + cp $< $@
  454. + chmod -w $@
  455. install: install-code install-man install-tex install-elisp
  456. uninstall: uninstall-code uninstall-man uninstall-tex uninstall-elisp
  457. - -rmdir $(BIN) $(LIB) 2>/dev/null
  458. + -rmdir $(DESTDIR)$(BIN) $(DESTDIR)$(LIB) 2>/dev/null
  459. install-shell:
  460. - -mkdir $(BIN) $(LIB) 2>/dev/null
  461. - sed "s@|LIBDIR|@$(LIBNAME)@" shell/noweb > $(BIN)/noweb
  462. - chmod +x $(BIN)/noweb
  463. - sed "s@|LIBDIR|@$(LIBNAME)@" shell/notangle > $(BIN)/notangle
  464. - chmod +x $(BIN)/notangle
  465. - sed "s@|LIBDIR|@$(LIBNAME)@" shell/$(WEAVE) > $(BIN)/$(WEAVE)
  466. - chmod +x $(BIN)/$(WEAVE)
  467. - sed "s@|LIBDIR|@$(LIBNAME)@" shell/nountangle > $(BIN)/nountangle
  468. - chmod +x $(BIN)/nountangle
  469. - sed "s@|LIBDIR|@$(LIBNAME)@" shell/nodefs > $(BIN)/nodefs
  470. - chmod +x $(BIN)/nodefs
  471. - sed "s@|LIBDIR|@$(LIBNAME)@" shell/noroots > $(BIN)/noroots
  472. - chmod +x $(BIN)/noroots
  473. - sed "s@|LIBDIR|@$(LIBNAME)@" shell/nuweb2noweb > $(BIN)/nuweb2noweb
  474. - chmod +x $(BIN)/nuweb2noweb
  475. - sed "s@|LIBDIR|@$(LIBNAME)@" shell/cpif > $(BIN)/cpif
  476. - chmod +x $(BIN)/cpif
  477. - sed "s@|LIBDIR|@$(LIBNAME)@" shell/htmltoc > $(BIN)/htmltoc
  478. - chmod +x $(BIN)/htmltoc
  479. - sed "s@|LIBDIR|@$(LIBNAME)@" shell/noroff > $(BIN)/noroff
  480. - chmod +x $(BIN)/noroff
  481. - sed "s@|LIBDIR|@$(LIBNAME)@" shell/toroff > $(LIB)/toroff
  482. - chmod +x $(LIB)/toroff
  483. - cp shell/tmac.w $(LIB)
  484. + mkdir -p $(DESTDIR)$(BIN) $(DESTDIR)$(LIB)
  485. + sed "s@|LIBDIR|@$(LIB)@" shell/noweb > $(DESTDIR)$(BIN)/noweb
  486. + chmod +x $(DESTDIR)$(BIN)/noweb
  487. + sed "s@|LIBDIR|@$(LIB)@" shell/notangle > $(DESTDIR)$(BIN)/notangle
  488. + chmod +x $(DESTDIR)$(BIN)/notangle
  489. + sed "s@|LIBDIR|@$(LIB)@" shell/$(WEAVE) > $(DESTDIR)$(BIN)/$(WEAVE)
  490. + chmod +x $(DESTDIR)$(BIN)/$(WEAVE)
  491. + sed "s@|LIBDIR|@$(LIB)@" shell/nountangle > $(DESTDIR)$(BIN)/nountangle
  492. + chmod +x $(DESTDIR)$(BIN)/nountangle
  493. + sed "s@|LIBDIR|@$(LIB)@" shell/nodefs > $(DESTDIR)$(BIN)/nodefs
  494. + chmod +x $(DESTDIR)$(BIN)/nodefs
  495. + sed "s@|LIBDIR|@$(LIB)@" shell/noroots > $(DESTDIR)$(BIN)/noroots
  496. + chmod +x $(DESTDIR)$(BIN)/noroots
  497. + sed "s@|LIBDIR|@$(LIB)@" shell/nuweb2noweb > $(DESTDIR)$(BIN)/nuweb2noweb
  498. + chmod +x $(DESTDIR)$(BIN)/nuweb2noweb
  499. + sed "s@|LIBDIR|@$(LIB)@" shell/cpif > $(DESTDIR)$(BIN)/cpif
  500. + chmod +x $(DESTDIR)$(BIN)/cpif
  501. + sed "s@|LIBDIR|@$(LIB)@" shell/htmltoc > $(DESTDIR)$(BIN)/htmltoc
  502. + chmod +x $(DESTDIR)$(BIN)/htmltoc
  503. + sed "s@|LIBDIR|@$(LIB)@" shell/noroff > $(DESTDIR)$(BIN)/noroff
  504. + chmod +x $(DESTDIR)$(BIN)/noroff
  505. + sed "s@|LIBDIR|@$(LIB)@" shell/toroff > $(DESTDIR)$(LIB)/toroff
  506. + chmod +x $(DESTDIR)$(LIB)/toroff
  507. + cp shell/tmac.w $(DESTDIR)$(LIB)
  508. uninstall-shell:
  509. - rm -f $(BIN)/noweb
  510. - rm -f $(BIN)/notangle
  511. - rm -f $(BIN)/$(WEAVE)
  512. - rm -f $(BIN)/nountangle
  513. - rm -f $(BIN)/nodefs
  514. - rm -f $(BIN)/noroots
  515. - rm -f $(BIN)/nuweb2noweb
  516. - rm -f $(BIN)/cpif
  517. - rm -f $(BIN)/htmltoc
  518. - rm -f $(BIN)/noroff
  519. - rm -f $(LIB)/toroff
  520. - rm $(LIB)/tmac.w
  521. + $(RM) $(DESTDIR)$(BIN)/noweb
  522. + $(RM) $(DESTDIR)$(BIN)/notangle
  523. + $(RM) $(DESTDIR)$(BIN)/$(WEAVE)
  524. + $(RM) $(DESTDIR)$(BIN)/nountangle
  525. + $(RM) $(DESTDIR)$(BIN)/nodefs
  526. + $(RM) $(DESTDIR)$(BIN)/noroots
  527. + $(RM) $(DESTDIR)$(BIN)/nuweb2noweb
  528. + $(RM) $(DESTDIR)$(BIN)/cpif
  529. + $(RM) $(DESTDIR)$(BIN)/htmltoc
  530. + $(RM) $(DESTDIR)$(BIN)/noroff
  531. + $(RM) $(DESTDIR)$(LIB)/toroff
  532. + $(RM) $(DESTDIR)$(LIB)/tmac.w
  533. install-code: install-shell
  534. - -mkdir $(BIN) $(LIB) 2>/dev/null
  535. + mkdir -p $(DESTDIR)$(BIN) $(DESTDIR)$(LIB)
  536. strip c/nt c/markup c/mnt c/finduses
  537. - cp c/nt c/markup c/mnt c/finduses $(LIB)
  538. - cd $(LIBSRC); make ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) install
  539. - cd lib; make LIB=$(LIB) install
  540. + cp c/nt c/markup c/mnt c/finduses $(DESTDIR)$(LIB)
  541. + $(MAKE) -C $(LIBSRC) DESTDIR=$(DESTDIR) ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) install
  542. + $(MAKE) -C lib DESTDIR=$(DESTDIR) LIB=$(LIB) install
  543. uninstall-code: uninstall-shell
  544. - rm $(LIB)/nt $(LIB)/markup $(LIB)/mnt $(LIB)/finduses
  545. - cd $(LIBSRC); make ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) uninstall
  546. - cd lib; make LIB=$(LIB) uninstall
  547. + $(RM) $(DESTDIR)$(LIB)/nt $(DESTDIR)$(LIB)/markup $(DESTDIR)$(LIB)/mnt $(DESTDIR)$(LIB)/finduses
  548. + $(MAKE) -C $(LIBSRC) DESTDIR=$(DESTDIR) ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) uninstall
  549. + $(MAKE) -C lib DESTDIR=$(DESTDIR) LIB=$(LIB) uninstall
  550. install-man:
  551. - -mkdir $(MAN) $(MANDIR) $(MAN7DIR) 2>/dev/null
  552. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/cpif.1 > $(MANDIR)/cpif.$(MANEXT)
  553. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nodefs.1 > $(MANDIR)/nodefs.$(MANEXT)
  554. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noroots.1 > $(MANDIR)/noroots.$(MANEXT)
  555. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noweb.1 > $(MANDIR)/noweb.$(MANEXT)
  556. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noindex.1 > $(MANDIR)/noindex.$(MANEXT)
  557. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nuweb2noweb.1 > $(MANDIR)/nuweb2noweb.$(MANEXT)
  558. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/notangle.1 > $(MANDIR)/notangle.$(MANEXT)
  559. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noroff.1 > $(MANDIR)/noroff.$(MANEXT)
  560. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/sl2h.1 > $(MANDIR)/sl2h.$(MANEXT)
  561. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/htmltoc.1 > $(MANDIR)/htmltoc.$(MANEXT)
  562. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nowebstyle.7 > $(MAN7DIR)/nowebstyle.$(MAN7EXT)
  563. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nowebfilters.7 > $(MAN7DIR)/nowebfilters.$(MAN7EXT)
  564. - rm -f $(MANDIR)/noweave.$(MANEXT)
  565. - (cd $(MANDIR); ln notangle.$(MANEXT) noweave.$(MANEXT))
  566. - rm -f $(MANDIR)/nountangle.$(MANEXT)
  567. - (cd $(MANDIR); ln notangle.$(MANEXT) nountangle.$(MANEXT))
  568. + mkdir -p $(DESTDIR)$(MANDIR) $(DESTDIR)$(MAN7DIR)
  569. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/cpif.1 > $(DESTDIR)$(MANDIR)/cpif.$(MANEXT)
  570. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nodefs.1 > $(DESTDIR)$(MANDIR)/nodefs.$(MANEXT)
  571. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/noroots.1 > $(DESTDIR)$(MANDIR)/noroots.$(MANEXT)
  572. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/noweb.1 > $(DESTDIR)$(MANDIR)/noweb.$(MANEXT)
  573. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/noindex.1 > $(DESTDIR)$(MANDIR)/noindex.$(MANEXT)
  574. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nuweb2noweb.1 > $(DESTDIR)$(MANDIR)/nuweb2noweb.$(MANEXT)
  575. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/notangle.1 > $(DESTDIR)$(MANDIR)/notangle.$(MANEXT)
  576. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/noroff.1 > $(DESTDIR)$(MANDIR)/noroff.$(MANEXT)
  577. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/sl2h.1 > $(DESTDIR)$(MANDIR)/sl2h.$(MANEXT)
  578. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/htmltoc.1 > $(DESTDIR)$(MANDIR)/htmltoc.$(MANEXT)
  579. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nowebstyle.7 > $(DESTDIR)$(MAN7DIR)/nowebstyle.$(MAN7EXT)
  580. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nowebfilters.7 > $(DESTDIR)$(MAN7DIR)/nowebfilters.$(MAN7EXT)
  581. + $(RM) $(DESTDIR)$(MANDIR)/noweave.$(MANEXT)
  582. + (cd $(DESTDIR)$(MANDIR) && ln -s notangle.$(MANEXT) noweave.$(MANEXT))
  583. + $(RM) $(DESTDIR)$(MANDIR)/nountangle.$(MANEXT)
  584. + (cd $(DESTDIR)$(MANDIR) && ln -s notangle.$(MANEXT) nountangle.$(MANEXT))
  585. uninstall-man:
  586. - rm -f $(MANDIR)/cpif.$(MANEXT)
  587. - rm -f $(MANDIR)/nodefs.$(MANEXT)
  588. - rm -f $(MANDIR)/noroots.$(MANEXT)
  589. - rm -f $(MANDIR)/noweb.$(MANEXT)
  590. - rm -f $(MANDIR)/noindex.$(MANEXT)
  591. - rm -f $(MANDIR)/nuweb2noweb.$(MANEXT)
  592. - rm -f $(MANDIR)/notangle.$(MANEXT)
  593. - rm -f $(MANDIR)/noroff.$(MANEXT)
  594. - rm -f $(MANDIR)/sl2h.$(MANEXT)
  595. - rm -f $(MANDIR)/htmltoc.$(MANEXT)
  596. - rm -f $(MAN7DIR)/nowebstyle.$(MAN7EXT)
  597. - rm -f $(MAN7DIR)/nowebfilters.$(MAN7EXT)
  598. - rm -f $(MANDIR)/noweave.$(MANEXT)
  599. - rm -f $(MANDIR)/nountangle.$(MANEXT)
  600. + $(RM) $(DESTDIR)$(MANDIR)/cpif.$(MANEXT)
  601. + $(RM) $(DESTDIR)$(MANDIR)/nodefs.$(MANEXT)
  602. + $(RM) $(DESTDIR)$(MANDIR)/noroots.$(MANEXT)
  603. + $(RM) $(DESTDIR)$(MANDIR)/noweb.$(MANEXT)
  604. + $(RM) $(DESTDIR)$(MANDIR)/noindex.$(MANEXT)
  605. + $(RM) $(DESTDIR)$(MANDIR)/nuweb2noweb.$(MANEXT)
  606. + $(RM) $(DESTDIR)$(MANDIR)/notangle.$(MANEXT)
  607. + $(RM) $(DESTDIR)$(MANDIR)/noroff.$(MANEXT)
  608. + $(RM) $(DESTDIR)$(MANDIR)/sl2h.$(MANEXT)
  609. + $(RM) $(DESTDIR)$(MANDIR)/htmltoc.$(MANEXT)
  610. + $(RM) $(DESTDIR)$(MAN7DIR)/nowebstyle.$(MAN7EXT)
  611. + $(RM) $(DESTDIR)$(MAN7DIR)/nowebfilters.$(MAN7EXT)
  612. + $(RM) $(DESTDIR)$(MANDIR)/noweave.$(MANEXT)
  613. + $(RM) $(DESTDIR)$(MANDIR)/nountangle.$(MANEXT)
  614. install-gzipped-man:
  615. - -mkdir $(MAN) $(MANDIR) $(MAN7DIR) 2>/dev/null
  616. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/cpif.1 | gzip -9 > $(MANDIR)/cpif.$(MANEXT).gz
  617. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nodefs.1 | gzip -9 > $(MANDIR)/nodefs.$(MANEXT).gz
  618. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noroots.1 | gzip -9 > $(MANDIR)/noroots.$(MANEXT).gz
  619. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noweb.1 | gzip -9 > $(MANDIR)/noweb.$(MANEXT).gz
  620. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noindex.1 | gzip -9 > $(MANDIR)/noindex.$(MANEXT).gz
  621. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nuweb2noweb.1 | gzip -9 > $(MANDIR)/nuweb2noweb.$(MANEXT).gz
  622. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/notangle.1 | gzip -9 > $(MANDIR)/notangle.$(MANEXT).gz
  623. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noroff.1 | gzip -9 > $(MANDIR)/noroff.$(MANEXT).gz
  624. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/sl2h.1 | gzip -9 > $(MANDIR)/sl2h.$(MANEXT).gz
  625. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/htmltoc.1 | gzip -9 > $(MANDIR)/htmltoc.$(MANEXT).gz
  626. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nowebstyle.7 | gzip -9 > $(MAN7DIR)/nowebstyle.$(MAN7EXT).gz
  627. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nowebfilters.7 | gzip -9 > $(MAN7DIR)/nowebfilters.$(MAN7EXT).gz
  628. - rm -f $(MANDIR)/noweave.$(MANEXT).gz
  629. - (cd $(MANDIR); ln notangle.$(MANEXT).gz noweave.$(MANEXT).gz)
  630. - rm -f $(MANDIR)/nountangle.$(MANEXT).gz
  631. - (cd $(MANDIR); ln notangle.$(MANEXT).gz nountangle.$(MANEXT).gz)
  632. + mkdir -p $(DESTDIR)$(MANDIR) $(DESTDIR)$(MAN7DIR)
  633. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/cpif.1 | gzip -9 > $(DESTDIR)$(MANDIR)/cpif.$(MANEXT).gz
  634. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nodefs.1 | gzip -9 > $(DESTDIR)$(MANDIR)/nodefs.$(MANEXT).gz
  635. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/noroots.1 | gzip -9 > $(DESTDIR)$(MANDIR)/noroots.$(MANEXT).gz
  636. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/noweb.1 | gzip -9 > $(DESTDIR)$(MANDIR)/noweb.$(MANEXT).gz
  637. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/noindex.1 | gzip -9 > $(DESTDIR)$(MANDIR)/noindex.$(MANEXT).gz
  638. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nuweb2noweb.1 | gzip -9 > $(DESTDIR)$(MANDIR)/nuweb2noweb.$(MANEXT).gz
  639. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/notangle.1 | gzip -9 > $(DESTDIR)$(MANDIR)/notangle.$(MANEXT).gz
  640. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/noroff.1 | gzip -9 > $(DESTDIR)$(MANDIR)/noroff.$(MANEXT).gz
  641. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/sl2h.1 | gzip -9 > $(DESTDIR)$(MANDIR)/sl2h.$(MANEXT).gz
  642. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/htmltoc.1 | gzip -9 > $(DESTDIR)$(MANDIR)/htmltoc.$(MANEXT).gz
  643. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nowebstyle.7 | gzip -9 > $(DESTDIR)$(MAN7DIR)/nowebstyle.$(MAN7EXT).gz
  644. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nowebfilters.7 | gzip -9 > $(DESTDIR)$(MAN7DIR)/nowebfilters.$(MAN7EXT).gz
  645. + $(RM) $(DESTDIR)$(MANDIR)/noweave.$(MANEXT).gz
  646. + (cd $(DESTDIR)$(MANDIR) && ln -s notangle.$(MANEXT).gz noweave.$(MANEXT).gz)
  647. + $(RM) $(DESTDIR)$(MANDIR)/nountangle.$(MANEXT).gz
  648. + (cd $(DESTDIR)$(MANDIR) && ln -s notangle.$(MANEXT).gz nountangle.$(MANEXT).gz)
  649. install-preformat-man:
  650. -echo "Warning: install-preformat-man is obsolete, even on Slackware systems" 1>&2
  651. - -mkdir $(MAN) $(CATDIR) $(CAT7DIR) 2>/dev/null
  652. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/cpif.txt | gzip > $(CATDIR)/cpif.$(MANEXT).gz
  653. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nodefs.txt | gzip > $(CATDIR)/nodefs.$(MANEXT).gz
  654. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noroots.txt | gzip > $(CATDIR)/noroots.$(MANEXT).gz
  655. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noweb.txt | gzip > $(CATDIR)/noweb.$(MANEXT).gz
  656. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noindex.txt | gzip > $(CATDIR)/noindex.$(MANEXT).gz
  657. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nuweb2noweb.txt | gzip > $(CATDIR)/nuweb2noweb.$(MANEXT).gz
  658. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/notangle.txt | gzip > $(CATDIR)/notangle.$(MANEXT).gz
  659. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noroff.txt | gzip > $(CATDIR)/noroff.$(MANEXT).gz
  660. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/sl2h.txt | gzip > $(CATDIR)/sl2h.$(MANEXT).gz
  661. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/htmltoc.txt | gzip > $(CATDIR)/htmltoc.$(MANEXT).gz
  662. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nowebstyle.txt | gzip > $(CAT7DIR)/nowebstyle.$(MAN7EXT).gz
  663. - sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nowebfilters.txt | gzip > $(CAT7DIR)/nowebfilters.$(MAN7EXT).gz
  664. - rm -f $(CATDIR)/noweave.$(MANEXT).gz
  665. - (cd $(CATDIR); ln notangle.$(MANEXT).gz noweave.$(MANEXT).gz)
  666. - rm -f $(CATDIR)/nountangle.$(MANEXT).gz
  667. - (cd $(CATDIR); ln notangle.$(MANEXT).gz nountangle.$(MANEXT).gz)
  668. + mkdir -p $(DESTDIR)$(CATDIR) $(DESTDIR)$(CAT7DIR)
  669. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/cpif.txt | gzip > $(DESTDIR)$(CATDIR)/cpif.$(MANEXT).gz
  670. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nodefs.txt | gzip > $(DESTDIR)$(CATDIR)/nodefs.$(MANEXT).gz
  671. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/noroots.txt | gzip > $(DESTDIR)$(CATDIR)/noroots.$(MANEXT).gz
  672. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/noweb.txt | gzip > $(DESTDIR)$(CATDIR)/noweb.$(MANEXT).gz
  673. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/noindex.txt | gzip > $(DESTDIR)$(CATDIR)/noindex.$(MANEXT).gz
  674. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nuweb2noweb.txt | gzip > $(DESTDIR)$(CATDIR)/nuweb2noweb.$(MANEXT).gz
  675. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/notangle.txt | gzip > $(DESTDIR)$(CATDIR)/notangle.$(MANEXT).gz
  676. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/noroff.txt | gzip > $(DESTDIR)$(CATDIR)/noroff.$(MANEXT).gz
  677. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/sl2h.txt | gzip > $(DESTDIR)$(CATDIR)/sl2h.$(MANEXT).gz
  678. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/htmltoc.txt | gzip > $(DESTDIR)$(CATDIR)/htmltoc.$(MANEXT).gz
  679. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nowebstyle.txt | gzip > $(DESTDIR)$(CAT7DIR)/nowebstyle.$(MAN7EXT).gz
  680. + sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nowebfilters.txt | gzip > $(DESTDIR)$(CAT7DIR)/nowebfilters.$(MAN7EXT).gz
  681. + $(RM) $(DESTDIR)$(CATDIR)/noweave.$(MANEXT).gz
  682. + (cd $(DESTDIR)$(CATDIR) && ln -s notangle.$(MANEXT).gz noweave.$(MANEXT).gz)
  683. + $(RM) $(DESTDIR)$(CATDIR)/nountangle.$(MANEXT).gz
  684. + (cd $(DESTDIR)$(CATDIR) && ln -s notangle.$(MANEXT).gz nountangle.$(MANEXT).gz)
  685. install-tex:
  686. - -mkdir $(TEXINPUTS) 2>/dev/null
  687. - cp tex/nwmac.tex tex/noweb.sty $(TEXINPUTS)
  688. + mkdir -p $(DESTDIR)$(TEXINPUTS)
  689. + cp tex/nwmac.tex tex/noweb.sty $(DESTDIR)$(TEXINPUTS)
  690. -texhash || echo "Program texhash not found or failed"
  691. uninstall-tex:
  692. - rm -f $(TEXINPUTS)/nwmac.tex $(TEXINPUTS)/noweb.sty
  693. + $(RM) $(DESTDIR)$(TEXINPUTS)/nwmac.tex $(DESTDIR)$(TEXINPUTS)/noweb.sty
  694. install-elisp:
  695. - -mkdir $(ELISP) 2>/dev/null
  696. - cp elisp/noweb-mode.el $(ELISP)
  697. + mkdir -p $(DESTDIR)$(ELISP)
  698. + cp elisp/noweb-mode.el $(DESTDIR)$(ELISP)
  699. uninstall-elisp:
  700. - rm -f $(ELISP)/noweb-mode.el
  701. + $(RM) $(DESTDIR)$(ELISP)/noweb-mode.el
  702. checkin:
  703. - for i in lib tex xdoc; do (cd $$i; make "CINAME=$(CINAME)" "CIMSG=$(CIMSG)" checkin); done
  704. + for i in lib tex xdoc; do ($(MAKE) -C $$i "CINAME=$(CINAME)" "CIMSG=$(CIMSG)" checkin); done
  705. for i in c icon awk; do (cd $$i; ci -l $(CINAME) $(CIMSG) *.nw Makefile); done
  706. (cd elisp; ci -l $(CINAME) $(CIMSG) *.el)
  707. ci -l $(CINAME) $(CIMSG) Makefile.nw INSTALL INSTALL.DOS README FAQ COPYRIGHT nwmake *.nw
  708. source: FAQ
  709. - for i in c shell lib xdoc icon awk tex; do (cd $$i; make CPIF=">" source); done
  710. + for i in c shell lib xdoc icon awk tex; do ($(MAKE) -C $$i CPIF=">" source); done
  711. sleep 1
  712. - for i in c shell lib xdoc icon awk tex; do (cd $$i; make touch); done
  713. + for i in c shell lib xdoc icon awk tex; do ($(MAKE) -C $$i touch); done
  714. touch:
  715. touch FAQ
  716. - for i in c shell lib xdoc icon awk tex; do (cd $$i; make touch); done
  717. + for i in c shell lib xdoc icon awk tex; do ($(MAKE) -C $$i touch); done
  718. clean:
  719. - for i in c shell lib xdoc icon awk tex; do (cd $$i; make clean); done
  720. - rm -f nwsrcfilter *~ */*~
  721. + for i in c shell lib xdoc icon awk tex; do ($(MAKE) -C $$i clean); done
  722. + $(RM) nwsrcfilter *~ */*~
  723. clobber: clean
  724. - for i in c lib icon awk xdoc; do (cd $$i; make clobber); done
  725. + for i in c lib icon awk xdoc; do ($(MAKE) -C $$i clobber); done
  726. Makefile: Makefile.nw
  727. - chmod +w Makefile
  728. - notangle -R'script' Makefile.nw | sh > Makefile
  729. - chmod -w Makefile
  730. + chmod +w $@
  731. + notangle -R'script' $< | sh > $@
  732. + chmod -w $@
  733. diff --git a/src/Makefile.nw b/src/Makefile.nw
  734. --- a/src/Makefile.nw
  735. +++ b/src/Makefile.nw
  736. @@ -32,7 +32,7 @@
  737. ELISP=/dev/null
  738. # change WEAVE if you want a different version of noweave to be installed
  739. -WEAVE=noweave
  740. +WEAVE=noweave
  741. # Stop editing. No user-serviceable parts below.
  742. SHELL=/bin/sh
  743. @@ -42,46 +42,44 @@
  744. MAN7DIR=$(MAN)/man$(MAN7EXT)
  745. CATDIR=$(MAN)/cat$(MANEXT)
  746. CAT7DIR=$(MAN)/cat$(MAN7EXT)
  747. -LIBNAME=$(LIB)
  748. -TEXNAME=$(TEXINPUTS)
  749. -all:
  750. - cd c; make "CC=$(CC)" "CFLAGS=$(CFLAGS)" all
  751. - for i in shell lib xdoc tex; do (cd $$i; make all); done
  752. - cd $(LIBSRC); make "ICONT=$(ICONT)" "ICONC=$(ICONC)" all
  753. +all:
  754. + $(MAKE) -C c "CC=$(CC)" "CFLAGS=$(CFLAGS)" all
  755. + for i in shell lib xdoc tex; do ($(MAKE) -C $$i all); done
  756. + $(MAKE) -C $(LIBSRC) "ICONT=$(ICONT)" "ICONC=$(ICONC)" all
  757. FAQ: FAQ.html
  758. - sleep 1; html2ascii FAQ.html > FAQ
  759. + sleep 1; html2ascii $< > $@
  760. FAQ.html: $(HOME)/www/noweb/FAQ.html
  761. - rm -f FAQ.html
  762. - /bin/cp $(HOME)/www/noweb/FAQ.html FAQ.html
  763. - chmod -w FAQ.html
  764. + $(RM) $@
  765. + cp $< $@
  766. + chmod -w $@
  767. install: install-code install-man install-tex install-elisp
  768. uninstall: uninstall-code uninstall-man uninstall-tex uninstall-elisp
  769. - -rmdir $(BIN) $(LIB) 2>/dev/null
  770. + -rmdir $(DESTDIR)$(BIN) $(DESTDIR)$(LIB) 2>/dev/null
  771. install-shell:
  772. - -mkdir $(BIN) $(LIB) 2>/dev/null
  773. + mkdir -p $(DESTDIR)$(BIN) $(DESTDIR)$(LIB)
  774. <<shell binaries>>
  775. - cp shell/tmac.w $(LIB)
  776. + cp shell/tmac.w $(DESTDIR)$(LIB)
  777. uninstall-shell:
  778. <<uninstall shell binaries>>
  779. - rm $(LIB)/tmac.w
  780. + $(RM) $(DESTDIR)$(LIB)/tmac.w
  781. install-code: install-shell
  782. - -mkdir $(BIN) $(LIB) 2>/dev/null
  783. + mkdir -p $(DESTDIR)$(BIN) $(DESTDIR)$(LIB)
  784. strip c/nt c/markup c/mnt c/finduses
  785. - cp c/nt c/markup c/mnt c/finduses $(LIB)
  786. - cd $(LIBSRC); make ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) install
  787. - cd lib; make LIB=$(LIB) install
  788. + cp c/nt c/markup c/mnt c/finduses $(DESTDIR)$(LIB)
  789. + $(MAKE) -C $(LIBSRC) DESTDIR=$(DESTDIR) ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) install
  790. + $(MAKE) -C lib DESTDIR=$(DESTDIR) LIB=$(LIB) install
  791. uninstall-code: uninstall-shell
  792. - rm $(LIB)/nt $(LIB)/markup $(LIB)/mnt $(LIB)/finduses
  793. - cd $(LIBSRC); make ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) uninstall
  794. - cd lib; make LIB=$(LIB) uninstall
  795. + $(RM) $(DESTDIR)$(LIB)/nt $(DESTDIR)$(LIB)/markup $(DESTDIR)$(LIB)/mnt $(DESTDIR)$(LIB)/finduses
  796. + $(MAKE) -C $(LIBSRC) DESTDIR=$(DESTDIR) ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) uninstall
  797. + $(MAKE) -C lib DESTDIR=$(DESTDIR) LIB=$(LIB) uninstall
  798. @ I do the [[<<shell binaries>>]] before [[$(LIBSRC)]] so that the
  799. Icon version of [[htmltoc]], if present, will overwrite the Perl
  800. version.
  801. @@ -91,36 +89,36 @@
  802. noroff
  803. do
  804. echo '@<<shell binaries@>>='
  805. - echo 'sed "s@|LIBDIR|@$(LIBNAME)@"' "shell/$i" '> $(BIN)/'"$i"
  806. - echo 'chmod +x $(BIN)/'"$i"
  807. + echo 'sed "s@|LIBDIR|@$(LIB)@"' "shell/$i" '> $(DESTDIR)$(BIN)/'"$i"
  808. + echo 'chmod +x $(DESTDIR)$(BIN)/'"$i"
  809. echo '@<<uninstall shell binaries@>>='
  810. - echo 'rm -f $(BIN)/'"$i"
  811. + echo '$(RM) $(DESTDIR)$(BIN)/'"$i"
  812. done
  813. for i in toroff
  814. do
  815. echo '@<<shell binaries@>>='
  816. - echo 'sed "s@|LIBDIR|@$(LIBNAME)@"' "shell/$i" '> $(LIB)/'"$i"
  817. - echo 'chmod +x $(LIB)/'"$i"
  818. + echo 'sed "s@|LIBDIR|@$(LIB)@"' "shell/$i" '> $(DESTDIR)$(LIB)/'"$i"
  819. + echo 'chmod +x $(DESTDIR)$(LIB)/'"$i"
  820. echo '@<<uninstall shell binaries@>>='
  821. - echo 'rm -f $(LIB)/'"$i"
  822. + echo '$(RM) $(DESTDIR)$(LIB)/'"$i"
  823. done
  824. <<*>>=
  825. install-man:
  826. - -mkdir $(MAN) $(MANDIR) $(MAN7DIR) 2>/dev/null
  827. + mkdir -p $(DESTDIR)$(MANDIR) $(DESTDIR)$(MAN7DIR)
  828. <<ordinary pages>>
  829. uninstall-man:
  830. <<uninstall ordinary pages>>
  831. -@
  832. +@
  833. Slackware no longer uses preformatted compressed pages, just
  834. compressed pages.
  835. <<*>>=
  836. install-gzipped-man:
  837. - -mkdir $(MAN) $(MANDIR) $(MAN7DIR) 2>/dev/null
  838. + mkdir -p $(DESTDIR)$(MANDIR) $(DESTDIR)$(MAN7DIR)
  839. <<compressed pages>>
  840. <<*>>=
  841. install-preformat-man:
  842. -echo "Warning: install-preformat-man is obsolete, even on Slackware systems" 1>&2
  843. - -mkdir $(MAN) $(CATDIR) $(CAT7DIR) 2>/dev/null
  844. + mkdir -p $(DESTDIR)$(CATDIR) $(DESTDIR)$(CAT7DIR)
  845. <<preformatted compressed pages>>
  846. <<generate chunks>>=
  847. NORMALPAGES="cpif nodefs noroots noweb noindex nuweb2noweb notangle noroff sl2h htmltoc"
  848. @@ -130,96 +128,96 @@
  849. for i in $NORMALPAGES; do
  850. echo '@<<ordinary pages@>>='
  851. - echo 'sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@"' \
  852. - "xdoc/$i.1" '> $(MANDIR)/'"$i"'.$(MANEXT)'
  853. + echo 'sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@"' \
  854. + "xdoc/$i.1" '> $(DESTDIR)$(MANDIR)/'"$i"'.$(MANEXT)'
  855. echo '@<<uninstall ordinary pages@>>='
  856. - echo 'rm -f $(MANDIR)/'"$i"'.$(MANEXT)'
  857. + echo '$(RM) $(DESTDIR)$(MANDIR)/'"$i"'.$(MANEXT)'
  858. done
  859. for i in $NORMAL7PAGES; do
  860. echo '@<<ordinary pages@>>='
  861. - echo 'sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@"' \
  862. - "xdoc/$i.7" '> $(MAN7DIR)/'"$i"'.$(MAN7EXT)'
  863. + echo 'sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@"' \
  864. + "xdoc/$i.7" '> $(DESTDIR)$(MAN7DIR)/'"$i"'.$(MAN7EXT)'
  865. echo '@<<uninstall ordinary pages@>>='
  866. - echo 'rm -f $(MAN7DIR)/'"$i"'.$(MAN7EXT)'
  867. + echo '$(RM) $(DESTDIR)$(MAN7DIR)/'"$i"'.$(MAN7EXT)'
  868. done
  869. for i in $LINKPAGES; do
  870. echo '@<<ordinary pages@>>='
  871. - echo 'rm -f $(MANDIR)/'"$i"'.$(MANEXT)'
  872. - echo '(cd $(MANDIR); ln notangle.$(MANEXT)' "$i"'.$(MANEXT))'
  873. + echo '$(RM) $(DESTDIR)$(MANDIR)/'"$i"'.$(MANEXT)'
  874. + echo '(cd $(DESTDIR)$(MANDIR) && ln -s notangle.$(MANEXT)' "$i"'.$(MANEXT))'
  875. echo '@<<uninstall ordinary pages@>>='
  876. - echo 'rm -f $(MANDIR)/'"$i"'.$(MANEXT)'
  877. + echo '$(RM) $(DESTDIR)$(MANDIR)/'"$i"'.$(MANEXT)'
  878. done
  879. echo '@<<compressed pages@>>='
  880. for i in $NORMALPAGES; do
  881. - echo 'sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@"' \
  882. - "xdoc/$i.1" ' | gzip -9 > $(MANDIR)/'"$i"'.$(MANEXT).gz'
  883. + echo 'sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@"' \
  884. + "xdoc/$i.1" ' | gzip -9 > $(DESTDIR)$(MANDIR)/'"$i"'.$(MANEXT).gz'
  885. done
  886. for i in $NORMAL7PAGES; do
  887. - echo 'sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@"' \
  888. - "xdoc/$i.7" ' | gzip -9 > $(MAN7DIR)/'"$i"'.$(MAN7EXT).gz'
  889. + echo 'sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@"' \
  890. + "xdoc/$i.7" ' | gzip -9 > $(DESTDIR)$(MAN7DIR)/'"$i"'.$(MAN7EXT).gz'
  891. done
  892. for i in $LINKPAGES; do
  893. - echo 'rm -f $(MANDIR)/'"$i"'.$(MANEXT).gz'
  894. - echo '(cd $(MANDIR); ln notangle.$(MANEXT).gz' "$i"'.$(MANEXT).gz)'
  895. + echo '$(RM) $(DESTDIR)$(MANDIR)/'"$i"'.$(MANEXT).gz'
  896. + echo '(cd $(DESTDIR)$(MANDIR) && ln -s notangle.$(MANEXT).gz' "$i"'.$(MANEXT).gz)'
  897. done
  898. echo '@<<preformatted compressed pages@>>='
  899. for i in $NORMALPAGES; do
  900. - echo 'sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@"' \
  901. - "xdoc/$i.txt" ' | gzip > $(CATDIR)/'"$i"'.$(MANEXT).gz'
  902. + echo 'sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@"' \
  903. + "xdoc/$i.txt" ' | gzip > $(DESTDIR)$(CATDIR)/'"$i"'.$(MANEXT).gz'
  904. done
  905. for i in $NORMAL7PAGES; do
  906. - echo 'sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@"' \
  907. - "xdoc/$i.txt" ' | gzip > $(CAT7DIR)/'"$i"'.$(MAN7EXT).gz'
  908. + echo 'sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@"' \
  909. + "xdoc/$i.txt" ' | gzip > $(DESTDIR)$(CAT7DIR)/'"$i"'.$(MAN7EXT).gz'
  910. done
  911. for i in $LINKPAGES; do
  912. - echo 'rm -f $(CATDIR)/'"$i"'.$(MANEXT).gz'
  913. - echo '(cd $(CATDIR); ln notangle.$(MANEXT).gz' "$i"'.$(MANEXT).gz)'
  914. + echo '$(RM) $(DESTDIR)$(CATDIR)/'"$i"'.$(MANEXT).gz'
  915. + echo '(cd $(DESTDIR)$(CATDIR) && ln -s notangle.$(MANEXT).gz' "$i"'.$(MANEXT).gz)'
  916. done
  917. <<*>>=
  918. install-tex:
  919. - -mkdir $(TEXINPUTS) 2>/dev/null
  920. - cp tex/nwmac.tex tex/noweb.sty $(TEXINPUTS)
  921. + mkdir -p $(DESTDIR)$(TEXINPUTS)
  922. + cp tex/nwmac.tex tex/noweb.sty $(DESTDIR)$(TEXINPUTS)
  923. -texhash || echo "Program texhash not found or failed"
  924. uninstall-tex:
  925. - rm -f $(TEXINPUTS)/nwmac.tex $(TEXINPUTS)/noweb.sty
  926. + $(RM) $(DESTDIR)$(TEXINPUTS)/nwmac.tex $(DESTDIR)$(TEXINPUTS)/noweb.sty
  927. install-elisp:
  928. - -mkdir $(ELISP) 2>/dev/null
  929. - cp elisp/noweb-mode.el $(ELISP)
  930. + mkdir -p $(DESTDIR)$(ELISP)
  931. + cp elisp/noweb-mode.el $(DESTDIR)$(ELISP)
  932. uninstall-elisp:
  933. - rm -f $(ELISP)/noweb-mode.el
  934. -@
  935. + $(RM) $(DESTDIR)$(ELISP)/noweb-mode.el
  936. +@
  937. <<*>>=
  938. checkin:
  939. - for i in lib tex xdoc; do (cd $$i; make "CINAME=$(CINAME)" "CIMSG=$(CIMSG)" checkin); done
  940. + for i in lib tex xdoc; do ($(MAKE) -C $$i "CINAME=$(CINAME)" "CIMSG=$(CIMSG)" checkin); done
  941. for i in c icon awk; do (cd $$i; ci -l $(CINAME) $(CIMSG) *.nw Makefile); done
  942. (cd elisp; ci -l $(CINAME) $(CIMSG) *.el)
  943. ci -l $(CINAME) $(CIMSG) Makefile.nw INSTALL INSTALL.DOS README FAQ COPYRIGHT nwmake *.nw
  944. source: FAQ
  945. - for i in c shell lib xdoc icon awk tex; do (cd $$i; make CPIF=">" source); done
  946. + for i in c shell lib xdoc icon awk tex; do ($(MAKE) -C $$i CPIF=">" source); done
  947. sleep 1
  948. - for i in c shell lib xdoc icon awk tex; do (cd $$i; make touch); done
  949. + for i in c shell lib xdoc icon awk tex; do ($(MAKE) -C $$i touch); done
  950. touch:
  951. touch FAQ
  952. - for i in c shell lib xdoc icon awk tex; do (cd $$i; make touch); done
  953. + for i in c shell lib xdoc icon awk tex; do ($(MAKE) -C $$i touch); done
  954. clean:
  955. - for i in c shell lib xdoc icon awk tex; do (cd $$i; make clean); done
  956. - rm -f nwsrcfilter *~ */*~
  957. + for i in c shell lib xdoc icon awk tex; do ($(MAKE) -C $$i clean); done
  958. + $(RM) nwsrcfilter *~ */*~
  959. clobber: clean
  960. - for i in c lib icon awk xdoc; do (cd $$i; make clobber); done
  961. + for i in c lib icon awk xdoc; do ($(MAKE) -C $$i clobber); done
  962. Makefile: Makefile.nw
  963. - chmod +w Makefile
  964. - notangle -R'script' Makefile.nw | sh > Makefile
  965. - chmod -w Makefile
  966. + chmod +w $@
  967. + notangle -R'script' $< | sh > $@
  968. + chmod -w $@
  969. diff --git a/src/awk/Makefile b/src/awk/Makefile
  970. --- a/src/awk/Makefile
  971. +++ b/src/awk/Makefile
  972. @@ -6,33 +6,34 @@
  973. SHELL=/bin/sh
  974. LIBEXECS=totex noidx tohtml
  975. -BINEXECS=noindex
  976. +BINEXECS=noindex
  977. EXECS=$(BINEXECS) $(LIBEXECS)
  978. -all: $(EXECS)
  979. +all: $(EXECS)
  980. chmod +x $(EXECS)
  981. sources: $(EXECS)
  982. touch: $(EXECS)
  983. touch $(EXECS)
  984. install: all
  985. - cp $(LIBEXECS) $(LIB)
  986. - cp $(BINEXECS) $(BIN)
  987. + cp $(LIBEXECS) $(DESTDIR)$(LIB)
  988. + cp $(BINEXECS) $(DESTDIR)$(BIN)
  989. source: $(EXECS)
  990. totex: totex.nw
  991. - notangle -Rtotex totex.nw > totex
  992. + notangle -Rtotex $< > $@
  993. noidx: noidx.nw
  994. - notangle noidx.nw > noidx
  995. + notangle $< > $@
  996. tohtml: tohtml.nw
  997. - notangle tohtml.nw > tohtml
  998. + notangle $< > $@
  999. -noindex: noindex.nw
  1000. - notangle -Rnoindex noindex.nw > noindex
  1001. +noindex: noindex.nw
  1002. + notangle -Rnoindex $< > $@
  1003. -clean: ; rm -f *.log *.blg *.dvi *.toc *.aux *.tex *~ *.html
  1004. +clean:
  1005. + $(RM) *.log *.blg *.dvi *.toc *.aux *.tex *~ *.html
  1006. clobber: clean
  1007. - rm -f totex noidx tohtml noindex
  1008. + $(RM) totex noidx tohtml noindex
  1009. diff --git a/src/c/Makefile b/src/c/Makefile
  1010. --- a/src/c/Makefile
  1011. +++ b/src/c/Makefile
  1012. @@ -14,15 +14,15 @@
  1013. main.o errors.o columns.o
  1014. MARKUPOBJS=markmain.o strsave.o markup.o errors.o getline.o columns.o
  1015. FILES=markmain.nw markup.nw \
  1016. - main.nw notangle.nw match.nw mnt.nw modules.nw modtrees.nw \
  1017. - finduses.nw recognize.nw \
  1018. - getline.nw columns.nw errors.nw strsave.nw
  1019. + main.nw notangle.nw match.nw mnt.nw modules.nw modtrees.nw \
  1020. + finduses.nw recognize.nw \
  1021. + getline.nw columns.nw errors.nw strsave.nw
  1022. SRCS=columns.h errors.h getline.h markup.h match.h modtrees.h \
  1023. modules.h notangle.h recognize.h strsave.h \
  1024. columns.c errors.c getline.c finduses.c main.c markmain.c markup.c match.c \
  1025. mnt.c modtrees.c modules.c notangle.c readme.c recognize.c strsave.c \
  1026. - markup.ps
  1027. + markup.ps
  1028. NAME='name of RCS version'
  1029. NOTANGLE=notangle
  1030. @@ -32,76 +32,76 @@
  1031. CPIF=>
  1032. .SUFFIXES: .nw .tex .dvi .h
  1033. -.nw.tex: ; noweave $*.nw >$*.tex
  1034. -.nw.c: ; $(NOTANGLE) -L $*.nw >$*.c
  1035. -.nw.o: ; $(NOTANGLE) -L $*.nw >$*.c
  1036. - $(CC) $(CFLAGS) -c $*.c
  1037. -.nw.h: ; $(NOTANGLE) -Rheader $*.nw $(CPIF) $*.h
  1038. +.nw.tex:
  1039. + noweave $*.nw >$*.tex
  1040. +.nw.c:
  1041. + $(NOTANGLE) -L $*.nw >$*.c
  1042. +.nw.o:
  1043. + $(NOTANGLE) -L $*.nw >$*.c
  1044. + $(CC) $(CFLAGS) -c $*.c
  1045. +.nw.h:
  1046. + $(NOTANGLE) -Rheader $*.nw $(CPIF) $*.h
  1047. -all: nt markup mnt finduses
  1048. +all: nt markup mnt finduses
  1049. -nt: $(TANGLEOBJS)
  1050. - $(CC) $(CFLAGS) -o nt $(TANGLEOBJS)
  1051. +nt: $(TANGLEOBJS)
  1052. + $(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@
  1053. -finduses: $(FINDUSESOBJS)
  1054. - $(CC) $(CFLAGS) -o finduses $(FINDUSESOBJS)
  1055. +finduses: $(FINDUSESOBJS)
  1056. +markup: $(MARKUPOBJS)
  1057. +mnt: $(MNTOBJS)
  1058. -markup: $(MARKUPOBJS)
  1059. - $(CC) $(CFLAGS) -o markup $(MARKUPOBJS)
  1060. -
  1061. -mnt: $(MNTOBJS)
  1062. - $(CC) $(CFLAGS) -o mnt $(MNTOBJS)
  1063. -
  1064. -source: $(SRCS)
  1065. +source: $(SRCS)
  1066. touch: $(SRCS)
  1067. touch $(SRCS)
  1068. -clean: ; rm -f nt markup mnt finduses fakepretty
  1069. - rm -f core *.makelog *.tex *.log *.blg *.dvi *.o *.toc *~
  1070. - rm -f *.atac *.trace *.html
  1071. +clean:
  1072. + $(RM) nt markup mnt finduses fakepretty
  1073. + $(RM) core *.makelog *.tex *.log *.blg *.dvi *.o *.toc *~
  1074. + $(RM) *.atac *.trace *.html
  1075. -clobber: clean
  1076. - rm -f $(SRCS) fakepretty.c pretty.[ch]
  1077. +clobber: clean
  1078. + $(RM) $(SRCS) fakepretty.c pretty.[ch]
  1079. -checkin: $(FILES) doc.nw
  1080. - ci $(CINAME) $(CIMSG) -l $(FILES) doc.nw
  1081. +checkin: $(FILES) doc.nw
  1082. + ci $(CINAME) $(CIMSG) -l $(FILES) doc.nw
  1083. -doc.tex: doc.nw
  1084. - cp doc.nw doc.tex
  1085. +doc.tex: doc.nw
  1086. + cp $< $@
  1087. allcode.tex: $(FILES)
  1088. - noweave -n -index $(FILES) > allcode.tex
  1089. + noweave -n -index $^ > $@
  1090. -doc.dvi: doc.tex allcode.tex
  1091. - latex doc; latex doc; latex doc
  1092. +doc.dvi: doc.tex allcode.tex
  1093. + latex doc
  1094. + latex doc
  1095. + latex doc
  1096. doc.ps: doc.dvi
  1097. dvips doc
  1098. markup.ps: markmain.nw
  1099. - notangle -Rmarkup.dot markmain.nw | dot -Tps > markup.ps
  1100. + notangle -Rmarkup.dot $< | dot -Tps > $@
  1101. FPOBJS=fakepretty.o pretty.o errors.o getline.o match.o strsave.o columns.o
  1102. fakepretty.o: pretty.h
  1103. fakepretty: $(FPOBJS)
  1104. - $(CC) $(CFLAGS) -o fakepretty $(FPOBJS)
  1105. -
  1106. -columns.o: columns.h
  1107. -errors.o: errors.h
  1108. -finduses.o: errors.h match.h getline.h recognize.h
  1109. -getline.o: columns.h errors.h getline.h
  1110. +columns.o: columns.h
  1111. +errors.o: errors.h
  1112. +finduses.o: errors.h match.h getline.h recognize.h
  1113. +getline.o: columns.h errors.h getline.h
  1114. main.o: notangle.h errors.h columns.h modules.h modtrees.h
  1115. -markmain.o: errors.h markup.h getline.h columns.h
  1116. -markup.o: markup.h strsave.h errors.h
  1117. -match.o: match.h
  1118. -mnt.o: modules.h modtrees.h notangle.h errors.h columns.h strsave.h
  1119. -modtrees.o: strsave.h modules.h modtrees.h errors.h
  1120. -modules.o: modules.h modtrees.h errors.h columns.h strsave.h
  1121. -notangle.o: strsave.h getline.h modules.h modtrees.h errors.h match.h notangle.h
  1122. -pretty.o: getline.h match.h errors.h pretty.h strsave.h
  1123. -readme.o:
  1124. -recognize.o:
  1125. -strsave.o: strsave.h errors.h
  1126. +markmain.o: errors.h markup.h getline.h columns.h
  1127. +markup.o: markup.h strsave.h errors.h
  1128. +match.o: match.h
  1129. +mnt.o: modules.h modtrees.h notangle.h errors.h columns.h strsave.h
  1130. +modtrees.o: strsave.h modules.h modtrees.h errors.h
  1131. +modules.o: modules.h modtrees.h errors.h columns.h strsave.h
  1132. +notangle.o: strsave.h getline.h modules.h modtrees.h errors.h match.h notangle.h
  1133. +pretty.o: getline.h match.h errors.h pretty.h strsave.h
  1134. +readme.o:
  1135. +recognize.o:
  1136. +strsave.o: strsave.h errors.h
  1137. diff --git a/src/icon/Makefile b/src/icon/Makefile
  1138. --- a/src/icon/Makefile
  1139. +++ b/src/icon/Makefile
  1140. @@ -6,13 +6,13 @@
  1141. CPIF=| cpif # change to ">" to insure all sources always made
  1142. LIBEXECS=totex disambiguate noidx tohtml elide l2h docs2comments \
  1143. - autodefs.tex autodefs.icon autodefs.yacc autodefs.sml autodefs.pascal \
  1144. + autodefs.tex autodefs.icon autodefs.yacc autodefs.sml autodefs.pascal \
  1145. autodefs.promela autodefs.lrtl autodefs.asdl autodefs.mmix xchunks pipedocs
  1146. LIBSPECIAL=autodefs.cee
  1147. BINEXECS=noindex sl2h htmltoc
  1148. EXECS=$(LIBEXECS) $(BINEXECS) $(LIBSPECIAL)
  1149. SRCS=totex.icn disambiguate.icn noidx.icn texdefs.icn icondefs.icn \
  1150. - yaccdefs.icn noindex.icn smldefs.icn tohtml.icn cdefs.icn elide.icn \
  1151. + yaccdefs.icn noindex.icn smldefs.icn tohtml.icn cdefs.icn elide.icn \
  1152. l2h.icn sl2h.icn pascaldefs.icn promeladefs.icn lrtldefs.icn asdldefs.icn \
  1153. mmixdefs.icn htmltoc.icn xchunks.icn
  1154. @@ -32,112 +32,112 @@
  1155. touch $(SRCS)
  1156. install: $(EXECS)
  1157. - cp $(LIBEXECS) $(LIB)
  1158. - cp $(BINEXECS) $(BIN)
  1159. - cp $(LIBSPECIAL) $(LIB)/autodefs.c
  1160. + cp $(LIBEXECS) $(DESTDIR)$(LIB)
  1161. + cp $(BINEXECS) $(DESTDIR)$(BIN)
  1162. + cp $(LIBSPECIAL) $(DESTDIR)$(LIB)/autodefs.c
  1163. clean:
  1164. - /bin/rm -f *.tex *.dvi *.aux *.log *.blg *.bbl *~ *.toc *.html *.u1 *.u2
  1165. - /bin/rm -f *.[ch] *.ps *.gz
  1166. - /bin/rm -f $(EXECS)
  1167. - /bin/rm -f sl2h
  1168. + $(RM) *.tex *.dvi *.aux *.log *.blg *.bbl *~ *.toc *.html *.u1 *.u2
  1169. + $(RM) *.[ch] *.ps *.gz
  1170. + $(RM) $(EXECS)
  1171. + $(RM) sl2h
  1172. clobber: clean
  1173. - /bin/rm -f *.icn
  1174. + $(RM) *.icn
  1175. texdefs.icn: texdefs.nw defns.nw
  1176. - notangle -L'#line %-1L "%F"%N' texdefs.nw defns.nw $(CPIF) texdefs.icn
  1177. + notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
  1178. icondefs.icn: icondefs.nw defns.nw
  1179. - notangle -L'#line %-1L "%F"%N' icondefs.nw defns.nw $(CPIF) icondefs.icn
  1180. + notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
  1181. yaccdefs.icn: yaccdefs.nw defns.nw
  1182. - notangle -L'#line %-1L "%F"%N' yaccdefs.nw defns.nw $(CPIF) yaccdefs.icn
  1183. + notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
  1184. smldefs.icn: smldefs.nw defns.nw
  1185. - notangle -L'#line %-1L "%F"%N' smldefs.nw defns.nw $(CPIF) smldefs.icn
  1186. + notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
  1187. cdefs.icn: cdefs.nw defns.nw
  1188. - notangle -L'#line %-1L "%F"%N' cdefs.nw defns.nw $(CPIF) cdefs.icn
  1189. + notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
  1190. pascaldefs.icn: pascaldefs.nw defns.nw
  1191. - notangle -L'#line %-1L "%F"%N' pascaldefs.nw defns.nw $(CPIF) pascaldefs.icn
  1192. + notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
  1193. promeladefs.icn: promeladefs.nw defns.nw
  1194. - notangle -L'#line %-1L "%F"%N' promeladefs.nw defns.nw $(CPIF) promeladefs.icn
  1195. + notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
  1196. lrtldefs.icn: lrtldefs.nw defns.nw
  1197. - notangle -L'#line %-1L "%F"%N' lrtldefs.nw defns.nw $(CPIF) lrtldefs.icn
  1198. + notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
  1199. asdldefs.icn: asdldefs.nw defns.nw
  1200. - notangle -L'#line %-1L "%F"%N' asdldefs.nw defns.nw $(CPIF) asdldefs.icn
  1201. + notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
  1202. mmixdefs.icn: mmixdefs.nw defns.nw
  1203. - notangle -L'#line %-1L "%F"%N' mmixdefs.nw defns.nw $(CPIF) mmixdefs.icn
  1204. + notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
  1205. autodefs.tex: texdefs.icn
  1206. - $(ICONT) -o autodefs.tex texdefs.icn
  1207. + $(ICONT) -o $@ $<
  1208. autodefs.icon: icondefs.icn
  1209. - $(ICONC) -o autodefs.icon icondefs.icn
  1210. + $(ICONC) -o $@ $<
  1211. autodefs.yacc: yaccdefs.icn
  1212. - $(ICONT) -o autodefs.yacc yaccdefs.icn
  1213. + $(ICONT) -o $@ $<
  1214. autodefs.sml: smldefs.icn
  1215. - $(ICONT) -o autodefs.sml smldefs.icn
  1216. + $(ICONT) -o $@ $<
  1217. autodefs.cee: cdefs.icn
  1218. - $(ICONT) -o autodefs.cee cdefs.icn
  1219. + $(ICONT) -o $@ $<
  1220. autodefs.pascal: pascaldefs.icn
  1221. - $(ICONT) -o autodefs.pascal pascaldefs.icn
  1222. + $(ICONT) -o $@ $<
  1223. autodefs.promela: promeladefs.icn
  1224. - $(ICONT) -o autodefs.promela promeladefs.icn
  1225. + $(ICONT) -o $@ $<
  1226. autodefs.lrtl: lrtldefs.icn
  1227. - $(ICONT) -o autodefs.lrtl lrtldefs.icn
  1228. + $(ICONT) -o $@ $<
  1229. autodefs.asdl: asdldefs.icn
  1230. - $(ICONT) -o autodefs.asdl asdldefs.icn
  1231. + $(ICONT) -o $@ $<
  1232. autodefs.mmix: mmixdefs.icn
  1233. - $(ICONT) -o autodefs.mmix mmixdefs.icn
  1234. + $(ICONT) -o $@ $<
  1235. totex: totex.icn
  1236. - $(ICONC) totex.icn
  1237. + $(ICONC) $<
  1238. totexnr: totexnr.icn
  1239. - $(ICONT) totexnr.icn
  1240. + $(ICONT) $<
  1241. tohtml: tohtml.icn
  1242. - $(ICONC) tohtml.icn
  1243. + $(ICONC) $<
  1244. docs2comments: docs2comments.icn
  1245. - $(ICONT) docs2comments.icn # no longer compiles with iconc
  1246. + $(ICONT) $< # no longer compiles with iconc
  1247. xchunks: xchunks.icn
  1248. - $(ICONT) xchunks.icn
  1249. + $(ICONT) $<
  1250. l2h.icn: l2h.nw
  1251. - notangle -L'#line %-1L "%F"%N' -R'l2h.icn' l2h.nw $(CPIF) l2h.icn
  1252. + notangle -L'#line %-1L "%F"%N' -R'l2h.icn' $< $(CPIF) $@
  1253. l2h: l2h.icn
  1254. - $(ICONT) -o l2h l2h.icn # no longer compiles with iconc
  1255. + $(ICONT) -o $@ $< # no longer compiles with iconc
  1256. sl2h.icn: l2h.nw
  1257. - notangle -L'#line %-1L "%F"%N' -R'sl2h.icn' l2h.nw $(CPIF) sl2h.icn
  1258. + notangle -L'#line %-1L "%F"%N' -R'sl2h.icn' $< $(CPIF) $@
  1259. sl2h: sl2h.icn
  1260. - $(ICONT) -o sl2h sl2h.icn # no longer compiles with iconc
  1261. + $(ICONT) -o $@ $< # no longer compiles with iconc
  1262. noindex: noindex.icn
  1263. - $(ICONT) noindex.icn
  1264. + $(ICONT) $<
  1265. noidx: noidx.icn
  1266. - $(ICONT) noidx.icn # no longer compiles with iconc
  1267. + $(ICONT) $< # no longer compiles with iconc
  1268. elide: elide.icn
  1269. - $(ICONT) elide.icn
  1270. + $(ICONT) $<
  1271. pipedocs: pipedocs.icn
  1272. - $(ICONT) pipedocs.icn
  1273. + $(ICONT) $<
  1274. pdcached: pdcached.icn
  1275. - $(ICONT) pdcached.icn
  1276. + $(ICONT) $<
  1277. disambiguate: disambiguate.icn
  1278. - $(ICONT) disambiguate.icn
  1279. + $(ICONT) $<
  1280. htmltoc: htmltoc.icn
  1281. - $(ICONT) htmltoc.icn
  1282. + $(ICONT) $<
  1283. diff --git a/src/lib/Makefile b/src/lib/Makefile
  1284. --- a/src/lib/Makefile
  1285. +++ b/src/lib/Makefile
  1286. @@ -11,9 +11,9 @@
  1287. chmod +x unmarkup emptydefn toascii nwmtime pipedocs h2a btdefn
  1288. install: all
  1289. - cp unmarkup emptydefn toascii nwmtime h2a btdefn $(LIB)
  1290. - sed 's@|LIBDIR|@$(LIB)@g' pipedocs > $(LIB)/pipedocs
  1291. - chmod +x $(LIB)/pipedocs
  1292. + cp unmarkup emptydefn toascii nwmtime h2a btdefn $(DESTDIR)$(LIB)
  1293. + sed 's@|LIBDIR|@$(LIB)@g' pipedocs > $(DESTDIR)$(LIB)/pipedocs
  1294. + chmod +x $(DESTDIR)$(LIB)/pipedocs
  1295. checkin:
  1296. ci -l $(CINAME) $(CIMSG) $(RCSFILES)
  1297. @@ -23,8 +23,9 @@
  1298. touch toascii
  1299. toascii: toascii.nw
  1300. - notangle -Rtoascii toascii.nw > toascii
  1301. + notangle -Rtoascii $< > $@
  1302. -clean: ; rm -f *.log *.blg *.dvi *.toc *.aux *.tex *~
  1303. +clean:
  1304. + $(RM) *.log *.blg *.dvi *.toc *.aux *.tex *~
  1305. clobber: clean
  1306. - rm -f toascii
  1307. + $(RM) toascii
  1308. diff --git a/src/shell/Makefile b/src/shell/Makefile
  1309. --- a/src/shell/Makefile
  1310. +++ b/src/shell/Makefile
  1311. @@ -9,25 +9,27 @@
  1312. CINAME=
  1313. CIMSG=
  1314. -all: $(SRCS)
  1315. +all: $(SRCS)
  1316. source: $(SRCS)
  1317. -touch: $(SRCS)
  1318. +touch: $(SRCS)
  1319. touch $(SRCS)
  1320. checkin:
  1321. ci -l $(CINAME) $(CIMSG) $(RCSFILES)
  1322. noweave: noweave.nw
  1323. - notangle -Rnoweave noweave.nw > noweave
  1324. + notangle -Rnoweave $< > $@
  1325. notangle: notangle.nw
  1326. - notangle -Rnotangle notangle.nw > notangle
  1327. + notangle -Rnotangle $< > $@
  1328. -noweb: noweb.nw
  1329. - notangle -Rnoweb noweb.nw > noweb
  1330. +noweb: noweb.nw
  1331. + notangle -Rnoweb $< > $@
  1332. noroff toroff tmac.w: roff.nw
  1333. - noweb -t roff.nw
  1334. + noweb -t $<
  1335. -clean: ; rm -f *.log *.blg *.dvi *.toc *.aux *.tex *~
  1336. -clobber: clean ; rm -f $(SRCS)
  1337. +clean:
  1338. + $(RM) *.log *.blg *.dvi *.toc *.aux *.tex *~
  1339. +clobber: clean
  1340. + $(RM) $(SRCS)
  1341. diff --git a/src/tex/Makefile b/src/tex/Makefile
  1342. --- a/src/tex/Makefile
  1343. +++ b/src/tex/Makefile
  1344. @@ -12,14 +12,14 @@
  1345. ci -l $(CINAME) $(CIMSG) $(RCSFILES)
  1346. nwmac.tex: support.nw
  1347. - notangle -Rnwmac.tex support.nw > nwmac.tex
  1348. + notangle -Rnwmac.tex $< > $@
  1349. noweb.sty: support.nw
  1350. - notangle -Rnoweb.sty support.nw > noweb.sty
  1351. + notangle -Rnoweb.sty $< > $@
  1352. support.tex: support.nw
  1353. - noweave -delay -x support.nw > support.tex
  1354. + noweave -delay -x $< > $@
  1355. -clean:
  1356. - /bin/rm -f *~ *.dvi *.aux *.log *.blg *.bbl *.toc
  1357. - /bin/rm -f support.tex
  1358. +clean:
  1359. + $(RM) *~ *.dvi *.aux *.log *.blg *.bbl *.toc
  1360. + $(RM) support.tex
  1361. diff --git a/src/xdoc/Makefile b/src/xdoc/Makefile
  1362. --- a/src/xdoc/Makefile
  1363. +++ b/src/xdoc/Makefile
  1364. @@ -1,16 +1,20 @@
  1365. WWW=$(HOME)/www/noweb
  1366. SHELL=/bin/sh
  1367. .SUFFIXES: .1 .7 .txt .ps
  1368. -.1.txt: ; nroff -man $*.1 > $*.txt
  1369. -.1.ps: ; psroff -t -man $*.1 > $*.ps
  1370. -.7.txt: ; nroff -man $*.7 > $*.txt
  1371. -.7.ps: ; psroff -t -man $*.7 > $*.ps
  1372. +.1.txt:
  1373. + nroff -man $*.1 > $*.txt
  1374. +.1.ps:
  1375. + psroff -t -man $*.1 > $*.ps
  1376. +.7.txt:
  1377. + nroff -man $*.7 > $*.txt
  1378. +.7.ps:
  1379. + psroff -t -man $*.7 > $*.ps
  1380. MANPAGES=notangle.1 cpif.1 noweb.1 nodefs.1 noroots.1 noindex.1 \
  1381. - nowebstyle.7 nowebfilters.7 nuweb2noweb.1 sl2h.1 htmltoc.1 \
  1382. + nowebstyle.7 nowebfilters.7 nuweb2noweb.1 sl2h.1 htmltoc.1 \
  1383. noroff.1
  1384. TXTPAGES=notangle.txt cpif.txt noweb.txt nodefs.txt noroots.txt noindex.txt \
  1385. - nowebstyle.txt nowebfilters.txt nuweb2noweb.txt sl2h.txt htmltoc.txt \
  1386. + nowebstyle.txt nowebfilters.txt nuweb2noweb.txt sl2h.txt htmltoc.txt \
  1387. noroff.txt
  1388. SRCS=$(MANPAGES) $(TXTPAGES)
  1389. @@ -30,52 +34,52 @@
  1390. ci -l $(CINAME) $(CIMSG) $(RCSFILES)
  1391. $(WWW)/onepage.ps: onepage.ps
  1392. - cp onepage.ps $(WWW)
  1393. + cp $< $@
  1394. $(WWW)/guide.ps: guide.ps
  1395. - cp guide.ps $(WWW)
  1396. + cp $< $@
  1397. $(WWW)/guide.html: guide.html
  1398. - cp guide.html $(WWW)
  1399. + cp $< $@
  1400. notangle.1: manpage.nw ../shell/noweave.nw docdate.nw
  1401. - notangle -t8 -Rnotangle.1 manpage.nw ../shell/noweave.nw docdate.nw | $(DOVERSION) > notangle.1
  1402. + notangle -t8 -Rnotangle.1 $^ | $(DOVERSION) > $@
  1403. nowebstyle.7: manpage.nw ../tex/support.nw docdate.nw
  1404. - notangle -t8 -Rnowebstyle.7 manpage.nw ../tex/support.nw docdate.nw | $(DOVERSION) > nowebstyle.7
  1405. + notangle -t8 -Rnowebstyle.7 $^ | $(DOVERSION) > $@
  1406. nowebfilters.7: nowebfilters.nw docdate.nw
  1407. - notangle -t8 nowebfilters.nw docdate.nw | $(DOVERSION) > nowebfilters.7
  1408. + notangle -t8 $^ | $(DOVERSION) > $@
  1409. noweb.1: manpage.nw docdate.nw
  1410. - notangle -t8 -Rnoweb.1 manpage.nw docdate.nw | $(DOVERSION) > noweb.1
  1411. + notangle -t8 -Rnoweb.1 $^ | $(DOVERSION) > $@
  1412. nodefs.1: nodefs.nw docdate.nw
  1413. - notangle -t8 nodefs.nw docdate.nw | $(DOVERSION) > nodefs.1
  1414. + notangle -t8 $^ | $(DOVERSION) > $@
  1415. noroots.1: noroots.nw docdate.nw
  1416. - notangle -t8 noroots.nw docdate.nw | $(DOVERSION) > noroots.1
  1417. + notangle -t8 $^ | $(DOVERSION) > $@
  1418. noindex.1: noindex.nw docdate.nw
  1419. - notangle -t8 noindex.nw docdate.nw | $(DOVERSION) > noindex.1
  1420. + notangle -t8 $^ | $(DOVERSION) > $@
  1421. sl2h.1: sl2h.nw docdate.nw
  1422. - notangle -t8 sl2h.nw docdate.nw | $(DOVERSION) > sl2h.1
  1423. + notangle -t8 $^ | $(DOVERSION) > $@
  1424. htmltoc.1: htmltoc.nw docdate.nw
  1425. - notangle -t8 htmltoc.nw docdate.nw | $(DOVERSION) > htmltoc.1
  1426. + notangle -t8 $^ | $(DOVERSION) > $@
  1427. cpif.1: manpage.nw docdate.nw
  1428. - notangle -t8 -Rcpif.1 manpage.nw docdate.nw | $(DOVERSION) > cpif.1
  1429. + notangle -t8 -Rcpif.1 $^ | $(DOVERSION) > $@
  1430. nuweb2noweb.1: manpage.nw docdate.nw
  1431. - notangle -t8 -Rnuweb2noweb.1 manpage.nw docdate.nw | $(DOVERSION) > nuweb2noweb.1
  1432. + notangle -t8 -Rnuweb2noweb.1 $^ | $(DOVERSION) > $@
  1433. noroff.1: noroff.nw docdate.nw
  1434. - notangle -t8 noroff.nw docdate.nw | $(DOVERSION) > noroff.1
  1435. + notangle -t8 $^ | $(DOVERSION) > $@
  1436. wc.tex: ../../examples/wc.nw
  1437. - (cd ../../examples; noweave -n -index wc.nw) > wc.tex
  1438. + (cd ../../examples; noweave -n -index wc.nw) > $@
  1439. techrep.dvi: techrep.tex wc.tex
  1440. latex '\scrollmode \input '"techrep"
  1441. @@ -86,23 +90,23 @@
  1442. while grep -s 'Rerun to get cross-references right' onepage.log; do latex '\scrollmode \input '"onepage"; done
  1443. onepage.ps: onepage.dvi
  1444. - dvips -P cmz -o onepage.ps onepage
  1445. + dvips -P cmz -o $@ onepage
  1446. guide.dvi: guide.tex
  1447. latex '\scrollmode \input '"guide"
  1448. while grep -s 'Rerun to get cross-references right' guide.log; do latex '\scrollmode \input '"guide"; done
  1449. guide.ps: guide.dvi
  1450. - dvips -P cmz -o guide.ps guide
  1451. + dvips -P cmz -o $@ guide
  1452. guide.uu: guide.ps
  1453. gzip < guide.ps > guide.ps.gz
  1454. - uuencode guide.ps.gz < guide.ps.gz > guide.uu
  1455. + uuencode guide.ps.gz < guide.ps.gz > $@
  1456. guide.html: guide.dvi
  1457. - sl2h guide.tex | htmltoc > guide.html
  1458. + sl2h guide.tex | htmltoc > $@
  1459. -clean: ; /bin/rm -f *.dvi *.log *.blg *~ wc.tex *.ps *.gz *.uu *.html
  1460. +clean:
  1461. + $(RM) *.dvi *.log *.blg *~ wc.tex *.ps *.gz *.uu *.html
  1462. clobber: clean
  1463. - rm -f *.1 *.7 *.txt
  1464. -
  1465. + $(RM) *.1 *.7 *.txt