Matmake2 is a robust, fast and small c++-module-supporting build system.
Features:
- Small configuration files
- Automatic dependency checking
- c++-20 modules support
The following will include all cpp and cppm-files in "src" and
build a executable named main
or main.exe
(depending on platform)
main
src =
*.cpp
*.cppm
out = main
config =
c++20
modules
command = [exe]
all:
in = @main
Example of more complicated file:
main
src =
*.cpp
*.cppm
out = main # On windows ".exe" will be added to this name
command = [exe]
em:ldflags -s SDL=2 # use these flags for "em" target
!em:ldflags -lSDL2 # use these flags for all exept "em" target
gcc
config = # add extra warnings to this specific compiler
c++17
modules
Wall
Wpedantic
debug # Compile with debug information
This is the easiest way to build matmake on, and does only require you to install a relativly new compiler.
- Install a descent version of g++ or clang++
- move to the matmake2 folder
- run
make
# optional step to install:
make install
- You are done
./build-linux.sh clang++-10
or
./build-linux.sh g++-10
Install Mingw
run
build-win-gcc.bat
Install visual studio 2019 run
build-win-msvc.bat
run
build-win-clang.bat
Navigate to where you want to create the project in terminal or cmd.
run
matmake2 --init project-name
matmake -C project-name --target gcc
Where project-name
is the name of your project. And gcc
could be replaced
with clang
, msvc
or wine-msvc
depending on what compiler you want to use
https://clang.llvm.org/docs/Modules.html
(Requires access to a windows machine)
-
Download and install Microsoft Visual Studio on a windows machine
-
Install wine on your linux machine
-
Copy "Microsoft Visual Studio/2019" and "Windows Kits" from the windows machine to corresponding location on the wine drive (~./drive_c/Program Files (x86))
-
Run matmake2 with "--target wine-msvc" to compile
You might have to install the vcruntime.dll to your wine drive as well or put it in your build folder, otherwise the program will show errors on startup.