Prebuild Batch File

Added by Adrian Hirst over 2 years ago

Hi,

I would like to run a simple prebuild batch file that runs before compiling. There are no dependencies as such I would just like it to run everytime

How would I do this in jamplus?

Thanks for any help


Replies (3)

RE: Prebuild Batch File - Added by Joshua Jensen over 2 years ago

Can you give an example? I've got some examples, but I'm not sure which apply to you.

RE: Prebuild Batch File - Added by Adrian Hirst over 2 years ago

Hi,

Thankyou for the reply. As you can see below i'm trying to run a batch file called Tool.bat before compilation, How would I achieve this?

Thanks

@{

SubDir TOP src Game : Game ;

local ROOT_SRCS =
Game.cpp
Game.h
;

local SRCS = $(ROOT_SRCS)
;

C.IncludeDirectories Game :
./
;

C.LinkPrebuiltLibraries Game :
user32
wsock32
Advapi32
: * : win32 ;

C.OutputPath Game :
../../bin
: * : win32 ;

actions SomeBatchFile {
"$(TOP)/Tool.bat" ;
}

SomeBatchFile Game ;

C.Application Game : $(SRCS) : console ;

}@

RE: Prebuild Batch File - Added by Joshua Jensen over 2 years ago

Sorry for the late response.

Basically, what you want to do involves a bit of trickery with the current state of things. It might be interesting to have a before-Game target automatically created that does what I'm about to show you.

Try this (shortened for brevity):


actions SomeBatchFile {
"$(TOP)/Tool.bat" ;
}

C.Application Game : $(SRCS) : console ;

on Game Depends [ DependsList $(LINK_TARGET) ] : before_Game ;

SomeBatchFile before_Game ;
Always before_Game ;
NotFile before_Game ;

The above forces the batch file to always run. That usually isn't the right thing to do, though. If you can further explain what you're attempting to do, I might be able to guide you even better.

(1-3/3)