Essential Makefile Guide: Step-by-Step Project Compilation!

Linux | Red Hat Certified | IT Technology | Operations Engineer 👇1000 people technical exchange QQ group, note 【public number】 for faster access 1. Basic Structure of Makefile The Makefile contains a series of “rules”, with the basic structure of each rule as follows: target…: prerequisites… <tab> command Target(target): usually the name of the file … Read more

How to Compile C Programs in Linux

How to Compile C Programs in Linux

Article Word Count: 1400 Practical Index: ⭐⭐⭐⭐⭐ Common IDEs for compiling on Windows, while using gcc directly for compilation in Linux, is the foundation of Linux embedded programming and also a frequently asked question in embedded interviews. Command Line Compilation and Detailed Compilation Process Example code for hello.c: #include <stdio.h> int main(void) { printf("Hello world\n"); … Read more

Understanding U-Boot Makefile

Understanding U-Boot Makefile

1. Compiling U-Boot First, let’s review how to compile U-Boot. (1) Set temporary environment variables export ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- (2) Specify board configuration and generate .config file make xxx_defconfig (3) Compile make -j8 (4) Clean build make distclean Next, we will analyze the top-level Makefile in the U-Boot root directory to explore what happens behind these … Read more

An Overview of Makefile, Kconfig, and .config in Linux Kernel Source

An Overview of Makefile, Kconfig, and .config in Linux Kernel Source

The Linux kernel source code contains numerous files, and understanding the relationships between Makefile, Kconfig, and .config is crucial for navigating the kernel compilation system. Issues arise when trying to compile and modify the kernel, integrate your own drivers, or configure the kernel. All of these problems relate to Makefile, Kconfig, and .config. Below, I … Read more

Why I Use Makefile for Processes

Why I Use Makefile for Processes

Automatically check if target files or source files exist. If the source files are not found, exit the make process. If the target files are found, skip this make step. Automatically check for changes in target files or source files. If the source files are modified, regenerate the corresponding target files. Easy to run multiple … Read more

Overview of Linux Kernel Configuration, Compilation, and Makefile

Overview of Linux Kernel Configuration, Compilation, and Makefile

Recently, I have been learning about the configuration, compilation, and Makefile for the Linux kernel. Today, I would like to summarize my learning results and share them with everyone. 1. Unpacking and Patching First, you need to unpack the Linux kernel you obtained. Here I am using version linux.2.22.6. In the Linux command line, you … Read more

Master Makefile in 5 Minutes

Master Makefile in 5 Minutes

Photographer: Product Manager This Sichuan restaurant tastes quite good In a previous article titled “One Skill a Day: Writing Makefile for Python Projects”, we discussed Makefile. Many students have left messages on the public account backend, wanting to learn more about how to write a Makefile. Thus, we have today’s article. If you are currently … Read more

Practical Debugging Techniques for Makefile

Practical Debugging Techniques for Makefile

In the previous sections, we discussed the basic rules, functions, and patterns of makefiles. When writing makefiles in practice, we often encounter various issues. How can we quickly and effectively solve these problems? Here, I will introduce several common techniques to help us better handle and resolve the issues we encounter. MakefileDebugging Technique1 During the … Read more

General Makefile Application Guide for Advanced Embedded Programming

General Makefile Application Guide for Advanced Embedded Programming

Introduction For development on Windows, many IDEs integrate compilers, such as Visual Studio, providing a “one-click compile” feature, allowing the user to compile, link, and generate target files with just one operation after coding. Linux development differs from Windows; the gcc/g++ compiler is generally used in Linux. If developing Linux programs for ARM, the arm-linux-gcc/arm-linux-g++ … Read more

Makefile Learning Part II: Commands and Variables

Makefile Learning Part II: Commands and Variables

Follow for more updates, let’s go From Zero To Hero! Introduction In Go language development, we want to standardize code style so that each member can format code with one click and check for syntax errors; we want to run unit tests, generate test reports, and compile, package, and release projects with one click, which … Read more