xref: /petsc/gmakefile (revision b41ce5d507ea9a58bfa83cf403107a702e77a67d)
1# -*- mode: makefile-gmake -*-
2
3# If $(PETSC_ARCH) is empty, this defines it and PETSC_DIR
4include ./$(PETSC_ARCH)/lib/petsc/conf/petscvariables
5include ./lib/petsc/conf/variables
6
7OBJDIR := $(PETSC_ARCH)/obj
8TESTDIR := $(PETSC_ARCH)/tests
9MODDIR := $(PETSC_ARCH)/include
10LIBDIR := $(abspath $(PETSC_ARCH)/lib)
11TESTLOGFILE = $(TESTDIR)/examples-$(PETSC_ARCH).log
12
13pkgs := sys vec mat dm ksp snes ts tao
14
15# $(call SONAME_FUNCTION,libfoo,abiversion)
16SONAME_FUNCTION ?= $(1).$(SL_LINKER_SUFFIX).$(2)
17# $(call SL_LINKER_FUNCTION,libfoo,abiversion,libversion)
18SL_LINKER_FUNCTION ?= -shared -Wl,-soname,$(call SONAME_FUNCTION,$(notdir $(1)),$(2))
19
20PETSC_VERSION_MAJOR := $(shell awk '/\#define PETSC_VERSION_MAJOR/{print $$3;}' ./include/petscversion.h)
21PETSC_VERSION_MINOR := $(shell awk '/\#define PETSC_VERSION_MINOR/{print $$3;}' ./include/petscversion.h)
22PETSC_VERSION_SUBMINOR := $(shell awk '/\#define PETSC_VERSION_SUBMINOR/{print $$3;}' ./include/petscversion.h)
23PETSC_VERSION_RELEASE := $(shell awk '/\#define PETSC_VERSION_RELEASE/{print $$3;}' ./include/petscversion.h)
24
25libpetsc_abi_version := $(PETSC_VERSION_MAJOR).$(if $(filter $(PETSC_VERSION_RELEASE), 0 -2 -3 -4 -5),0)$(PETSC_VERSION_MINOR)
26libpetsc_lib_version := $(libpetsc_abi_version).$(PETSC_VERSION_SUBMINOR)
27soname_function = $(call SONAME_FUNCTION,$(1),$(libpetsc_abi_version))
28libname_function = $(call SONAME_FUNCTION,$(1),$(libpetsc_lib_version))
29basename_all = $(basename $(basename $(basename $(basename $(1)))))
30sl_linker_args = $(call SL_LINKER_FUNCTION,$(call basename_all,$@),$(libpetsc_abi_version),$(libpetsc_lib_version))
31
32libpetsc_shared  := $(LIBDIR)/libpetsc.$(SL_LINKER_SUFFIX)
33libpetsc_soname  := $(call soname_function,$(LIBDIR)/libpetsc)
34libpetsc_libname := $(call libname_function,$(LIBDIR)/libpetsc)
35libpetsc_static  := $(LIBDIR)/libpetsc.$(AR_LIB_SUFFIX)
36libpetscpkgs_shared  := $(foreach pkg, $(pkgs), $(LIBDIR)/libpetsc$(pkg).$(SL_LINKER_SUFFIX))
37libpetscpkgs_soname  := $(foreach pkg, $(pkgs), $(call soname_function,$(LIBDIR)/libpetsc$(pkg)))
38libpetscpkgs_libname := $(foreach pkg, $(pkgs), $(call libname_function,$(LIBDIR)/libpetsc$(pkg)))
39libpetscpkgs_static  := $(foreach pkg, $(pkgs), $(LIBDIR)/libpetsc$(pkg).$(AR_LIB_SUFFIX))
40
41ifeq ($(PETSC_WITH_EXTERNAL_LIB),)
42  libpetscall_shared  := $(libpetscpkgs_shared)
43  libpetscall_soname  := $(libpetscpkgs_soname)
44  libpetscall_libname := $(libpetscpkgs_libname)
45  libpetscall_static  := $(libpetscpkgs_static)
46else
47  libpetscall_shared  := $(libpetsc_shared)
48  libpetscall_soname  := $(libpetsc_soname)
49  libpetscall_libname := $(libpetsc_libname)
50  libpetscall_static  := $(libpetsc_static)
51endif
52libpetscall := $(if $(filter-out no,$(BUILDSHAREDLIB)),$(libpetscall_shared) $(libpetscall_soname),$(libpetscall_static))
53
54generated      := $(PETSC_ARCH)/lib/petsc/conf/files
55petscconf      := $(PETSC_ARCH)/include/petscconf.h
56petscvariables := $(PETSC_ARCH)/lib/petsc/conf/petscvariables
57generatedtest      := $(PETSC_ARCH)/lib/petsc/conf/testfiles
58
59all : $(generated) $(libpetscall)
60
61.SECONDEXPANSION:		# to expand $$(@D)/.DIR
62
63TESTFLAGS :=             # Initialize as simple variable
64
65#workarround old cygwin versions
66ifeq ($(PETSC_CYGWIN_BROKEN_PIPE),1)
67ifeq ($(shell basename $(AR)),ar)
68  V ?=1
69endif
70endif
71V ?= $(if $(findstring s,$(MAKEFLAGS)),0)
72ifeq ($(V),)  # Default
73  quiet_HELP := "Use \"$(MAKE) V=1\" to see verbose compile lines, \"$(MAKE) V=0\" to suppress.\n"
74  quiet = @printf $(quiet_HELP)$(eval quiet_HELP:=)"  %10s %s\n" "$1$2" "$@"; $($1)
75  quiettest = @printf "  %10s %s\n" "TEST" "$(@:$(TESTDIR)/counts/%.counts=%)";
76else ifeq ($(V),0)		# Suppress entire command
77  quiet = @$($1)
78  quiettest = @
79else				# Show the full command line
80  quiet = $($1)
81  quiettest =
82  TESTFLAGS += -v
83endif
84
85ifeq ($(FORCE),1)
86  TESTFLAGS += -f    # force test execution
87endif
88ifeq ($(VALGRIND),1)
89  TESTFLAGS += -V    # Add valgrind to the flags
90endif
91ifeq ($(REPLACE),1)
92  TESTFLAGS += -m    # Replace results by passing -m to petscdiff
93endif
94ifeq ($(DIFF_NUMBERS),1)
95  TESTFLAGS += -j    # Pass -j to petscdiff to diff the actual numbers
96endif
97ifdef OPTIONS
98  TESTFLAGS += -a '$(OPTIONS)'   # override arguments
99endif
100ifdef EXTRA_OPTIONS
101  TESTFLAGS += -e '$(EXTRA_OPTIONS)'  # add extra arguments
102endif
103ifdef NP
104  TESTFLAGS += -n $(NP)  # set number of processes
105endif
106# Override the default timeout that may be found at the top of config/petsc_harness.sh
107# This must be an integer.  It is given in seconds.
108ifdef TIMEOUT
109  TESTFLAGS += -t $(TIMEOUT)  # Override the default timeout
110endif
111
112
113$(generated) : $(petscconf) $(petscvariables) config/gmakegen.py
114	$(PYTHON) ./config/gmakegen.py --petsc-arch=$(PETSC_ARCH)
115
116$(generatedtest) : $(petscconf) $(petscvariables) config/gmakegentest.py | $$(@D)/.DIR
117	$(PYTHON) ./config/gmakegentest.py --petsc-arch=$(PETSC_ARCH)
118
119-include $(generated)
120-include $(generatedtest)
121
122ifeq ($(PETSC_LANGUAGE),CXXONLY)
123  cc_name := CXX
124else
125  cc_name := CC
126endif
127
128# implies shared libraries with MS compilers
129ifeq ($(SL_LINKER_FUNCTION),-LD)
130$(OBJDIR)/%.o : CCPPFLAGS+=-Dpetsc_EXPORTS
131endif
132
133PETSC_COMPILE.c = $(call quiet,$(cc_name)) -c $(PCC_FLAGS) $(CFLAGS) $(CCPPFLAGS) $(C_DEPFLAGS)
134PETSC_COMPILE.cxx = $(call quiet,CXX) -c $(CXX_FLAGS) $(CFLAGS) $(CCPPFLAGS) $(CXX_DEPFLAGS)
135PETSC_COMPILE.cu = $(call quiet,CUDAC) -c $(CUDAC_FLAGS) --compiler-options="$(PCC_FLAGS) $(CXXFLAGS) $(CCPPFLAGS)"
136PETSC_GENDEPS.cu = $(call quiet,CUDAC,.dep) --generate-dependencies --output-directory=$(@D) $(CUDAC_FLAGS) --compiler-options="$(PCC_FLAGS) $(CXXFLAGS) $(CCPPFLAGS)"
137PETSC_COMPILE.F = $(call quiet,FC) -c $(FC_FLAGS) $(FFLAGS) $(FCPPFLAGS) $(FC_DEPFLAGS)
138
139langs := F cu cxx c
140concatlang = $(foreach lang, $(langs), $(srcs-$(1).$(lang):%.$(lang)=$(OBJDIR)/%.o))
141srcs.o := $(foreach pkg, $(pkgs), $(call concatlang,$(pkg)))
142testlangs := c cu cxx F F90
143concattestlang = $(foreach lang, $(2), $(testsrcs-$(1).$(lang):%.$(lang)=$(TESTDIR)/%.o))
144testsrcs.o := $(foreach pkg, $(pkgs), $(call concattestlang,$(pkg),$(testlangs)))
145testsrcs := $(foreach pkg, $(pkgs), $(foreach lang, $(testlangs), $(testsrcs-$(pkg).$(lang))))
146
147# Refresh testfiles when sources change, but don't balk if the source file is nonexistent (deleted)
148$(generatedtest) : $(testsrcs)
149$(testsrcs) :
150
151
152define SHARED_RECIPE_DLL
153  @$(RM) $@ dllcmd.${PETSC_ARCH}
154  @cygpath -w $^ > dllcmd.${PETSC_ARCH}
155  $(call quiet,CLINKER) $(sl_linker_args) -o $@ @dllcmd.${PETSC_ARCH} $(PETSC_EXTERNAL_LIB_BASIC)
156  @$(RM) dllcmd.${PETSC_ARCH}
157endef
158
159define SHARED_RECIPE_DEFAULT
160  $(call quiet,CLINKER) $(sl_linker_args) -o $@ $^ $(PETSC_EXTERNAL_LIB_BASIC)
161endef
162
163# with-single-library=1 (default)
164$(libpetsc_libname) : $(srcs.o) | $$(@D)/.DIR
165	$(if $(findstring -LD,$(SL_LINKER_FUNCTION)),$(SHARED_RECIPE_DLL),$(SHARED_RECIPE_DEFAULT))
166ifneq ($(DSYMUTIL),true)
167	$(call quiet,DSYMUTIL) $@
168endif
169
170$(libpetsc_static) : obj := $(srcs.o)
171
172define ARCHIVE_RECIPE_WIN32FE_LIB
173  @$(RM) $@ $@.args
174  @cygpath -w $^ > $@.args
175  $(call quiet,AR) $(AR_FLAGS) $@ @$@.args
176  @$(RM) $@.args
177endef
178
179define ARCHIVE_RECIPE_DEFAULT
180  @$(RM) $@
181  $(call quiet,AR) $(AR_FLAGS) $@ $^
182  $(call quiet,RANLIB) $@
183endef
184
185%.$(AR_LIB_SUFFIX) : $$(obj) | $$(@D)/.DIR
186	$(if $(findstring win32fe lib,$(AR)),$(ARCHIVE_RECIPE_WIN32FE_LIB),$(ARCHIVE_RECIPE_DEFAULT))
187
188# with-single-library=0
189libpkg = $(foreach pkg, $1, $(LIBDIR)/libpetsc$(pkg).$(SL_LINKER_SUFFIX))
190define pkg_template
191  $(LIBDIR)/libpetsc$(1).$(AR_LIB_SUFFIX)  : $(call concatlang,$(1))
192  $(call libname_function,$(LIBDIR)/libpetsc$(1)) : $(call concatlang,$(1))
193endef
194$(foreach pkg,$(pkgs),$(eval $(call pkg_template,$(pkg))))
195$(call libname_function,$(LIBDIR)/libpetscvec)  : libdep := $(call libpkg,sys)
196$(call libname_function,$(LIBDIR)/libpetscmat)  : libdep := $(call libpkg,vec sys)
197$(call libname_function,$(LIBDIR)/libpetscdm)   : libdep := $(call libpkg,mat vec sys)
198$(call libname_function,$(LIBDIR)/libpetscksp)  : libdep := $(call libpkg,dm mat vec sys)
199$(call libname_function,$(LIBDIR)/libpetscsnes) : libdep := $(call libpkg,ksp dm mat vec sys)
200$(call libname_function,$(LIBDIR)/libpetscts)   : libdep := $(call libpkg,snes ksp dm mat vec sys)
201$(call libname_function,$(LIBDIR)/libpetsctao)  : libdep := $(call libpkg,snes ksp dm mat vec sys)
202
203# The package libraries technically depend on each other (not just in an order-only way), but only
204# ABI changes like new or removed symbols requires relinking the dependent libraries.  ABI should
205# only occur when a header is changed, which would trigger recompilation and relinking anyway.
206# RELINK=1 causes dependent libraries to be relinked anyway.
207ifeq ($(RELINK),1)
208  libdep_true = $$(libdep)
209  libdep_order =
210else
211  libdep_true =
212  libdep_order = $$(libdep)
213endif
214$(libpetscpkgs_libname) : $(libdep_true) | $(libdep_order) $$(@D)/.DIR
215	$(call quiet,CLINKER) $(sl_linker_args) -o $@ $^ $(PETSC_EXTERNAL_LIB_BASIC)
216ifneq ($(DSYMUTIL),true)
217	$(call quiet,DSYMUTIL) $@
218endif
219
220%.$(SL_LINKER_SUFFIX) : $(call libname_function,%)
221	@ln -sf $(notdir $<) $@
222
223$(call soname_function,%) : $(call libname_function,%)
224	@ln -sf $(notdir $<) $@
225
226$(OBJDIR)/%.o $(TESTDIR)/%.o : %.c | $$(@D)/.DIR
227	$(PETSC_COMPILE.c) $(abspath $<) -o $@
228
229$(OBJDIR)/%.o $(TESTDIR)/%.o : %.cxx | $$(@D)/.DIR
230	$(PETSC_COMPILE.cxx) $(abspath $<) -o $@
231
232$(OBJDIR)/%.o $(TESTDIR)/%.o : %.cu | $$(@D)/.DIR
233	$(PETSC_COMPILE.cu) $(abspath $<) -o $@ # Compile first so that if there is an error, it comes from a normal compile
234	@$(PETSC_GENDEPS.cu) $(abspath $<) -o $(@:%.o=%.d) # Generate the dependencies for later
235
236# Test modules go in a different directory
237$(TESTDIR)/%.o : MODDIR = $(@D)
238FCMOD = cd
239$(OBJDIR)/%.o $(TESTDIR)/%.o : %.F | $$(@D)/.DIR
240ifeq ($(FC_MODULE_OUTPUT_FLAG),)
241	$(call quiet,FCMOD) $(MODDIR) && $(FC) -c $(FC_FLAGS) $(FFLAGS) $(FCPPFLAGS) $(FC_DEPFLAGS) $(abspath $<) -o $(abspath $@)
242else
243	$(PETSC_COMPILE.F) $(abspath $<) -o $@ $(FC_MODULE_OUTPUT_FLAG)$(MODDIR)
244endif
245
246$(OBJDIR)/%.o $(TESTDIR)/%.o : %.F90 | $$(@D)/.DIR
247ifeq ($(FC_MODULE_OUTPUT_FLAG),)
248	$(call quiet,FCMOD) $(MODDIR) && $(FC) -c $(FC_FLAGS) $(FFLAGS) $(FCPPFLAGS) $(FC_DEPFLAGS) $(abspath $<) -o $(abspath $@)
249else
250	$(PETSC_COMPILE.F) $(abspath $<) -o $@ $(FC_MODULE_OUTPUT_FLAG)$(MODDIR)
251endif
252
253# Test executables
254$(TESTDIR)/%f : $(TESTDIR)/%f.o $(libpetscall)
255	$(call quiet,FLINKER) -o $@ $< $(PETSC_LIB)
256
257$(TESTDIR)/%f90 : $(TESTDIR)/%f90.o $(libpetscall)
258	$(call quiet,FLINKER) -o $@ $< $(PETSC_LIB)
259
260$(TESTDIR)/% : $(TESTDIR)/%.o $(libpetscall)
261	$(call quiet,CLINKER) -o $@ $< $(PETSC_LIB)
262
263# Fortran source files need petsc*.mod, which isn't explicitly managed in the makefile.
264$(foreach pkg, $(pkgs), $(call concattestlang,$(pkg),F F90)) : $(libpetscall)
265
266# Testing convenience targets
267.PHONY: alltest test pre-clean
268test: pre-clean report_tests
269pre-clean:
270	@$(RM) -r $(TESTDIR)/counts $(TESTLOGFILE)
271	@touch $(TESTLOGFILE)
272
273.PHONY: $(foreach pkg, $(pkgs), test-$(pkg) $(foreach lang, $(testlangs), test-$(pkg).$(lang) test-rm-$(pkg).$(lang)))
274testpkgs := $(foreach pkg, $(pkgs), test-$(pkg))
275# Targets to run tests in test-$pkg.$lang and delete the executables, language by language
276$(testpkgs) : test-% : $(foreach lang, $(testlangs), test-rm-%.$(lang))
277# List of raw test run targets
278alltesttargets := $(foreach tp, $(testpkgs), $(foreach lang, $(testlangs), $($(tp).$(lang))))
279
280# Run targets
281$(alltesttargets) : % : $(TESTDIR)/counts/%.counts
282.PHONY: $(alltesttargets)
283
284$(TESTDIR)/counts/%.counts :
285	$(quiettest) $< $(TESTFLAGS)
286
287# Targets to run tests and remove executables, by package-lang pairs.
288# Run the tests in each batch using recursive invocation of make because
289# we need all of them to complete before removing the executables.  Make
290# doesn't guarantee an exploration order for the graph.  Only recursive
291# if there is something to be done.
292alltest-rm := $(foreach pkg, $(pkgs), $(foreach lang, $(testlangs), test-rm-$(pkg).$(lang)))
293$(alltest-rm) : test-rm-% : test-%
294ifneq ($(NO_RM),1)
295	$(call quiet,RM) $(addprefix $(TESTDIR)/,$(basename $($(@:test-rm-%=testsrcs-%))))
296endif
297
298# Remove intermediate .o files
299# This only removes the files at the end which is insufficient
300#.INTERMEDIATE: $(testsrcs.o:%.o=%)
301
302# Hack: manual dependencies on object files
303ifeq ($(MPI_IS_MPIUNI),1)
304  MPIUNI_MOD := $(MODDIR)/mpi.mod
305endif
306$(OBJDIR)/src/sys/f90-mod/petscsysmod.o   : $(if $(MPIUNI_MOD),$(OBJDIR)/src/sys/mpiuni/f90-mod/mpiunimod.o)
307$(OBJDIR)/src/vec/f90-mod/petscvecmod.o   : $(OBJDIR)/src/sys/f90-mod/petscsysmod.o
308$(OBJDIR)/src/mat/f90-mod/petscmatmod.o   : $(OBJDIR)/src/vec/f90-mod/petscvecmod.o
309$(OBJDIR)/src/dm/f90-mod/petscdmmod.o     : $(OBJDIR)/src/mat/f90-mod/petscmatmod.o
310$(OBJDIR)/src/ksp/f90-mod/petsckspmod.o   : $(OBJDIR)/src/dm/f90-mod/petscdmmod.o
311$(OBJDIR)/src/snes/f90-mod/petscsnesmod.o : $(OBJDIR)/src/ksp/f90-mod/petsckspmod.o
312$(OBJDIR)/src/ts/f90-mod/petsctsmod.o     : $(OBJDIR)/src/snes/f90-mod/petscsnesmod.o
313$(OBJDIR)/src/tao/f90-mod/petsctaomod.o   : $(OBJDIR)/src/ts/f90-mod/petsctsmod.o
314# F2003 interface
315$(OBJDIR)/src/sys/objects/f2003-src/fsrc/optionenum.o   : $(OBJDIR)/src/sys/f90-mod/petscsysmod.o
316$(OBJDIR)/src/sys/classes/bag/f2003-src/fsrc/bagenum.o  : $(OBJDIR)/src/sys/f90-mod/petscsysmod.o
317
318# all sources should get recompiled when petscvariables changes (i.e when configure is rerun or when petscvariables is manually edited.)
319$(srcs.o) : $(petscvariables)
320$(testsrcs.o) : $(petscvariables)
321
322%/.DIR :
323	@mkdir -p $(@D)
324	@touch $@
325
326.PRECIOUS: %/.DIR
327
328.SUFFIXES: # Clear .SUFFIXES because we don't use implicit rules
329.DELETE_ON_ERROR:               # Delete likely-corrupt target file if rule fails
330
331.PHONY: clean cleantest all print
332
333cleantest:
334	${RM} -r $(TESTDIR) $(generatedtest)
335
336clean: cleantest
337	${RM} -r $(OBJDIR) $(LIBDIR)/libpetsc* $(MODDIR)/petsc*.mod $(MPIUNI_MOD) $(generated)
338
339# make print VAR=the-variable
340print:
341	@echo $($(VAR))
342
343allobj.d := $(srcs.o:%.o=%.d)
344alltest.d := $(testsrcs.o:%.o=%.d)
345# Tell make that allobj.d are all up to date.  Without this, the include
346# below has quadratic complexity, taking more than one second for a
347# do-nothing build of PETSc (much worse for larger projects)
348$(allobj.d) : ;
349$(alltest.d) : ;
350
351-include $(allobj.d)
352-include $(alltest.d)
353
354# Tests can be generated by searching
355# Percent is a wildcard (only one allowed):
356#    make -f gmakefile test search=sys%ex2
357# To match internal substrings (matches *ex2*):
358#    make -f gmakefile test searchin=ex2
359# Search and searchin can be combined:
360#    make -f gmakefile test search='sys%' searchin=ex2
361# For args:
362#    make -f gmakefile test argsearch=cuda
363# For general glob-style searching using python:
364# NOTE: uses shell which is possibly slower and is possibly more brittle
365#    make -f gmakefile test globsearch='sys*ex2*'
366ifdef search
367  TESTTARGETS := $(filter $(search),$(alltesttargets))
368  ifdef searchin
369    TESTTARGETS2 := $(foreach v,$(TESTTARGETS),$(if $(findstring $(searchin),$(v)),$(v)))
370    TESTTARGETS := $(TESTTARGETS2)
371  endif
372else ifdef searchin
373  TESTTARGETS := $(foreach v,$(alltesttargets),$(if $(findstring $(searchin),$(v)),$(v)))
374else ifdef argsearch
375  TESTTARGETS := $(foreach v,$(alltesttargets),$(if $(findstring $(argsearch),$($(v)_ARGS)),$(v)))
376else ifdef globsearch
377  TESTTARGETS := $(shell $(PYTHON) -c"import sys,fnmatch; print ' '.join(fnmatch.filter(sys.argv[2].split(),sys.argv[1]))" '$(globsearch)' '$(alltesttargets)')
378else                            # No filter - run them all, but delete the executables as we go
379  TESTTARGETS := $(testpkgs)
380endif
381
382.PHONY: report_tests print-test
383
384print-test:
385	-@echo $(TESTTARGETS)
386
387report_tests: $(TESTTARGETS)
388	-@$(PYTHON) config/report_tests.py -d $(PETSC_ARCH)/tests/counts | tee -a $(TESTLOGFILE)
389
390help: help-make help-targets help-test
391	-@echo "Above is from: help-make help-targets help-test"
392
393help-make:
394	-@echo "Basic build usage:"
395	-@echo "   make -f gmakefile <options>"
396	-@echo
397	-@echo "Options:"
398	-@echo "  V=0           Very quiet builds"
399	-@echo "  V=1           Verbose builds"
400	-@echo
401
402help-targets:
403	-@echo "All makefile targets and their dependencies:"
404	-@grep ^[a-z] gmakefile | grep : | grep -v =
405	-@echo
406	-@echo
407
408help-test:
409	-@echo "Basic test usage:"
410	-@echo "   make -f gmakefile test <options>"
411	-@echo
412	-@echo "Options:"
413	-@echo "  NO_RM=1           Do not remove the executables after running"
414	-@echo "  REPLACE=1         Replace the output in the PETSC_DIR source tree (-m to test scripts)"
415	-@echo "  DIFF_NUMBERS=1    Diff the numbers in the output (-j to test scripts and petscdiff)"
416	-@echo "  VALGRIND=1        Execute the tests using valgrind (-V to test scripts)"
417	-@echo "  OPTIONS='<args>'  Override options to scripts (-a to test scripts)"
418	-@echo "  EXTRA_OPTIONS='<args>'  Add options to scripts (-e to test scripts)"
419	-@echo
420	-@echo "Tests can be generated by searching:"
421	-@echo "  Percent is a wildcard (only one allowed):"
422	-@echo "    make -f gmakefile test search=sys%ex2"
423	-@echo
424	-@echo "  To match internal substrings (matches *ex2*):"
425	-@echo "    make -f gmakefile test searchin=ex2"
426	-@echo
427	-@echo "  Search and searchin can be combined:"
428	-@echo "    make -f gmakefile test search='sys%' searchin=ex2"
429	-@echo
430	-@echo "  To match patterns in the arguments:"
431	-@echo "    make -f gmakefile test argsearch=cuda"
432	-@echo
433	-@echo "  For general glob-style searching using python:"
434	-@echo "   NOTE: uses shell which is possibly slower and more brittle"
435	-@echo "    make -f gmakefile test globsearch='sys*ex2*'"
436	-@echo
437	-@echo "  To see which targets match a given pattern (useful for doing a specific target):"
438	-@echo "    make -f gmakefile print-test search=sys%"
439	-@echo "  which is equivalent to:"
440	-@echo "    make -f gmakefile print VAR=TESTTARGETS search='sys%'"
441	-@echo
442	-@echo "  To build an executable, give full path to location:"
443	-@echo '    make -f gmakefile $${PETSC_ARCH}/tests/src/sys/examples/tests/ex1'
444	-@echo "  or make the test with NO_RM=1"
445	-@echo
446
447