All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] keycodemapdb: try fix makefile deps
@ 2017-10-06 11:13 Gerd Hoffmann
  2017-10-06 13:58 ` Daniel P. Berrange
  0 siblings, 1 reply; 2+ messages in thread
From: Gerd Hoffmann @ 2017-10-06 11:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P. Berrange, Peter Maydell, Gerd Hoffmann

(1) make .git-submodule-status depend on config-host.mak,
    for GIT_SUBMODULES changes.

(2) make $(KEYCODEMAP_{GEN,CSV}) depend on .git-submodule-status
    so make knows what to do if they are not there.

I still get errors because make tries to generate the files before they are checked out,
but make seems to notice it has to start over and correctly generates the files on the
second attempt.

[ ... ]
  GEN     config-host.h
  GEN     module_block.h
  GEN     ui/input-keymap-linux-to-qcode.c
  GEN     ui/input-keymap-qcode-to-qnum.c
  GEN     ui/input-keymap-qnum-to-qcode.c
python: can't open file '/home/kraxel/projects/qemu/ui/keycodemapdb/tools/keymap-gen': [Errno 2] No such file or directory
python: can't open file '/home/kraxel/projects/qemu/ui/keycodemapdb/tools/keymap-gen': [Errno 2] No such file or directory
python: can't open file '/home/kraxel/projects/qemu/ui/keycodemapdb/tools/keymap-gen': [Errno 2] No such file or directory
make: Leaving directory `/home/kraxel/projects/qemu/build-default'
make: Entering directory `/home/kraxel/projects/qemu/build-default'
  GIT     ui/keycodemapdb
  GEN     trace/generated-tcg-tracers.h
  GEN     trace/generated-helpers-wrappers.h
  GEN     trace/generated-helpers.h
  GEN     trace/generated-helpers.c
  GEN     ui/input-keymap-linux-to-qcode.c
  GEN     ui/input-keymap-qcode-to-qnum.c
  GEN     ui/input-keymap-qnum-to-qcode.c
  CC      qga/main.o
[ ... ]
---
 Makefile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 1d3b31f074..c97258629e 100644
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ git-submodule-update:
 endif
 endif
 
-.git-submodule-status: git-submodule-update
+.git-submodule-status: git-submodule-update config-host.mak
 
 Makefile: .git-submodule-status
 
@@ -225,7 +225,7 @@ KEYCODEMAP_FILES = \
 
 GENERATED_FILES += $(KEYCODEMAP_FILES)
 
-ui/input-keymap-%.c: $(KEYCODEMAP_GEN) $(KEYCODEMAP_CSV) $(SRC_PATH)/ui/Makefile.objs .git-submodule-status
+ui/input-keymap-%.c: $(KEYCODEMAP_GEN) $(KEYCODEMAP_CSV) $(SRC_PATH)/ui/Makefile.objs
 	$(call quiet-command,\
 	    src=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\1,") && \
 	    dst=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\2,") && \
@@ -235,6 +235,9 @@ ui/input-keymap-%.c: $(KEYCODEMAP_GEN) $(KEYCODEMAP_CSV) $(SRC_PATH)/ui/Makefile
 	          code-map $(KEYCODEMAP_CSV) $${src} $${dst} \
 	        > $@ || rm $@, "GEN", "$@")
 
+$(KEYCODEMAP_GEN): .git-submodule-status
+$(KEYCODEMAP_CSV): .git-submodule-status
+
 # Don't try to regenerate Makefile or configure
 # We don't generate any of them
 Makefile: ;
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] keycodemapdb: try fix makefile deps
  2017-10-06 11:13 [Qemu-devel] [PATCH] keycodemapdb: try fix makefile deps Gerd Hoffmann
@ 2017-10-06 13:58 ` Daniel P. Berrange
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel P. Berrange @ 2017-10-06 13:58 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel, Peter Maydell

