build: install: also declutter sourcecode

This commit is contained in:
René van Dorst
2025-09-27 12:52:35 +02:00
parent 432d9d77de
commit 2676dbd0d6
+22 -14
View File
@@ -6,29 +6,37 @@ CC_FLAGS = -mmcs51
ASM = sdas8051 ASM = sdas8051
AFLAGS= -plosgff AFLAGS= -plosgff
BUILDDIR = output/
SRCS = installer.c SRCS = installer.c
OBJS = ${SRCS:.c=.rel} OBJS = ${SRCS:%.c=$(BUILDDIR)%.rel}
all: updatebuilder rtlplayground.bin all: create_build_dir $(BUILDDIR)updatebuilder $(BUILDDIR)rtlplayground.bin
updatebuilder: updatebuilder.c create_build_dir:
mkdir -p $(BUILDDIR)
$(BUILDDIR)updatebuilder: updatebuilder.c
gcc $^ -o $@ gcc $^ -o $@
installer.rel: installer.c $(BUILDDIR)installer.rel: installer.c
$(CC) $(CC_FLAGS) --code-loc ${CODE_LOCATION} -c $< $(CC) $(CC_FLAGS) --code-loc ${CODE_LOCATION} -o $@ -c $<
%.rel: %.asm $(BUILDDIR)crtstart.rel: crtstart.asm
${ASM} ${AFLAGS} $^ $(ASM) $(AFLAGS) -o $@ $<
%.rel: %.c $(BUILDDIR)%.rel: $(BUILDDIR)%.asm
$(CC) $(CC_FLAGS) -c $< ${ASM} ${AFLAGS} -o $@ $^
rtlinstaller.ihx: crtstart.rel $(OBJS) $(BUILDDIR)%.rel: %.c
$(CC) $(CC_FLAGS) -o $@ -c $<
$(BUILDDIR)rtlinstaller.ihx: $(BUILDDIR)crtstart.rel $(OBJS)
$(CC) $(CC_FLAGS) -Wl-bHOME=${INSTALLER_ADDRESS} -Wl-r -o $@ $^ $(CC) $(CC_FLAGS) -Wl-bHOME=${INSTALLER_ADDRESS} -Wl-r -o $@ $^
rtlplayground.bin: rtlinstaller.ihx ../rtlplayground.bin $(BUILDDIR)rtlplayground.bin: $(BUILDDIR)rtlinstaller.ihx ../$(BUILDDIR)/rtlplayground.bin
cp ../rtlplayground.bin . cp ../$(BUILDDIR)/rtlplayground.bin $(BUILDDIR)
./updatebuilder -i $< rtlplayground.bin ./$(BUILDDIR)/updatebuilder -i $< $(BUILDDIR)rtlplayground.bin
clean: clean:
rm *.ihx *.lst *.rel *.rst *.sym *.lst *.map *.mem *.lk $(OBJS) installer.asm rm -r $(BUILDDIR)