diff --git a/README.md b/README.md index 25c0a02d..6abf52c0 100644 --- a/README.md +++ b/README.md @@ -170,9 +170,9 @@ example of compilation console output RTLPlayground/installer$ make mkdir -p output gcc updatebuilder.c -o output/updatebuilder -sdas8051 -plosgff -o output/crtstart.rel crtstart.asm -sdcc -mmcs51 --code-loc 0x1000 -o output/installer.rel -c installer.c -sdcc -mmcs51 -Wl-bHOME=0x1100 -Wl-r -o output/rtlinstaller.ihx output/crtstart.rel output/installer.rel +../toolchain/sdcc-3390765201/bin/sdas8051 -plosgff -o output/crtstart.rel crtstart.asm +../toolchain/sdcc-3390765201/bin/sdcc -mmcs51 --code-loc 0x1000 -o output/installer.rel -c installer.c +../toolchain/sdcc-3390765201/bin/sdcc -mmcs51 -Wl-bHOME=0x1100 -Wl-r -o output/rtlinstaller.ihx output/crtstart.rel output/installer.rel ./output/updatebuilder -i output/rtlinstaller.ihx -o output/rtlplayground_oem_upgrade.bin ../output/rtlplayground.bin Input file size: 524288 Bytes read: 524288 diff --git a/installer/Makefile b/installer/Makefile index c451f499..1aeef985 100644 --- a/installer/Makefile +++ b/installer/Makefile @@ -1,9 +1,14 @@ CODE_LOCATION=0x1000 INSTALLER_ADDRESS=0x1100 -CC = sdcc +SDCC_PREFIX = ../toolchain/sdcc-$(shell cat ../sdcc/* | cksum | cut -d' ' -f1) +ifeq ($(origin CC),default) +SDCC = $(SDCC_PREFIX)/bin/sdcc +CC = $(SDCC) +ASM = $(SDCC_PREFIX)/bin/sdas8051 +endif CC_FLAGS = -mmcs51 -ASM = sdas8051 +ASM ?= sdas8051 AFLAGS= -plosgff BUILDDIR = output @@ -13,9 +18,14 @@ OBJS = ${SRCS:%.c=$(BUILDDIR)/%.rel} all: create_build_dir $(BUILDDIR)/updatebuilder $(BUILDDIR)/rtlplayground_oem_upgrade.bin -create_build_dir: +create_build_dir: $(SDCC) mkdir -p $(BUILDDIR) +ifneq ($(SDCC),) +$(SDCC): + sh ../sdcc/build.sh $(abspath $(SDCC_PREFIX)) +endif + $(BUILDDIR)/updatebuilder: updatebuilder.c gcc $^ -o $@