Hello,
I have been banging
my head on this for a couple too long so I need some help. Here is
the concept of what I am doing: I use an intermediate language(.idl)
to generate 2 cpp and 2 hpp files. I have an exe(idlcompiler) (that
I build to do so) that take the .idl and generate the cpp and hpp files.
What I want to have:
-If change one idl,
I want to regenerate its hpp/cpp files. -If I change the
source code of the exe, I want to rebuild that exe and then I want all
hpp/cpp to be regenerated for their idls.
I ll post part of my jambase that I
find relevent. Feel free to ask for more if you think it is important
Thank you for any information that can
help me make this works !
rule Build( target : source * : projectName
: libFiles * : ignoredLibs * : type : aggregatedLibFiles * : ppdefs * :
postBuildCommand ? ) {
Depends clean : $(cleanTarget)
; ALWAYS $(cleanTarget)
; local CONFIG_NAME = $($(config).NAME)
; # TODO include cleaning
information in variables Clean $(cleanTarget) :
$(target) ; local compiled = ;
for local src in $(source) {
.... if $(src:S)
= ".idl" {
#this are the file to be generated
genSourceCpp = $(src)\\$(src:B).cpp ;
genSourceHpp = $(src)\\$(src:B).hpp ;
genSourceCppWrapper = $(src)\\Wrapper_$(src:B).cpp ;
genSourceHppWrapper = $(src)\\Wrapper_$(src:B).hpp ;
#depend on the generator
Depends $(src) : $($(config).IDLCOMPILER .EXE) ;
## I have tried depending on the project where my idlcompiler is made
#Depends $(src) : <projectname>idlcompiler ;
## I have tried depending on a txt file and my cpp/hpp were always regenerated
#Depends $(src) : z:\\test1.txt2 ;
Clean $(cleanTarget) : $(genSourceCpp) ;
Clean $(cleanTarget) : $(genSourceCppWrapper) ;
# When using multiple
CPUs/threads, make sure no .obj in the same project # is built at the same
time (to avoid multiple access to .pdb).
JAM_SEMAPHORE on $(compiled)
= $(projectName:G=semaphore) ;
# Delete files that can't
be built.
# It seems to be useful
when .pch is invalid, in that case the # .lib/.dll/.exe is still
there even if it fails to build. RMOLD $(target) ;
}
Part of my output for dependency are
4 Name: z:\Intermediate\DebugTools\seed_language_test\seed_class.cpp.obj 1>
: Updating it 1>
: Depends on .\Techno5thGen\UnitTests\seed_language_test\seed\seed_class.cpp
(update) 1>
: Depends on .\Techno5thGen\UnitTests\seed_language_test\seed\seed_class.cpp
(internal node) (update) 1>-> 5 Name:
.\Techno5thGen\UnitTests\seed_language_test\seed\seed_class.cpp 1>
: Updating it 1>
: Depends on .\Techno5thGen\UnitTests\seed_language_test\seed\seed_class.seedunittest
(old) (max time) 1>-> 6 Name:
.\Techno5thGen\UnitTests\seed_language_test\seed\seed_class.seedunittest 1>
: Outdated, updating it 1>
: Depends on z:\test1.txt2 (newer) (max time) 1> 7
Name: z:\test1.txt2 1>
: Newer
<------------------------------------------ Why is this
always newer? The date doesnt change on the disk...
Olivier Pomerleau
Game Programmer
Artificial Mind & Movement