[PATCH vkd3d 2/3] Makefiles: Make the sed(1) command more portable.

Chip Davis cdavis at codeweavers.com
Thu Aug 2 11:53:53 CDT 2018


BSD sed(1) requires an argument after -i giving the suffix to put on the
backup it makes. Also, the regular expression given doesn't seem to work
for me. This command should work everywhere.

Also, make the output a little less verbose when V=0.

Signed-off-by: Chip Davis <cdavis at codeweavers.com>
---
 Makefile.am | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 14f2d51..4e8f942 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -150,16 +150,17 @@ vkd3d_v_widl_1 =
 EXTRA_DIST += $(widl_headers) $(widl_headers:.h=.idl)
 $(widl_headers): %.h: %.idl
 if HAVE_WIDL
-	$(VKD3D_V_WIDL)$(WIDL) -o $@ $<
-	sed -e '/#include <\(rpc.h\|rpcndr.h\)>/d' -i $@
+	$(VKD3D_V_WIDL)$(WIDL) -o [email protected] $<
+	$(AM_V_at) sed -e '/#include <rpc.h>/d' -e '/#include <rpcndr.h>/d' <[email protected] >$@
+	$(AM_V_at) rm -f [email protected]
 else
-	echo "widl is required to generate $<"
+	@echo "widl is required to generate $<"
 endif
 
 EXTRA_DIST += $(vkd3d_demos_shaders)
 
 libvkd3d-utils.pc: $(srcdir)/libs/vkd3d-utils/libvkd3d-utils.pc.in
-	sed -e 's![@]prefix[@]!$(prefix)!g' \
+	$(AM_V_GEN) sed -e 's![@]prefix[@]!$(prefix)!g' \
 		-e 's![@]exec_prefix[@]!$(exec_prefix)!g' \
 		-e 's![@]includedir[@]!$(includedir)!g' \
 		-e 's![@]libdir[@]!$(libdir)!g' \
@@ -167,7 +168,7 @@ libvkd3d-utils.pc: $(srcdir)/libs/vkd3d-utils/libvkd3d-utils.pc.in
 		$< > $@
 
 libvkd3d.pc: $(srcdir)/libs/vkd3d/libvkd3d.pc.in
-	sed -e 's![@]prefix[@]!$(prefix)!g' \
+	$(AM_V_GEN) sed -e 's![@]prefix[@]!$(prefix)!g' \
 		-e 's![@]exec_prefix[@]!$(exec_prefix)!g' \
 		-e 's![@]includedir[@]!$(includedir)!g' \
 		-e 's![@]libdir[@]!$(libdir)!g' \
@@ -175,7 +176,7 @@ libvkd3d.pc: $(srcdir)/libs/vkd3d/libvkd3d.pc.in
 		$< > $@
 
 libs/vkd3d_version.c: dummy-vkd3d-version
-	version=`(GIT_DIR=$(top_srcdir)/.git git describe HEAD 2>/dev/null || echo "vkd3d-$(PACKAGE_VERSION)") | sed -n -e '$$s/\(.*\)/const char vkd3d_build[] = "\1";/p'` && (echo $$version | cmp -s - $@) || echo $$version >$@ || ($(RM) $@ && exit 1)
+	$(AM_V_GEN) version=`(GIT_DIR=$(top_srcdir)/.git git describe HEAD 2>/dev/null || echo "vkd3d-$(PACKAGE_VERSION)") | sed -n -e '$$s/\(.*\)/const char vkd3d_build[] = "\1";/p'` && (echo $$version | cmp -s - $@) || echo $$version >$@ || ($(RM) $@ && exit 1)
 .SILENT: libs/vkd3d_version.c
 CLEANFILES += libs/vkd3d_version.c
 
-- 
2.18.0




More information about the wine-devel mailing list