Adjust Makefile

This commit is contained in:
Aoran Zeng 2023-09-12 21:56:31 +08:00
parent fced7d17fb
commit 5a12e65826

View File

@ -3,11 +3,12 @@
# License : GPLv3 # License : GPLv3
# Authors : Aoran Zeng <ccmywish@qq.com> # Authors : Aoran Zeng <ccmywish@qq.com>
# Created on : <2023-08-28> # Created on : <2023-08-28>
# Last modified : <2023-09-06> # Last modified : <2023-09-12>
# --------------------------------------------------------------- # ---------------------------------------------------------------
CFLAGS = # -Wall CFLAGS = # -Wall
# 只有Windows会定义该变量
ifeq ($(OS), Windows_NT) ifeq ($(OS), Windows_NT)
CLANG_FLAGS = -target x86_64-pc-windows-gnu CLANG_FLAGS = -target x86_64-pc-windows-gnu
endif endif
@ -15,15 +16,13 @@ endif
TARGET = chsrc TARGET = chsrc
#======================= #=======================
all: echo all:
ifeq ($(CC), clang) ifeq ($(CC), clang)
@$(CC) chsrc.c $(CLANG_FLAGS) $(CFLAGS) -o $(TARGET) @$(CC) chsrc.c $(CLANG_FLAGS) $(CFLAGS) -o $(TARGET)
else else
@$(CC) chsrc.c $(CFLAGS) -o $(TARGET) @$(CC) chsrc.c $(CFLAGS) -o $(TARGET)
endif endif
@echo Compile done using \'$(CC)\' $(CFLAGS)
echo:
@echo Compile using \'$(CC)\' $(CFLAGS) on $(OS) ...
test: $(TARGET) test: $(TARGET)
./$(TARGET) list mirror ./$(TARGET) list mirror