]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use 'mktemp' in a portable way: on OS X, mktemp requires a template argument,
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 9 Feb 2011 23:59:36 +0000 (23:59 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 9 Feb 2011 23:59:36 +0000 (23:59 +0000)
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

deal.II/source/Makefile

index d33e71084d6cf35d3e9878f4d5d3d0fcf53860b4..2f0e71662fc8a61c6574971cf616b3b902214ce1 100644 (file)
@@ -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) $@

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.