Make will run this target by default, useful with multiple recipes, if not specified first target in the structure will be default.
usingLogging
bool
*
Enable logging of making process, enabled by default.
currentPath
string
*
Current working directory, by default is the folder where make script is located.
Target
Property
Type
Description
name
string
Target name.
shell
string
Commands to execute in comand prompt.
after
array/string
Files for validation and "up-to-date" check with files from 'before'. Validation - check whether all files from this list exists. "Up-to-date" means that any file from 'after' property is newer then other any file from 'before' or they have same date.
before
array/string
Dependencies( files/targets ) that must checked for "up-to-date" before recipe execution.If recipe is "up-to-date" it will not be executed.
pre
function
Function called at the beginning of recipe execution.
post
function
Function called at the ending of recipe execution.
Methods
Name
Description
form
Runs default target using name specified as 'defaultTargetName'.
exec
Runs default target using name specified as 'defaultTargetName' or as command line argument.
makeTarget
Runs target using name passed as argument.
Example #1
/*simplest make target example using g++*/vartarget={after : 'my_file.o',before : 'my_file.cpp',shell : `g++ -c my_file.cpp -o my_file.o`}wMaker({recipe : [target]}).form();
Example #2
/*example of using pre function in target*/var_=wTools;varpre=function(){/*some useful code here for example creating *.cpp file */varcode='int main() { return 0; }';fileProvider=_.FileProvider.HardDrive();fileProvider.fileWriteAct({filePath : 'my_file.cpp',data : code,sync : 1,});}vartarget={pre : pre,after : 'my_file.o',before : 'my_file.cpp',shell : `g++ -c my_file.cpp -o my_file.o`}wMaker({recipe : [target]}).form();
Example #3
/*run specific target using makeTarget*/vartarget={name : 't1',after : 'my_file.o',before : 'my_file.cpp',shell : `g++ -c my_file.cpp -o my_file.o`}varmaker=wMaker({recipe : [target],defaultTargetName : ''/*disable default target execution by form()*/});maker.form();/*run form to process provided target info*/maker.makeTarget('t1');/*run recipe t1*/