[petsc-dev] Experimental GNU make build system

Jed Brown jedbrown at mcs.anl.gov
Tue Jun 4 16:24:52 CDT 2013


Satish Balay <balay at mcs.anl.gov> writes:

> As I understand it - 32k limit is for windows apps [using windows
> compiler dlls?]. Cygwin binaries appear to handle long args properly.

Cool, that explains why your fix works.

> The following updated thingy also works - but with a [false] warning
> from win32fe. I must have seen this before and assumed '@file' didn't
> work from win32fe
>
> I guess I should look at fixing win32fe to handle '@file' properly

I.e., just suppress the warning for arguments starting with '@'?  That
sounds good.

> $ git diff gmakefile
> diff --git a/gmakefile b/gmakefile
> index bf9ce21..83a1a54 100644
> --- a/gmakefile
> +++ b/gmakefile
> @@ -68,9 +68,11 @@ $(libpetsc_shared) : $(srcs.o) | $$(@D)/.DIR
>  $(libpetsc_static) : obj := $(srcs.o)
>
>  %.$(AR_LIB_SUFFIX) : $$(obj) | $$(@D)/.DIR
> -       @$(RM) $@
> -       $(call quiet,AR) $(AR_FLAGS) $@ $^
> +       @$(RM) $@ $@.args
> +       @cygpath -w $^ > $@.args
> +       $(call quiet,AR) $(AR_FLAGS) $@ @`cygpath -w $@.args`
>         $(call quiet,RANLIB) $@
> +       @$(RM) $@.args

You should be able to do a multi-line definition, something like this:

define ARCHIVE_RECIPE_CYGWIN
  @$(RM) $@ $@.args
  @cygpath -w $^ > $@.args
  $(call quiet,AR) $(AR_FLAGS) $@ @`cygpath -w $@.args`
  $(call quiet,RANLIB) $@
  @$(RM) $@.args
endef

define ARCHIVE_RECIPE_DEFAULT
  @$(RM) $@
  $(call quiet,AR) $(AR_FLAGS) $@ $^
  $(call quiet,RANLIB) $@
endef

%.$(AR_LIB_SUFFIX) : $$(obj) | $$(@D)/.DIR
	$(if $(PETSC_HAVE_CYGWIN),$(ARCHIVE_RECIPE_CYGWIN),$(ARCHIVE_RECIPE_DEFAULT))



More information about the petsc-dev mailing list