A project management tool integrated with Visual Studio Code that is aimed for C++ projects made on linux.
This project is aimed to make the C++ project development experience on linux to feel more like a Visual Studio project. It achieves that simplicity by making use of tasks in Visual Studio Code and creating a new project structure.
There are three ways to start using PufferMake.
- Building using Visual Studio Code tasks.
- Building using Terminal commands.
- Using the released pre-built binary.
Download this project and extract it to a folder. Open this folder in Visual Studio Code. At the top menu, go to:
Terminal >> Run Task... >> Build
This will open a new terminal window on Visual Studio Code and run compilation and linking processes. The binary file will be in the target folder.
Download this project and extract it to a folder. Open this folder in terminal and run these terminal commands in the given order.
cd objects
g++ -c "../src/main.cpp" "../src/FileList/FileList.cpp" "../src/Configuration/Configuration.cpp" "../src/Maker/Maker.cpp" "../src/ParseCommand/ParseCommand.cpp" -std=c++20 -Os
cd ..
g++ objects/main.o objects/FileList.o objects/Configuration.o objects/ParseCommand.o objects/Maker.o -o ./target/PufferMake
The binary file will be in the target folder.
Download the latest release or, for the bleeding edge executable, use the executable in the target folder.
Move the binary named PufferMake to the folder that you want to create your project in and run one of these commands in that folder. Both does the same thing.
./PufferMake
./PufferMake create
These commands will create the necessary structure to setup the project. This structure contains these:
.vscode/ -folder
objects/ -folder
target/ -folder
src/ -folder
src/main.cpp -file
.vscode/tasks.json -file
build.json -file
defaults.json -file
You should not be changing this folder and its contents manually if you don't know what you are doing. It should provide necessary tasks for PufferMake to operate and should work as it is.
This folder will contain the object files that are created after the compilation.
This folder will contain the result of build/link operations.
This folder will contain files of the project, It comes with an hello world application (main.cpp) as default.
This file contains the default settings of the project manager. It is not advised to change any of the values in this file.
This file contains the build preferences of this project. This is the only file one is allowed to change without an issue.
- build-name: This option is the name of the project. This will be used as the name of the built products. It is adviced to use a name with lowercase characters without spaces.
-
build-type: This option is the type of this project. Allowed options are:
-
executable: This option allows building a standalone executable file. The built product's name will be the same as the specified "{build-name}". As the default, the name should be "app".
-
shared: This option allows building a shared library. The built product's name will be in this format "lib{build-name}.so". As the default, the name should be "libapp.so".
-
static: The built product's name will be in this format "lib{build-name}.a". As the default, the name should be "libapp.a".
-
- cpp-version: C++ standard selection. It allows any keyword that is allowed after "-std=". For more information.
- warnings: This option allows 3 different keywords. disabled option disables all warnings, uses "-w" gcc option. all option enables all warnings, uses "-Wall" option. extra option enables warnings that are not enabled by all keyword, uses "-Wextra" option.
-
optimization: This object is reserved for optimization but allows any compiler option. However, it is only advised to use this option to specify optimization options (For more information). Changing active option into false will disable optimization options. Recommended options are:
- O0 : Optimize for compilation time.
- O1, O : Optimize for code size and execution time.
- O2 : Optimize for code size and more execution time.
- O3 : Optimize for code size and more(+) execution time.
- Os : Optimize for code size.
- Ofast : Same as -O3 with fast non-accurate math (aggressive speed optimization)
- Og : Optimize for debugging experience.
- Oz : Aggressive optimization for code size rather speed.
-
debug: This object is reserved for debug but allows any compiler option. However, it is only advised to use this option to specify debug options (For more information). Changing active option into false will disable debug options. Recommended options are:
- g0 : No debug information.
- g1 : Minimal debug information.
- g : Default debug information.
- g3 : Maximal debug information.
- ggdb : Use most expressive information format that will ease gdb usage.
- gdwarf : Produce debug information in DWARF format.
- include-directories: This is a list that specifies additional include directories.
- static-linking: When active option is true, it searches for files specified in directories and adds these libraries in linking process.
- dynamic-linking: When active option is true, it puts options that indicate files specified in directories.
These are the commands that the PufferMake allows calling. There will be no need to think about them if you are using Visual Studio Code because you can run these tasks by doing these:
Terminal >> Run Task...
If you are not using Visual Studio Code, it is advised to use only the create and build commands that are described below.
./PufferMake
./PufferMake create
These commands are used to create the project. The first command that should be used after optaining PufferMake.
./PufferMake preprocess
This command generates the results after applying the preprocessor macros to all the source files in preprocessed folder.
./PufferMake compile
This command compiles all source files and generates results in objects folder.
./PufferMake link-executable
This command links object files with specified build options as an executable. It is not advised to call any link command explicitly, other than the one specified in build.json, since it might not work as intended. It is better to call build or build-run.
./PufferMake link-shared
This command links object files with specified build options as a shared library. It is not advised to call any link command explicitly, other than the one specified in build.json, since it might not work as intended. It is better to call build or build-run.
./PufferMake link-static
This command links object files with specified build options as a static library. It is not advised to call any link command explicitly, other than the build-type specified in build.json, since it might not work as intended. It is better to call build or build-run.
./PufferMake run
This command runs the executable that is in the target folder. It will not run any executable if the specified build-type is static or shared.
./PufferMake build
This command builds the project with specified instructions in build.json and generates the result in target folder. It calls compile and link operations sequentially.
./PufferMake build-run
This command builds the project with specified instructions in build.json, generates the result in target folder and runs that result if the build-type of this project is executable. It calls compile, link and run operations sequentially.