[makefile] use mktemp to create unique temp files

This assumes that mktemp is available, but should provide a better solution for issue #229.

Also create a variable holding the tempfile name which is unique to each target.
This should prevent problems with parallel builds, since these variables are global.
This commit is contained in:
Felix Ruess
2013-03-21 16:43:42 +01:00
parent 7325f9fec8
commit 77cd732702
7 changed files with 112 additions and 94 deletions
+4 -6
View File
@@ -30,9 +30,6 @@ LINKPKG = $(PKG) -linkpkg -dllpath-pkg pprz
XPKG = -package pprz.xlib
XLINKPKG = $(XPKG) -linkpkg -dllpath-pkg pprz.xlib
# default directory for temporary files
TMPDIR ?= /tmp
all: play plotter plot sd2log plotprofile openlog2tlm
play : log_file.cmo play_core.cmo play.cmo
@@ -83,9 +80,10 @@ export.cmx : gtk_export.cmx
gtk_export.ml : export.glade
@echo GLADE $@
$(Q)grep -v invisible_char $< > $(TMPDIR)/$<
$(Q)lablgladecc2 -root export -hide-default $(TMPDIR)/$< | grep -B 1000000 " end" > $@
$(Q)rm $(TMPDIR)/$<
$(eval $@_TMP := $(shell mktemp))
$(Q)grep -v invisible_char $< > $($@_TMP)
$(Q)lablgladecc2 -root export -hide-default $($@_TMP) | grep -B 1000000 " end" > $@
$(Q)rm -f $($@_TMP)
pt : ahrsview imuview ahrs2fg