You can see the first problem here, it was solved, thx Eldar Abusalimov. Now I need to put right targets and dependencies for uic.exe call.
The beginning of the code is:
ui_files := $(wildcard $(SUBDIRS:%=%/*.ui))
ui_headers := $(foreach ui_files,$(ui_files),$(dir $(ui_files))ui_$(notdir $(ui_files:.ui=.h)))
ui_cpp := $(patsubst %.h, %.cpp, $(ui_headers))
First, I need to do is to generate headers what I was trying to do by this code:
<directory/ui_<ui_file_name>.h>: <ui_file_path>
$(QT_BIN)/uic -o $@ $<
Second, I generate cpps :
<directory/ui_<ui_file_name>.cpp>: <ui_file_path> <header_file_path>
$(QT_BIN)/uic -i <header_file_path> -o <target> <ui_file_path>
Help me please, to fill this not-make syntax by make syntax or give me an appropriate method.
Thanks.
I guess it should be something like this (however, I’m not sure, how Make will deal with directory part of the files):
Both rules are static pattern rules.
UPD.
Static pattern rule are not good here, because the pattern is applied to the whole file name (with a path). Instead, one should use regular pattern rules:
How Patterns Match chapter explains how does it work: