[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GNU enhancement -- $(xargs cmd, list)

From: Reid Madsen
Subject: GNU enhancement -- $(xargs cmd, list)
Date: Mon, 6 Nov 2000 09:46:23 -0600 (CST)

Consider the following:

    ARGS=$(wildcard *.xx)

            command $(ARGS)

The above only works if the length of the resulting command line is within
system limits.  From the shell, you can solve this by:

        echo *.xx | xargs command

But the above does not work in make because it expands the wildcard, and then
launches a command line that is again too long.

I propose that GNUmake add the following function:

        $(xargs cmd, list)

Then I could render the intial example as:

    ARGS=$(wildcard *.xx)

            $(xargs command, $(ARGS))

Which resolves to:

        command some_args; command more_args; command even_more_args

where the number of commands depends on the command line length for the
given platform.  This would allow us to write Makefiles that work on all
platforms regardless of command line length.

Since I'm somewhat familiar with the GNUmake source I'd like to take a stab at
implementing this.  If you can give me any pointers on how I should proceed I
would appreciate it. 


Reid Madsen

Reid Madsen                             address@hidden                      
Senior Member, Tech. Staff              (972) 536-3261 (Desk)
I2 Technologies                         (214) 850-9613 (Cellular)
Making incrementally (without 'clean') since May 18, 2000.
Long live incremental make!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]