commit 2a6b5c1

Thomas Gardner  ·  2019-09-24 07:59:05 +0000 UTC
parent dfa8f79
build: preserve generated files

GNU Make sees the generated protocol source file as intermediate. But
intermediate files are deleted after the make invocation. This leads to
two undesirable behaviours:

	1. the generated file cannot be inspected,
	2. the pretty printed build output becomes tainted.

Making the file a prerequisite of .PRECIOUS prevents the deletion.
1 files changed,  +4, -0
+4, -0
 1@@ -4,6 +4,10 @@ dir := protocol
 2 
 3 PROTOCOL_EXTENSIONS = $(dir)/wayland-drm.xml
 4 
 5+# GNUMake correctly marks %-protocol.c as an intermediate file, and deletes it
 6+# after the build. The file can be preserved by marking it as precious.
 7+.PRECIOUS: $(dir)/%-protocol.c
 8+
 9 $(dir)/%-protocol.c: $(dir)/%.xml
10 	$(call quiet,GEN,$(WAYLAND_SCANNER)) code < $< > $@
11