Fixed bug in C preprocessor: buffer size reduced to avoid allocation failure. Added option -v for smlrc. New example stdarg.c: a demo of function with variable arguments.
30 lines
785 B
Plaintext
30 lines
785 B
Plaintext
TOPSRC = $(shell cd ../..; pwd)
|
|
include $(TOPSRC)/target.mk
|
|
|
|
CFLAGS += -Werror
|
|
ASFLAGS += -DCROSS
|
|
ASLDFLAGS = --oformat=elf32-tradlittlemips -N -nostartfiles -T $(TOPSRC)/src/elf32-mips.ld
|
|
|
|
all: chello cplus echo stdarg
|
|
|
|
chello: chello.o
|
|
${CC} ${LDFLAGS} -o chello.elf chello.o ${LIBS}
|
|
${OBJDUMP} -S chello.elf > chello.dis
|
|
${SIZE} chello.elf
|
|
${ELF2AOUT} chello.elf $@
|
|
|
|
cplus: cplus.o
|
|
${CXX} ${LDFLAGS} -nostdlib -o cplus.elf cplus.o ${LIBS}
|
|
${OBJDUMP} -S cplus.elf > cplus.dis
|
|
${SIZE} cplus.elf
|
|
${ELF2AOUT} cplus.elf $@
|
|
|
|
echo: echo.o
|
|
${LD} ${ASLDFLAGS} -o $@.elf $@.o
|
|
${OBJDUMP} -S $@.elf > $@.dis
|
|
${SIZE} $@.elf
|
|
${ELF2AOUT} $@.elf $@
|
|
|
|
clean:
|
|
rm -f *.o *.elf ${MAN} chello cplus echo stdarg *.elf *.dis tags *~
|