Basics of Makefile

Basics of Makefile

Lost Little Scholar Reading takes 4 minutes Speed reading only takes 2 minutes 1 Introduction The following C language code is very simple #include <stdio.h> int main(){ printf("Hello World!. "); return 0;} In Linux, we can compile it using the following command gcc hello.c -o hello However, as the project grows, there will inevitably be … Read more

A Simple Introduction to Makefile

A Simple Introduction to Makefile

Click the above “Linux Community” to subscribe! 1. Introduction The make command requires a Makefile to tell it how to compile and link the program (simply put: it manages the project files and determines which files to compile first and in what order). 2. Writing Rules: Target1: Dependencies Then press Enter + Tab key Command; … Read more

Introduction to Writing Makefiles

Introduction to Writing Makefiles

Writing Makefiles 1. Introduction to make and Makefile 1.1 The make Tool The <span>make</span> tool can automatically complete compilation tasks. These tasks include: If only a few source files have been modified, only recompile those specific source files; If a header file is modified, recompile all source files that include that header file. This automatic … Read more

CMake Variables: Master Common Variables and Environment Variables

CMake Variables: Master Common Variables and Environment Variables

1. CMake Variable Reference and Definition (1) Use ${} to reference variables. In statements like IF, use the variable name directly without ${}. (2) Custom variables can be defined implicitly and explicitly. For example, the PROJECT command implicitly defines <projectname>_BINARY_DIR and <projectname>_SOURCE_DIR. Explicitly defining variables can be done using the SET command. For example: SET(HELLO_SRC … Read more

Understanding GCC From a Java Programmer’s Perspective

Understanding GCC From a Java Programmer's Perspective

Source | Low Concurrency Programming Author | Flash Player As a Java programmer, I always forget the basic usage of gcc and am not very familiar with it. Today, this article records the basic knowledge of gcc in the simplest way. The Compilation Process Write a hello.c code. #include <stdio.h> #define STR "hello world\n" void … Read more

The Dance of Compilation: C/C++ and GCC Collaboration

The Dance of Compilation: C/C++ and GCC Collaboration

On the modern stage of computing, programming languages are like dancers, while compilers are the choreographers guiding them from behind the scenes. Every piece of code written is like a carefully designed dance. On this stage, C language and GCC (GNU Compiler Collection) are a classic duo. Together, they perform a magnificent dance of compilation, … Read more

Common Linux GCC Commands

Common Linux GCC Commands

(Click the public account above to quickly follow) Source: ggjucheng Link: http://www.cnblogs.com/ggjucheng/archive/2011/12/14/2287738.html 1 Introduction The meaning of GCC is just GNU C Compiler. After so many years of development, GCC now supports not only C language; it also supports Ada, C++, Java, Objective C, Pascal, COBOL, and even functional and logic programming languages like Mercury, … Read more

Building Root Filesystem with Buildroot

Building Root Filesystem with Buildroot

1. General Steps for Building Root Filesystem with Buildroot Buildroot is a framework for building embedded Linux systems, which can automate the configuration, compilation of the kernel, u-boot, and root filesystem. Here is a basic step-by-step guide for generating a root filesystem using Buildroot: 1. Install Buildroot: First, you need to install Buildroot on your … Read more