Makefile Practical Guide: Start from Scratch for Effortless Code Compilation

Introduction: Are you also a “Command Repeater”? Every time you compile code, you have to type a long string of commands: gcc -o app main.c tool.c -I./include -L./lib -lm…… Change a line of code, and you have to type it all over again; if you mistype a character, you have to start from scratch — … Read more

A Comprehensive Guide to Makefile: From Basics to Advanced Applications

This article is generated by Tencent Yuanbao, with content outline and verification provided by @Xiao Hui~ 1. Origin, Problem Solving, and Application Scenarios of Makefile 1.1 Origin and Core Value Makefile was created in 1977 by Stuart Feldman at Bell Labs, aimed at solving the problem of inefficient compilation of large C language projects. In … Read more

How to Write a Makefile? From Beginner to Expert, All in One Article!

As a programmer, you must have encountered situations where you have to input a long string of commands every time you compile a project. Different files require different compilation options, and even a slight change means retyping the command… If you are troubled by these issues, then Makefile is your savior! What is a Makefile? … Read more

Automated RNA Sequencing Workflow Deployment with Makefile

I wrote a Makefile to quickly deploy a small project that automates the integration of RNA sequencing via email. This small project automatically clears all files under the entire project directory approximately every week, so quick automated deployment is quite necessary. The format layout presented may have issues, and directly copying it might cause problems; … Read more

Compiling Software from Source Code

1. Core Purpose & Concepts Core Purpose: Understanding the ultimate charm of open-source software—by obtaining the program’s source code, we can personally modify, compile, and install a unique version tailored to our preferences. This is a transformation from “user” to “participant”. Core Terminology: Source Code: A human-readable text file containing program instructions written in high-level … Read more

Understanding Core Concepts and Pattern Rules in Makefile

Recently, I have been learning about the wildcard % in makefiles. At first, I found it quite confusing, but gradually I understood that it is fundamentally different from the wildcard * in Linux; it is more like a wildcard specifically designed for makefiles. Let’s break this down step by step. First, let’s understand the core … Read more

Writing the Simplest Linux Kernel Driver (Hello World)

Writing the Simplest Linux Kernel Driver (Hello World)

Table of Contents 1. Introduction 2. Overall Process 3. Position in the System 4. Writing C Source Code 5. Writing Makefile 6. Compile, Load, View, Unload 6.1 Compile Module 6.2 Load Module 6.3 View Module and Logs 6.4 Unload Module 6.5 View Logs Again 7. Common Errors and Troubleshooting 7.1 insmod Error: invalid module format … Read more

Essential C Language Development | A Comprehensive Guide to Makefile: From Basics to Advanced Applications

Essential C Language Development | A Comprehensive Guide to Makefile: From Basics to Advanced Applications

Follow and star our public account for exciting content Source: Internet Makefile is a compilation control file widely used for automating project builds. It defines a series of rules to guide the build process. With Makefile, developers can easily manage compilation, linking, cleaning, and other tasks for large projects. This article will start with the … Read more

Key Points for Writing Makefiles

Key Points for Writing Makefiles

Note: Please indicate the source if reprinted, all rights reserved.Note: This is just based on my own understanding,if it conflicts with your principles and ideas, please forgive me and do not criticize. Environment Description   None Introduction   Recently, while organizing my files, I found that due to my laziness, I forgot a lot of information that … Read more

A Simple Guide to Using CMake

A Simple Guide to Using CMake

👉 Official Tutorial: https://cmake.org/cmake/help/latest/guide/tutorial/index.html Why do we need CMake? Although we already have Make, why should we use CMake? 1. Cross-platform support: It works not only on Linux but also on Windows, macOS, and other platforms. 2. Easy configuration: Describe the build process with simple scripts, avoiding the need to repeatedly write complex Makefiles. 3. … Read more