chsrc/Makefile

43 lines
879 B
Makefile
Raw Normal View History

2023-09-05 20:56:24 +08:00
# ---------------------------------------------------------------
# File : Makefile
# License : GPLv3
# Authors : Aoran Zeng <ccmywish@qq.com>
# Created on : <2023-08-28>
2023-09-06 20:11:59 +08:00
# Last modified : <2023-09-06>
2023-09-05 20:56:24 +08:00
# ---------------------------------------------------------------
2023-09-06 20:11:59 +08:00
CFLAGS = # -Wall
ifeq ($(OS), Windows_NT)
CLANG_FLAGS = -target x86_64-pc-windows-gnu
endif
2023-08-28 22:21:33 +08:00
2023-09-02 20:06:05 +08:00
TARGET = chsrc
2023-08-28 22:21:33 +08:00
#=======================
2023-09-06 20:11:59 +08:00
all: echo
ifeq ($(CC), clang)
@$(CC) chsrc.c $(CLANG_FLAGS) $(CFLAGS) -o $(TARGET)
else
@$(CC) chsrc.c $(CFLAGS) -o $(TARGET)
endif
echo:
@echo Compile using \'$(CC)\' $(CFLAGS) on $(OS) ...
2023-08-30 09:54:35 +08:00
2023-09-05 09:32:42 +08:00
test: $(TARGET)
2023-09-02 20:06:05 +08:00
./$(TARGET) list mirror
./$(TARGET) list target
./$(TARGET) get ruby
./$(TARGET) get python
2023-09-10 13:15:34 +08:00
.PHONY: xy
2023-09-06 20:11:59 +08:00
xy:
@$(CC) test_xy.c -o xy
2023-09-05 09:32:42 +08:00
@./xy
2023-08-30 09:54:35 +08:00
clean:
-@rm *.exe 2>/dev/null
-@rm $(TARGET) 2>/dev/null
2023-09-05 09:32:42 +08:00
-@rm ./xy 2>/dev/null