installer: build with the toolchain from the tree

The installer Makefile called whatever sdcc was on the PATH, so an
installer built by hand came out of the system compiler, without the
fixes in sdcc/. Use the same toolchain/sdcc-<cksum> as the main Makefile,
built on demand by sdcc/build.sh if a bare installer build gets there
first, and keep CC= on the command line as the way to pick another
compiler. The README example shows the new command lines.
This commit is contained in:
d00f committed 2026-10-25 22:44:51 +01:00
1 parent 5c6a82d50f
commit 7535c0d9b7
2 files changed
+16 -6

No files matched your search

+3 -3
View File
@@ -170,9 +170,9 @@ example of compilation console output
RTLPlayground/installer$ make RTLPlayground/installer$ make
mkdir -p output mkdir -p output
gcc updatebuilder.c -o output/updatebuilder gcc updatebuilder.c -o output/updatebuilder
sdas8051 -plosgff -o output/crtstart.rel crtstart.asm ../toolchain/sdcc-3390765201/bin/sdas8051 -plosgff -o output/crtstart.rel crtstart.asm
sdcc -mmcs51 --code-loc 0x1000 -o output/installer.rel -c installer.c ../toolchain/sdcc-3390765201/bin/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/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 ./output/updatebuilder -i output/rtlinstaller.ihx -o output/rtlplayground_oem_upgrade.bin ../output/rtlplayground.bin
Input file size: 524288 Input file size: 524288
Bytes read: 524288 Bytes read: 524288
+13 -3
View File
@@ -1,9 +1,14 @@
CODE_LOCATION=0x1000 CODE_LOCATION=0x1000
INSTALLER_ADDRESS=0x1100 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 CC_FLAGS = -mmcs51
ASM = sdas8051 ASM ?= sdas8051
AFLAGS= -plosgff AFLAGS= -plosgff
BUILDDIR = output BUILDDIR = output
@@ -13,9 +18,14 @@ OBJS = ${SRCS:%.c=$(BUILDDIR)/%.rel}
all: create_build_dir $(BUILDDIR)/updatebuilder $(BUILDDIR)/rtlplayground_oem_upgrade.bin all: create_build_dir $(BUILDDIR)/updatebuilder $(BUILDDIR)/rtlplayground_oem_upgrade.bin
create_build_dir: create_build_dir: $(SDCC)
mkdir -p $(BUILDDIR) mkdir -p $(BUILDDIR)
ifneq ($(SDCC),)
$(SDCC):
sh ../sdcc/build.sh $(abspath $(SDCC_PREFIX))
endif
$(BUILDDIR)/updatebuilder: updatebuilder.c $(BUILDDIR)/updatebuilder: updatebuilder.c
gcc $^ -o $@ gcc $^ -o $@