Makefile 打印美元符号
$
$
连续使用两个 $$
,使用单引号
括起来。
# ============================================================================
# Name : Makefile
# Author : Yongqiang Cheng
# Version : Feb 16, 2019
# Copyright : Copyright 2019 ForeverStrong License
# Description : Workspace in C, Ansi-style
# ============================================================================
TARGET=foreverstrong
ifdef DEFINE_VAR
VAR = "!!!Hello World!!!"
endif
ifeq ($(OPT), define)
VAR ?= "!FIRST!"
endif
ifeq ($(OPT), add)
VAR += "!SECOND!"
endif
ifeq ($(OPT), recover)
VAR := "!THIRD!"
endif
x = cheng
y = $(x) yong
x = qiang
m := face
n := $(m) person
m := pedestrian
all :
@echo Compiling Kernel Module
echo Compiling Kernel Module
@echo "$$TARGET" = $(TARGET)
@echo '$$TARGET' = $(TARGET)
@echo $(x)
@echo $(y)
@echo $(m)
@echo $(n)
strong@foreverstrong:~/Desktop/makefile_work$ make
Compiling Kernel Module
echo Compiling Kernel Module
Compiling Kernel Module
= foreverstrong
$TARGET = foreverstrong
qiang
qiang yong
pedestrian
face person
strong@foreverstrong:~/Desktop/makefile_work$