Build your C++ project using the C++ rules you defined, which are implemented in C++, so you can use std::string/std::vector/std::map these STL containers and you can define any variable, function or class. Unbelievable, right?
Define your building rules in 'BUILD.inc' or 'BUILD.cpp' under each dir, and define global common vars/funcs/rules in '${project_root}/WORKSPACE.h', and put some preparation works(import other libraries or adjust default flags/compilers) into root BUILD.inc(normally, it's '${project_root}/BUILD.inc').
See all available C++ APIs in zmake.h and the demo under demo;
Firstly, use zmake
to build your project(it'll firstly generate 'BUILD.exe'
under your project root dir and then run ./BUILD.exe
to build), and you can
use ./BUILD.exe
to rebuild if you only modify project's source/header files(no
change for the building rules, i.e.: no any change for any BUILD.inc/BUILD.cpp/
WORKSPACE.h);
All generated files locate under '.zmade/', and if you want to clean, just
rm -rf .zmade/
, and you can find the files that record original compile or
link commands by find .zmade/ -name '*.cmd'
;
Using zmake -h
to see all options.
Here is a PPT for introduction zmake.
Report bugs to [email protected]
Execute following commands:
- git clone https://github.com/bacoo/zmake.git
- cd zmake
- make -j && make clean
zmake
and its headers and lib will be installed under ~/bin/
Build demo
You need to build project1 firstly, since it is depended by project2.
- build demo/project1
- cd demo/project1
- zmake -e
- build demo/project2
- cd demo/project2
- zmake -v
- build demo/project3/
- cd demo/project3/
- zmake -s