]> granicus.if.org Git - nethack/commitdiff
Makefile construction cleanup
authorkeni <keni>
Tue, 27 Dec 2011 00:34:52 +0000 (00:34 +0000)
committerkeni <keni>
Tue, 27 Dec 2011 00:34:52 +0000 (00:34 +0000)
Update the help text in setup.sh.  When building with a hints file from TOP,
the path to the hints file should start from TOP (instead of "hints/foo").
Make the notes in the generated makefiles consistent as to case.

sys/unix/mkmkfile.sh
sys/unix/setup.sh

index be140aa809037b9d9cb0165e6ec56a9db5b58425..9055cd465ce4a2864dc6d0ffbc1a5c1962b6bd75 100644 (file)
@@ -8,7 +8,8 @@
 #  $1 basefile
 #  $2 basefile tag
 #  $3 install path
-#  $4 hints file
+#  $4 hints file (path)
+#  $5 hints file (as given by user)
 
 echo "#" > $3
 echo "# This file is generated automatically.  Do not edit." >> $3
@@ -18,25 +19,25 @@ echo "MAKEFILE_$2=1" >> $3
 echo "" >> $3
 
 echo "###" >> $3
-echo "### Start $4 PRE" >> $3
+echo "### Start $5 PRE" >> $3
 echo "###" >> $3
 awk '/^#-PRE/,/^#-POST/{ \
        if(index($0, "#-PRE") == 1) print "# (new segment at source line",NR,")"; \
        if(index($0, "#-P") != 1) print}' $4 >> $3
-echo "### end $4 PRE" >> $3
+echo "### End $5 PRE" >> $3
 echo "" >> $3
 
 echo "###" >> $3
 echo "### Start $1" >> $3
 echo "###" >> $3
 cat $1 >> $3
-echo "### end of file" >> $3
+echo "### End $1" >> $3
 echo "" >> $3
 
 echo "###" >> $3
-echo "### Start $4 POST" >> $3
+echo "### Start $5 POST" >> $3
 echo "###" >> $3
 awk '/^#-POST/,/^#-PRE/{ \
        if(index($0, "#-POST") == 1) print "# (new segment at source line",NR,")"; \
        if(index($0, "#-P") != 1) print}' $4 >> $3
-echo "### end $4 POST" >> $3
+echo "### End $5 POST" >> $3
index 228da918a0620d558fe07c218f4f3ce404613a8b..38f3e9d8df4870631999475fa0de1e20c842d3e2 100644 (file)
@@ -9,20 +9,25 @@
 # e.g.:
 #  sh setup.sh
 # or
-#  sh setup.sh hints/macosx10.5
+#  sh setup.sh hints/macosx10.5 (from sys/unix)
+# or
+#  sh setup.sh sys/unix/hints/macosx10.5 (from top)
 
 # Were we started from the top level?  Cope.
-if [ -f sys/unix/Makefile.top ]; then cd sys/unix; fi
+prefix=.
+if [ -f sys/unix/Makefile.top ]; then cd sys/unix; prefix=../..; fi
 
 case "x$1" in
 x)      hints=/dev/null
+       hfile=/dev/null
         ;;
-*)      hints=$1
+*)      hints=$prefix/$1
+       hfile=$1
         ;;
 esac
 
-/bin/sh ./mkmkfile.sh Makefile.top TOP ../../Makefile $hints
-/bin/sh ./mkmkfile.sh Makefile.dat DAT ../../dat/Makefile $hints
-/bin/sh ./mkmkfile.sh Makefile.doc DOC ../../doc/Makefile $hints
-/bin/sh ./mkmkfile.sh Makefile.src SRC ../../src/Makefile $hints
-/bin/sh ./mkmkfile.sh Makefile.utl UTL ../../util/Makefile $hints
+/bin/sh ./mkmkfile.sh Makefile.top TOP ../../Makefile $hints $hfile
+/bin/sh ./mkmkfile.sh Makefile.dat DAT ../../dat/Makefile $hints $hfile
+/bin/sh ./mkmkfile.sh Makefile.doc DOC ../../doc/Makefile $hints $hfile
+/bin/sh ./mkmkfile.sh Makefile.src SRC ../../src/Makefile $hints $hfile
+/bin/sh ./mkmkfile.sh Makefile.utl UTL ../../util/Makefile $hints $hfile