mirror of
https://github.com/egzumer/uv-k5-firmware-custom
synced 2024-11-21 17:19:57 +00:00
Makefile improvements
This commit is contained in:
parent
8a60535f9d
commit
f074114d13
40
Makefile
40
Makefile
@ -352,10 +352,44 @@ LIBS =
|
|||||||
|
|
||||||
DEPS = $(OBJS:.o=.d)
|
DEPS = $(OBJS:.o=.d)
|
||||||
|
|
||||||
|
ifdef OS
|
||||||
|
RM = del /Q
|
||||||
|
FixPath = $(subst /,\,$1)
|
||||||
|
WHERE = where
|
||||||
|
else
|
||||||
|
ifeq ($(shell uname), Linux)
|
||||||
|
RM = rm -f
|
||||||
|
FixPath = $1
|
||||||
|
WHERE = which
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq (, $(shell $(WHERE) python))
|
||||||
|
MY_PYTHON := python
|
||||||
|
else ifneq (, $(shell $(WHERE) python3))
|
||||||
|
MY_PYTHON := python3
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef MY_PYTHON
|
||||||
|
HAS_CRCMOD := $(shell $(MY_PYTHON) -c "import crcmod" 2>&1)
|
||||||
|
endif
|
||||||
|
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
$(OBJCOPY) -O binary $< $<.bin
|
$(OBJCOPY) -O binary $< $<.bin
|
||||||
-python fw-pack.py $<.bin $(GIT_HASH) $<.packed.bin
|
|
||||||
-python3 fw-pack.py $<.bin $(GIT_HASH) $<.packed.bin
|
ifndef MY_PYTHON
|
||||||
|
$(info )
|
||||||
|
$(info !!!!!!!! PYTHON NOT FOUND, *.PACKED.BIN WON'T BE BUILT)
|
||||||
|
$(info )
|
||||||
|
else ifneq (,$(HAS_CRCMOD))
|
||||||
|
$(info )
|
||||||
|
$(info !!!!!!!! CRCMOD NOT INSTALLED, *.PACKED.BIN WON'T BE BUILT)
|
||||||
|
$(info !!!!!!!! run: pip install crcmod)
|
||||||
|
$(info )
|
||||||
|
else
|
||||||
|
-$(MY_PYTHON) fw-pack.py $<.bin $(GIT_HASH) $<.packed.bin
|
||||||
|
endif
|
||||||
|
|
||||||
$(SIZE) $<
|
$(SIZE) $<
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
@ -382,4 +416,4 @@ bsp/dp32g030/%.h: hardware/dp32g030/%.def
|
|||||||
-include $(DEPS)
|
-include $(DEPS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(TARGET).bin $(TARGET).packed.bin $(TARGET) $(OBJS) $(DEPS)
|
$(RM) $(call FixPath, $(TARGET).bin $(TARGET).packed.bin $(TARGET) $(OBJS) $(DEPS))
|
||||||
|
17
win_make.bat
17
win_make.bat
@ -18,15 +18,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
:: Delete any left over files from previous compile
|
|
||||||
::
|
|
||||||
del /S /Q *.o >nul 2>nul
|
|
||||||
del /S /Q *.d >nul 2>nul
|
|
||||||
del /Q firmware >nul 2>nul
|
|
||||||
del /Q *.bin >nul 2>nul
|
|
||||||
|
|
||||||
:: You may need to edit/change these three paths to suit your setup
|
:: You may need to edit/change these three paths to suit your setup
|
||||||
::
|
::
|
||||||
:: Temporarily add the compiler and make program directories to the system PATH ..
|
:: Temporarily add the compiler and make program directories to the system PATH ..
|
||||||
@ -40,14 +31,6 @@ del /Q *.bin >nul 2>nul
|
|||||||
make clean
|
make clean
|
||||||
make
|
make
|
||||||
|
|
||||||
:: Delete the spent files
|
|
||||||
::
|
|
||||||
del /S /Q *.o >nul 2>nul
|
|
||||||
del /S /Q *.d >nul 2>nul
|
|
||||||
del /Q firmware >nul 2>nul
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
:: If you have python installed, you can create a 'packed' .bin from the compiled firmware.bin file.
|
:: If you have python installed, you can create a 'packed' .bin from the compiled firmware.bin file.
|
||||||
:: The Quansheng windows upload-to-radio program requires a 'packed' .bin file.
|
:: The Quansheng windows upload-to-radio program requires a 'packed' .bin file.
|
||||||
|
Loading…
Reference in New Issue
Block a user