[m-rev.] for review: use xargs in mmake

Peter Ross peter.ross at miscrit.be
Fri Feb 15 03:41:00 AEDT 2002


Hi,

For Fergus to review.

I have only one question: are there any other issues to using xargs?

If not, I do know that I also will need to convert the clean and
realclean targets in the generated makefile to using xargs.

===================================================================


Estimated hours taken: 0.1
Branches: main

scripts/mmake.in:
    Use xargs to avoid overflowing the command line size limit.

Index: scripts/mmake.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/mmake.in,v
retrieving revision 1.36
diff -u -r1.36 mmake.in
--- scripts/mmake.in	27 Jul 2001 17:06:17 -0000	1.36
+++ scripts/mmake.in	14 Feb 2002 16:26:00 -0000
@@ -286,8 +286,8 @@
 	echo export MERCURY_INT_DIR
 	echo MERCURY_DEFAULT_GRADE=$MERCURY_DEFAULT_GRADE
 	echo export MERCURY_DEFAULT_GRADE
-	echo cat ${MMAKE_VARS} $dvs $ds $include_makefile $mmake $deps \
-		${MMAKE_RULES} ">>" $tmp
+	echo echo ${MMAKE_VARS} $dvs $ds $include_makefile $mmake $deps \
+		${MMAKE_RULES} | xargs cat ">>" $tmp
 	echo ${MMAKE_MAKE} ${MMAKE_MAKE_OPTS} -f $tmp -r ${set_target_asm} "$@"
 fi
 export MMAKE
@@ -295,7 +295,8 @@
 export MMAKE_USE_SUBDIRS
 export MERCURY_INT_DIR
 export MERCURY_DEFAULT_GRADE
-cat ${MMAKE_VARS} $dvs $ds $include_makefile $mmake $deps ${MMAKE_RULES} > $tmp
+echo ${MMAKE_VARS} $dvs $ds $include_makefile \
+		$mmake $deps ${MMAKE_RULES} | xargs cat > $tmp
 case $# in
 	# Note that we can't use `exec' here, because if we did that,
 	# that `trap' code which removes $tmp would never get executed.

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list