view gcc/makefile-body @ 27:cb3f6fe694e1 default tip

README: document SE K2x0 addition
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 21 Dec 2023 21:44:43 +0000
parents 727914266f28
children
line wrap: on
line source

CC=	arm-elf-gcc
LD=	arm-elf-ld
OBJCOPY=arm-elf-objcopy

CFLAGS=	-mthumb-interwork

LIBC_A=		`${CC} -print-file-name=libc.a -mthumb-interwork`
LIBGCC_A=	`${CC} -print-file-name=libgcc.a -mthumb-interwork`
LIBM_T=		`${CC} -print-file-name=libm.a -mthumb-interwork -mthumb`

all:	ramimage.srec

${SUBDIR}: FRC
	cd $@; ${MAKE} ${MFLAGS}

${LIBS}:	${SUBDIR}
	@true

bootentry.o:	../src/cs/system/main/gcc/bootentry.S
	${CC} -c -o $@ ${CFLAGS} -DXRAM -Iconfig -I../src/nucleus/gcc $<

ramvecs.o:	../src/cs/system/main/gcc/ramvecs.S
	${CC} -c ${CFLAGS} $<

ramimage.ld:	../gcc/xram.m4 ../gcc/memlimits.m4 ../gcc/ld-script.src
	m4 $^ > $@

ramimage.elf:	${LIBS} bootentry.o ramvecs.o ramimage.ld
	${LD} -N -T ramimage.ld -o $@ -Map ramimage.map bootentry.o ramvecs.o \
		--start-group ${LIBS} --end-group \
		${LIBM_T} ${LIBC_A} ${LIBGCC_A}

ramimage.srec:	ramimage.elf
	${OBJCOPY} -O srec --srec-forceS3 --srec-len=30 $< $@

clean:	FRC
	rm -f fwimage.* ramimage.* bootentry*.o ramvecs.o
	rm -f build_date.* flash-script
	for i in ${SUBDIR}; do (cd $$i; ${MAKE} ${MFLAGS} clean); done

FRC: