mirror of
https://github.com/RubyMetric/chsrc.git
synced 2024-11-22 14:44:36 +08:00
Make Makefile more flexible
This commit is contained in:
parent
67d28684d7
commit
b82689c547
24
Makefile
24
Makefile
|
@ -3,17 +3,27 @@
|
|||
# License : GPLv3
|
||||
# Authors : Aoran Zeng <ccmywish@qq.com>
|
||||
# Created on : <2023-08-28>
|
||||
# Last modified : <2023-09-05>
|
||||
# Last modified : <2023-09-06>
|
||||
# ---------------------------------------------------------------
|
||||
|
||||
CFLAGS =
|
||||
CFLAGS = # -Wall
|
||||
|
||||
ifeq ($(OS), Windows_NT)
|
||||
CLANG_FLAGS = -target x86_64-pc-windows-gnu
|
||||
endif
|
||||
|
||||
TARGET = chsrc
|
||||
#=======================
|
||||
|
||||
all:
|
||||
@echo Compile
|
||||
@gcc chsrc.c $(CFLAGS) -o $(TARGET)
|
||||
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) ...
|
||||
|
||||
test: $(TARGET)
|
||||
./$(TARGET) list mirror
|
||||
|
@ -21,8 +31,8 @@ test: $(TARGET)
|
|||
./$(TARGET) get ruby
|
||||
./$(TARGET) get python
|
||||
|
||||
test_xy:
|
||||
@gcc test_xy.c -o xy
|
||||
xy:
|
||||
@$(CC) test_xy.c -o xy
|
||||
@./xy
|
||||
|
||||
clean:
|
||||
|
|
Loading…
Reference in New Issue
Block a user