Hi Damjan,

After a long thought, can we do this differently?

To copy the feature into SCONs does not improve the situation in my opinion.

I would prefer a more primitive build file. It should simply state:

What code gets compiled into what binary. And on what module / file does the work depend on.

I am fine with templates or preselects of dependency, where you can gather often used dependencies into one line.

Or with a helper tool that has the logic, but it is optional to use.


I think the more stupid and straight forward we construct our construction files,

the more readable and control able the code becomes.

And build will speedup which can also help.


Is it maybe okay to put this code into the converter?

All the Best

Peter


Damjan wrote on 2020/04/15 17:08:08

The per-module gbuild files are easy to parse. Parsing the syntax takes
only 3 methods and < 100 lines of Java. The non-deterministic ones with
"ifeq ($(GUIBASE),aqua)" require some manual work, but even there, a lot
can be automated. There is some more work involved in semantic conversion:
understanding and converting specific gbuild commands, converting paths to
scons format, etc. but even so, we're on just 1913 lines of code in total
for the converter.

The hard part is to convert gbuild functions in main/solenv/gbuild into
scons, for example, the worst case scenario is AllLangResTarget, for which
this monstrous dependency tree needs to be implemented, with 4 layers of
intermediate targets and complex actions with side effects and header
dependencies (not shown):

#                          AllLangResTarget(name)
#                      (meta-target; delivers an empty timestamp file)
#                            ^             ^
#                           /               \
#                          /                 \
#                         /                   \
#      ResTarget(nameen-US,name,en-US)
ResTarget(nameen-GB,name,en-GB)
#      $(WORKDIR)/ResTarget/$(resName).res
$(WORKDIR)/ResTarget/$(resName).res
#      $(WORKDIR)/ResTarget/nameen-US.res
  $(WORKDIR)/ResTarget/nameen-GB.res
#        ^                                       ^                        ^
#        | rsc                                   |                        |
#        |                                       |                        |
#      SrsTarget                               SrsTarget
SrsTarget
#      $(WORKDIR)/SrsTarget/$(srsName).srs
#      $(WORKDIR)/SrsTarget/uui/res.srs
#        ^
#        | concatenate
#        +----------+
#        |           \
#        |            \
#      SrcPartTarget   SrcPartTarget
#                      $(WORKDIR)/SrsPartTarget/$(srsPartName)
#                      $(WORKDIR)/SrsPartTarget/uui/source/ids.src
#                        ^                   ^
#                        | rsc               | rsc
#                        |                   |
# (when not translating) |                   | (when translating)
#                        |                   |
#                        |                SrcPartMergeTarget
#                        |                $(WORKDIR)/SrsPartMergeTarget/$(1)
#                        |
  $(WORKDIR)/SrsPartMergeTarget/uui/source/ids.src
#                        |                 ^
#                        |                /
#                        |               / transex3
#                        |              / (when translating)
#                      $(srsPartName)  /
#                      uuid/source/ids.src
#

Reply via email to