Move to include

This commit is contained in:
Aoran Zeng 2024-05-24 16:45:18 +08:00
parent 44d9acd6b0
commit d1da065906
4 changed files with 17 additions and 15 deletions

View File

@ -6,11 +6,11 @@
# Last modified : <2024-05-24> # Last modified : <2024-05-24>
# --------------------------------------------------------------- # ---------------------------------------------------------------
CFLAGS = # -Wall CFLAGS = -Iinclude # -Wall
# 只有Windows会定义该变量 # 只有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
ifeq ($(CC), clang) ifeq ($(CC), clang)
CFLAGS += $(CLANG_FLAGS) CFLAGS += $(CLANG_FLAGS)
@ -19,30 +19,32 @@ ifeq ($(shell uname), Linux)
CFLAGS += -static CFLAGS += -static
endif endif
TARGET = chsrc Target = build/chsrc
CI_BUILD_NAME = chsrc CI_Build_Name = chsrc
#======================= #=======================
all: all: build_dir
@$(CC) chsrc.c $(CFLAGS) -o $(TARGET) @$(CC) chsrc.c $(CFLAGS) -o $(Target)
@echo; echo Compile done using \'$(CC)\' $(CFLAGS) @echo; echo Compile done using \'$(CC)\' $(CFLAGS)
CI: all CI: all
@mv chsrc $(CI_BUILD_NAME) @mv $(Target) $(CI_Build_Name)
test: $(TARGET) build_dir:
./$(TARGET) list mirror @mkdir build
./$(TARGET) list target
./$(TARGET) get ruby
./$(TARGET) get python
test_xy: test: $(Target)
@mkdir -p build ./$(Target) list mirror
./$(Target) list Target
./$(Target) get ruby
./$(Target) get python
test_xy: build_dir
@$(CC) test/xy.c -o build/xy @$(CC) test/xy.c -o build/xy
@./build/xy @./build/xy
clean: clean:
-@rm *.exe 2>/dev/null -@rm *.exe 2>/dev/null
-@rm $(TARGET) 2>/dev/null -@rm $(Target) 2>/dev/null
-@rm ./build/* 2>/dev/null -@rm ./build/* 2>/dev/null

View File