On Fri, Oct 06, 2017 at 01:13:42PM +0200, Gerd Hoffmann wrote:
> (1) make .git-submodule-status depend on config-host.mak,
>     for GIT_SUBMODULES changes.
> 
> (2) make $(KEYCODEMAP_{GEN,CSV}) depend on .git-submodule-status
>     so make knows what to do if they are not there.
> 
> I still get errors because make tries to generate the files before they are checked out,
> but make seems to notice it has to start over and correctly generates the files on the
> second attempt.
> 
> [ ... ]
>   GEN     config-host.h
>   GEN     module_block.h
>   GEN     ui/input-keymap-linux-to-qcode.c
>   GEN     ui/input-keymap-qcode-to-qnum.c
>   GEN     ui/input-keymap-qnum-to-qcode.c
> python: can't open file '/home/kraxel/projects/qemu/ui/keycodemapdb/tools/keymap-gen': [Errno 2] No such file or directory
> python: can't open file '/home/kraxel/projects/qemu/ui/keycodemapdb/tools/keymap-gen': [Errno 2] No such file or directory
> python: can't open file '/home/kraxel/projects/qemu/ui/keycodemapdb/tools/keymap-gen': [Errno 2] No such file or directory

We could perhaps avoid that error message by changing the make rule to
do    "test -e $(KEYCODEMAP_GEN) && $(KEYCODEMAP_GEN) || exit 0"

> make: Leaving directory `/home/kraxel/projects/qemu/build-default'
> make: Entering directory `/home/kraxel/projects/qemu/build-default'
>   GIT     ui/keycodemapdb
>   GEN     trace/generated-tcg-tracers.h
>   GEN     trace/generated-helpers-wrappers.h
>   GEN     trace/generated-helpers.h
>   GEN     trace/generated-helpers.c
>   GEN     ui/input-keymap-linux-to-qcode.c
>   GEN     ui/input-keymap-qcode-to-qnum.c
>   GEN     ui/input-keymap-qnum-to-qcode.c
>   CC      qga/main.o
> [ ... ]
> ---
>  Makefile | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 1d3b31f074..c97258629e 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -33,7 +33,7 @@ git-submodule-update:
>  endif
>  endif
>  
> -.git-submodule-status: git-submodule-update
> +.git-submodule-status: git-submodule-update config-host.mak
>  
>  Makefile: .git-submodule-status
>  
> @@ -225,7 +225,7 @@ KEYCODEMAP_FILES = \
>  
>  GENERATED_FILES += $(KEYCODEMAP_FILES)
>  
> -ui/input-keymap-%.c: $(KEYCODEMAP_GEN) $(KEYCODEMAP_CSV) $(SRC_PATH)/ui/Makefile.objs .git-submodule-status
> +ui/input-keymap-%.c: $(KEYCODEMAP_GEN) $(KEYCODEMAP_CSV) $(SRC_PATH)/ui/Makefile.objs
>  	$(call quiet-command,\
>  	    src=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\1,") && \
>  	    dst=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\2,") && \
> @@ -235,6 +235,9 @@ ui/input-keymap-%.c: $(KEYCODEMAP_GEN) $(KEYCODEMAP_CSV) $(SRC_PATH)/ui/Makefile
>  	          code-map $(KEYCODEMAP_CSV) $${src} $${dst} \
>  	        > $@ || rm $@, "GEN", "$@")
>  
> +$(KEYCODEMAP_GEN): .git-submodule-status
> +$(KEYCODEMAP_CSV): .git-submodule-status
> +
>  # Don't try to regenerate Makefile or configure
>  # We don't generate any of them
>  Makefile: ;

This looks like a plausible solution to the problem. I've just kicked off
a travis buld with the patch applied:

https://travis-ci.org/berrange/qemu/builds/284220642

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-06 13:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-06 11:13 [Qemu-devel] [PATCH] keycodemapdb: try fix makefile deps Gerd Hoffmann
2017-10-06 13:58 ` Daniel P. Berrange

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.