Don't use tmp files in Makefile

Useful for code-coverage generation of the ragel-generated files
as they will now contain the correct .hh filename in them.
This commit is contained in:
Behdad Esfahbod 2014-10-01 12:41:03 -04:00
parent 2272318665
commit 8971cac83e
1 changed files with 13 additions and 14 deletions

View File

@ -234,8 +234,8 @@ hb-gobject-enums.%: hb-gobject-enums.%.tmpl $(HBHEADERS)
$(AM_V_GEN) $(GLIB_MKENUMS) \ $(AM_V_GEN) $(GLIB_MKENUMS) \
--identifier-prefix hb_ --symbol-prefix hb_gobject \ --identifier-prefix hb_ --symbol-prefix hb_gobject \
--template $^ | \ --template $^ | \
sed 's/_t_get_type/_get_type/g; s/_T (/ (/g' > "$@.tmp" && \ sed 's/_t_get_type/_get_type/g; s/_T (/ (/g' > "$@" \
mv "$@.tmp" "$@" || ( $(RM) "@.tmp" && false ) || ($(RM) "$@"; false)
endif endif
EXTRA_DIST += \ EXTRA_DIST += \
harfbuzz-gobject.pc.in \ harfbuzz-gobject.pc.in \
@ -251,8 +251,8 @@ EXTRA_DIST += \
-e 's@%libdir%@$(libdir)@g' \ -e 's@%libdir%@$(libdir)@g' \
-e 's@%includedir%@$(includedir)@g' \ -e 's@%includedir%@$(includedir)@g' \
-e 's@%VERSION%@$(VERSION)@g' \ -e 's@%VERSION%@$(VERSION)@g' \
"$<" \ "$<" > "$@" \
> "$@.tmp" && mv "$@.tmp" "$@" || ( $(RM) "$@.tmp"; false ) || ($(RM) "$@"; false)
CLEANFILES += $(pkgconfig_DATA) CLEANFILES += $(pkgconfig_DATA)
@ -265,8 +265,9 @@ harfbuzz.def: $(HBHEADERS) $(HBNODISTHEADERS)
sed -e 's/ (.*//' | \ sed -e 's/ (.*//' | \
LANG=C sort; \ LANG=C sort; \
echo LIBRARY libharfbuzz-$(HB_VERSION_MAJOR).dll; \ echo LIBRARY libharfbuzz-$(HB_VERSION_MAJOR).dll; \
) >"$@.tmp" ) >"$@"
@ ! grep -q hb_ERROR "$@.tmp" && mv "$@.tmp" "$@" || ($(RM) "$@"; false) @ ! grep -q hb_ERROR "$@" \
|| ($(RM) "$@"; false)
GENERATORS = \ GENERATORS = \
@ -278,14 +279,12 @@ EXTRA_DIST += $(GENERATORS)
unicode-tables: arabic-table indic-table unicode-tables: arabic-table indic-table
indic-table: gen-indic-table.py IndicSyllabicCategory.txt IndicMatraCategory.txt Blocks.txt indic-table: gen-indic-table.py IndicSyllabicCategory.txt IndicMatraCategory.txt Blocks.txt
$(AM_V_GEN) $(builddir)/$^ > hb-ot-shape-complex-indic-table.cc.tmp && \ $(AM_V_GEN) $(builddir)/$^ > hb-ot-shape-complex-indic-table.cc \
mv hb-ot-shape-complex-indic-table.cc.tmp $(srcdir)/hb-ot-shape-complex-indic-table.cc || \ || ($(RM) hb-ot-shape-complex-indic-table.cc; false)
($(RM) hb-ot-shape-complex-indic-table.cc.tmp; false)
arabic-table: gen-arabic-table.py ArabicShaping.txt UnicodeData.txt Blocks.txt arabic-table: gen-arabic-table.py ArabicShaping.txt UnicodeData.txt Blocks.txt
$(AM_V_GEN) $(builddir)/$^ > hb-ot-shape-complex-arabic-table.hh.tmp && \ $(AM_V_GEN) $(builddir)/$^ > hb-ot-shape-complex-arabic-table.hh \
mv hb-ot-shape-complex-arabic-table.hh.tmp $(srcdir)/hb-ot-shape-complex-arabic-table.hh || \ || ($(RM) hb-ot-shape-complex-arabic-table.hh; false)
($(RM) hb-ot-shape-complex-arabic-table.hh.tmp; false)
built-sources: $(BUILT_SOURCES) built-sources: $(BUILT_SOURCES)
@ -306,8 +305,8 @@ EXTRA_DIST += \
hb-ot-shape-complex-sea-machine.rl \ hb-ot-shape-complex-sea-machine.rl \
$(NULL) $(NULL)
.rl.hh: .rl.hh:
$(AM_V_GEN)$(RAGEL) -e -F1 -o "$@.tmp" "$<" && \ $(AM_V_GEN)$(RAGEL) -e -F1 -o "$@" "$<" \
mv "$@.tmp" "$@" || ( $(RM) "$@.tmp" && false ) || ($(RM) "$@"; false)
noinst_PROGRAMS = \ noinst_PROGRAMS = \
main \ main \