From 4e10a4d84d3d37fde126dda962aac4c3cb92f948 Mon Sep 17 00:00:00 2001 From: flykhan Date: Sat, 22 Jul 2023 10:38:05 +0800 Subject: [PATCH] =?UTF-8?q?stuMS=E6=9B=B4=E6=96=B0=20makefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- day15/d1-stuMangerSystem/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/day15/d1-stuMangerSystem/Makefile b/day15/d1-stuMangerSystem/Makefile index fa45198..9ccf70b 100644 --- a/day15/d1-stuMangerSystem/Makefile +++ b/day15/d1-stuMangerSystem/Makefile @@ -10,18 +10,18 @@ OBJ_DIR := ./objs # CC 是编译器 # CC = gcc # TARGET 是目标文件 -TARGET = main +TARGET = $(OBJ_DIR)/main # OBJ 是目标文件依赖的文件 # OBJ = link.o main.o OBJ = $(OBJ_DIR)/link.o $(OBJ_DIR)/main.o # 所有的 .o 文件都依赖于 .c 文件 $(OBJ_DIR)/%.o: %.c - $(CC) -c $< -o $@ + @$(CC) -c $< -o $@ # 意思是: 目标文件依赖于 OBJ, 执行命令是 $(CC) $(OBJ) -o $(TARGET) $(TARGET): $(OBJ) - $(CC) $(OBJ) -o $(TARGET) + @$(CC) $(OBJ) -o $(TARGET) # # link.o 依赖于 link.c, 执行命令是 $(CC) -c link.c -o link.o # # 用于生成目标文件 link.o