detect os and lsb release
This commit is contained in:
30
Makefile
30
Makefile
@ -1,28 +1,22 @@
|
||||
# detect OS
|
||||
ifeq ($(OS),Windows_NT)
|
||||
RM = del /q
|
||||
RM := del /q
|
||||
COM := COM3
|
||||
else
|
||||
UNAME_S := $(shell uname -s)
|
||||
ifeq ($(UNAME_S),Linux)
|
||||
RM = rm -rf
|
||||
RM =: rm -rf
|
||||
|
||||
UNAME_S := $(shell cat /etc/*-release | grep 'DISTRIB_ID' | sed 's/DISTRIB_ID=\(\w*\)/\1/g')
|
||||
ifeq ($(UNAME_S),Ubuntu)
|
||||
CC := sdcc
|
||||
COM := /dev/ttyUSB0
|
||||
endif
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
RM = rm -rf
|
||||
ifeq ($(UNAME_S),Deepin)
|
||||
CC := ablrun sdcc
|
||||
COM := /dev/ttyUSB0
|
||||
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
|
||||
CC := sdcc
|
||||
PACKIHX := packihx
|
||||
CFLAGS := -DUSE_FLOATS=1
|
||||
|
||||
@ -54,7 +48,7 @@ uart_temp.hex: $(TARGET)
|
||||
-$(PACKIHX) $(TARGET) > uart_temp.hex
|
||||
|
||||
flash:
|
||||
-stcgal -P stc89 -p COM3 .\uart_temp.hex
|
||||
-stcgal -P stc89 -p $(COM) -d uart_temp.hex
|
||||
|
||||
#led.bin:led.hex
|
||||
# objcopy -I ihex -O binary led.hex led.bin
|
||||
|
Reference in New Issue
Block a user