The other strategy would be globsearch calls Python calls make to get the list on stdout, which it filters and returns on its stdout.
An alternative would be to use $(guile ...) to do all the processing, but that will only work when Make is built with Guile support. Check make -f gmakefile print VAR=.FEATURES | grep guile to see if you have support. Mine has it, but Ubuntu's make package doesn't, for example. Scott Kruger <[email protected]> writes: > Ugh -- this is ugly. > > Can't we just tell users to either use the '%' syntax or recompile their > linux kernel? > > Just kidding. I'll take a look. > > Scott > > > On 3/25/20 3:48 PM, Jed Brown wrote: >> Scott, you can't pass '$(alltesttargets)' on the command line like this. >> >> TESTTARGETS := $(shell $(PYTHON) -c"import sys,fnmatch,itertools; >> m=[fnmatch.filter(sys.argv[2].split(),p) for p in sys.argv[1].split()]; >> print(' '.join(list(itertools.chain.from_iterable(m))))" '$(globsearch)' >> '$(alltesttargets)') >> >> For this feature, probably put them in an argsfile >> >> $(file >$(TESTDIR)/globsearch.args,$(alltesttargets)) >> >> and make your Python read from that file. I don't know a way to pass it >> on stdin. >> >> Scott Kruger <[email protected]> writes: >> >>> What platform? >>> >>> On 3/25/20 3:20 PM, Stefano Zampini wrote: >>>> This was working before.. >>>> >>>> [szampini@localhost petsc]$ make -f gmakefile.test test globsearch='dm*' >>>> make: execvp: /usr/bin/sh: Argument list too long >>>> Using MAKEFLAGS: -- globsearch=dm* >>>> # No tests run >>>> # No tests run >>>> # No tests run >>>> >>>> [szampini@localhost petsc]$ git branch >>>> * knepley/feature-dm-remove-hybrid >>>> >>>> [szampini@localhost petsc]$ make -v >>>> GNU Make 4.2.1 >>>> Built for x86_64-redhat-linux-gnu >>>> Copyright (C) 1988-2016 Free Software Foundation, Inc. >>>> License GPLv3+: GNU GPL version 3 or later >>>> <http://gnu.org/licenses/gpl.html> >>>> This is free software: you are free to change and redistribute it. >>>> There is NO WARRANTY, to the extent permitted by law. >>>> >>> >>> -- >>> Tech-X Corporation [email protected] >>> 5621 Arapahoe Ave, Suite A Phone: (720) 974-1841 >>> Boulder, CO 80303 Fax: (303) 448-7756 > > -- > Tech-X Corporation [email protected] > 5621 Arapahoe Ave, Suite A Phone: (720) 974-1841 > Boulder, CO 80303 Fax: (303) 448-7756
