Ticket #47315: simplify-makefile.diff
File simplify-makefile.diff, 2.8 KB (added by grimreaper (Eitan Adler), 10 years ago) |
---|
-
Makefile
MKDIR = /bin/mkdir 20 20 CP = /bin/cp 21 21 RM = /bin/rm 22 22 LN = /bin/ln 23 ifeq ($(UNAME), Linux) 24 SED = /bin/sed 25 REINPLACE = $(SED) -i -r 26 else 23 27 SED = /usr/bin/sed 24 ifeq ($(UNAME), Linux) 25 SED = /bin/sed 28 REINPLACE = $(SED) -i '' -E 26 29 endif 27 30 TCLSH = /usr/bin/tclsh 28 31 XSLTPROC = $(PREFIX)/bin/xsltproc … … endif 75 78 $(GUIDE_XSL) $(GUIDE_SRC)/guide.xml 76 79 # Convert all sections (h1-h9) to a link so it's easy to link to them. 77 80 # If someone knows a better way to do this please change it. 78 ifeq ($(UNAME), Linux) 79 $(SED) -i -r -e \ 81 $(REINPLACE) \ 80 82 's|(<h[0-9] [^>]*><a id="([^"]*)"></a>)([^<]*)(</h[0-9]>)|\1<a href="#\2">\3</a>\4|g' \ 81 83 $(GUIDE_RESULT)/index.html 82 else83 $(SED) -i "" -E \84 's|(<h[0-9] [^>]*><a id="([^"]*)"></a>)([^<]*)(</h[0-9]>)|\1<a href="#\2">\3</a>\4|g' \85 $(GUIDE_RESULT)/index.html86 endif87 84 88 85 # Generate the chunked HTML guide with one section per file. 89 86 guide-chunked: … … endif 100 97 $(GUIDE_XSL_CHUNK) $(GUIDE_SRC)/guide.xml 101 98 # Convert all sections (h1-h9) to a link so it's easy to link to them. 102 99 # If someone knows a better way to do this please change it. 103 ifeq ($(UNAME), Linux) 104 $(SED) -i -r -e \ 100 $(REINPLACE) \ 105 101 's|(<h[0-9] [^>]*><a id="([^"]*)"></a>)([^<]*)(</h[0-9]>)|\1<a href="#\2">\3</a>\4|g' \ 106 102 $(GUIDE_RESULT_CHUNK)/*.html 107 else108 $(SED) -i "" -E \109 's|(<h[0-9] [^>]*><a id="([^"]*)"></a>)([^<]*)(</h[0-9]>)|\1<a href="#\2">\3</a>\4|g' \110 $(GUIDE_RESULT_CHUNK)/*.html111 endif112 103 # Add the table of contents to every junked HTML file. 113 104 # If someone knows a better way to do this please change it. 114 105 $(TCLSH) toc-for-chunked.tcl $(GUIDE_RESULT_CHUNK) … … man: $(MAN_XSL) 134 125 $(MKDIR) -p $(MAN_TMP) 135 126 $(CP) $(GUIDE_SRC)/portfile-*.xml $(MAN_TMP) 136 127 $(CP) $(GUIDE_SRC)/portgroup-*.xml $(MAN_TMP) 137 ifeq ($(UNAME), Linux) 138 $(SED) -i -r -e 's|<section|<refsection|g' $(MAN_TMP)/* 139 $(SED) -i -r -e 's|</section>|</refsection>|g' $(MAN_TMP)/* 140 else 141 $(SED) -i "" 's|<section|<refsection|g' $(MAN_TMP)/* 142 $(SED) -i "" 's|</section>|</refsection>|g' $(MAN_TMP)/* 143 endif 128 $(REINPLACE) 's|<section|<refsection|g' $(MAN_TMP)/* 129 $(REINPLACE) 's|</section>|</refsection>|g' $(MAN_TMP)/* 144 130 $(XSLTPROC) --xinclude --output $(MAN_RESULT) $(MAN_XSL) \ 145 131 $(MAN_SRC)/port.1.xml \ 146 132 $(MAN_SRC)/portfile.7.xml \ … … man: $(MAN_XSL) 150 136 151 137 # Create XSL from template for man pages. 152 138 $(MAN_XSL): 153 ifeq ($(UNAME), Linux) 154 $(SED) -r -e 's:@PREFIX@:$(PREFIX):' $@.in > $@ 155 else 156 $(SED) 's:@PREFIX@:$(PREFIX):' $@.in > $@ 157 endif 139 $(CP) $@.in $@.tmp 140 $(REINPLACE) 's:@PREFIX@:$(PREFIX):' $@.tmp 141 $(CP) $@.tmp $@ 158 142 159 143 # Remove all temporary files generated by guide: and man:. 160 144 clean: