Files
retrobsd/share/example/Makefile-host
2014-04-09 14:27:18 +01:00

31 lines
773 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: hello cplus
hello: hello.o
${CC} ${LDFLAGS} -o hello.elf hello.o ${LIBS}
${OBJDUMP} -S hello.elf > hello.dis
${SIZE} hello.elf
${ELF2AOUT} hello.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 $@
./aout $@ > $@.dis
clean:
rm -f *.o *.elf ${MAN} hello cplus *.elf *.dis tags *~