Skip to content

gcc linux

Deoclecio Freire edited this page May 19, 2023 · 2 revisions

Simple GCC Project on Linux

You will need a Linux system with Python 3 (and Colorama) and essential building tools installed, no need for Make Utilities nor Autotools.

This command will create a very simple project structure.

cppmagic.py prepare -m gcc -e simple
.
├── cppmagic
│   ├── gcc-linux.json  <- GCC options for Linux
│   └── project.json    <- Project configuration
├── include
├── library
│   └── gcc-linux
│       └── x64
│           └── debug
└── source
    └── main.cpp        <- Sample source file

Now lets compile it with debugging information.

cppmagic.py build -m gcc -p x64 -c debug
.
├── build
│   ├── gcc-linux
│   │   └── x64
│   │       └── debug
│   │           ├── Example         <- Generated final binary file
│   │           └── intermediate
│   │               └── Example
│   │                   └── main.o  <- Object file from source code
│   └── run
├── cppmagic
│   ├── gcc-linux.json
│   └── project.json
├── include
├── library
│   └── gcc-linux
│       └── x64
│           └── debug
├── source
│   └── main.cpp
└── temp
    └── gcc
        ├── config.json      <- Big Json file (mix from project and gcc-linux)
        ├── gcc-gpp.par      <- Compile command line
        ├── gcc-header.json  <- ( CppMagic build control file )
        └── gcc-lnk.par      <- Link command line

Clone this wiki locally