stuMS更新 makefile
This commit is contained in:
parent
236aafadda
commit
4e10a4d84d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue