detect OS, chose RM cmd
This commit is contained in:
parent
d880f49a4f
commit
edc636b5be
25
Makefile
25
Makefile
@ -1,3 +1,26 @@
|
|||||||
|
# detect OS
|
||||||
|
ifeq ($(OS),Windows_NT)
|
||||||
|
RM = del /q
|
||||||
|
else
|
||||||
|
UNAME_S := $(shell uname -s)
|
||||||
|
ifeq ($(UNAME_S),Linux)
|
||||||
|
RM = rm -rf
|
||||||
|
endif
|
||||||
|
ifeq ($(UNAME_S),Darwin)
|
||||||
|
RM = rm -rf
|
||||||
|
endif
|
||||||
|
# UNAME_P := $(shell uname -p)
|
||||||
|
# ifeq ($(UNAME_P),x86_64)
|
||||||
|
# CCFLAGS += -D AMD64
|
||||||
|
# endif
|
||||||
|
# ifneq ($(filter %86,$(UNAME_P)),)
|
||||||
|
# CCFLAGS += -D IA32
|
||||||
|
# endif
|
||||||
|
# ifneq ($(filter arm%,$(UNAME_P)),)
|
||||||
|
# CCFLAGS += -D ARM
|
||||||
|
# endif
|
||||||
|
endif
|
||||||
|
|
||||||
# set CC TOOL
|
# set CC TOOL
|
||||||
CC := sdcc
|
CC := sdcc
|
||||||
PACKIHX := packihx
|
PACKIHX := packihx
|
||||||
@ -19,7 +42,7 @@ OBJ := $(patsubst src/%.c, obj/%.rel, $(SRC))
|
|||||||
all: uart_temp.hex
|
all: uart_temp.hex
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-del /q obj\*
|
-$(RM) obj\*
|
||||||
|
|
||||||
$(OBJ):obj/%.rel:src/%.c
|
$(OBJ):obj/%.rel:src/%.c
|
||||||
-$(CC) $(CFLAGS) -I $(INC) -c $^ -o $@
|
-$(CC) $(CFLAGS) -I $(INC) -c $^ -o $@
|
||||||
|
Loading…
x
Reference in New Issue
Block a user