From: Wolfgang Bangerth Date: Wed, 9 Feb 2011 23:59:36 +0000 (+0000) Subject: Use 'mktemp' in a portable way: on OS X, mktemp requires a template argument, X-Git-Tag: v8.0.0~4377 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b45ad935011192aeca1114443f6124bc5ef0fe46;p=dealii.git Use 'mktemp' in a portable way: on OS X, mktemp requires a template argument, but if we give a template, linux requires providing a path. So specify a template, and use ${TMPDIR:-/tmp} as this path (i.e. use TMPDIR if it is set, and /tmp otherwise). git-svn-id: https://svn.dealii.org/trunk@23321 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/Makefile b/deal.II/source/Makefile index d33e71084d..2f0e71662f 100644 --- a/deal.II/source/Makefile +++ b/deal.II/source/Makefile @@ -165,7 +165,7 @@ $(LIBDIR)/libdeal_II$(static-lib-suffix): $(o-files) $(LIBDIR)/libdeal_II.g$(shared-lib-suffix): $(go-files) @echo "=====deal.II==========debug======$(MT)== Linking library: $(@F)" @rm -f $@ - @WORKFILE=`mktemp` && \ + @WORKFILE=`mktemp $${TMPDIR:-/tmp}/tmp.XXXXXXXXXX` && \ $(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $$WORKFILE $(call DEAL_II_ADD_SONAME,deal_II.g) $(go-files) $(extra-g.o-files) $(deplibs.g) && \ mv $$WORKFILE $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II.g) @ln -f -s $(call DEAL_II_SHLIB_NAME,deal_II.g) $@ @@ -173,7 +173,7 @@ $(LIBDIR)/libdeal_II.g$(shared-lib-suffix): $(go-files) $(LIBDIR)/libdeal_II$(shared-lib-suffix): $(o-files) @echo "=====deal.II==========optimized==$(MT)== Linking library: $(@F)" @rm -f $@ - @WORKFILE=`mktemp` && \ + @WORKFILE=`mktemp $${TMPDIR:-/tmp}/tmp.XXXXXXXXXX` && \ $(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $$WORKFILE $(call DEAL_II_ADD_SONAME,deal_II) $(o-files) $(extra-o-files) $(deplibs.o) && \ mv $$WORKFILE $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II) @ln -f -s $(call DEAL_II_SHLIB_NAME,deal_II) $@