2013-12-13 21:37:05 +00:00
|
|
|
|
|
|
|
TARGET = test_bl_c
|
|
|
|
|
|
|
|
TOOLCHAIN = mipsel-elf-
|
|
|
|
|
|
|
|
CC = $(TOOLCHAIN)gcc
|
|
|
|
CPP = $(TOOLCHAIN)cpp
|
|
|
|
LD = $(TOOLCHAIN)gcc
|
|
|
|
AS = $(TOOLCHAIN)as
|
|
|
|
OBJCOPY = $(TOOLCHAIN)objcopy
|
|
|
|
OBJDUMP = $(TOOLCHAIN)objdump
|
|
|
|
|
2014-09-23 11:30:17 +00:00
|
|
|
CFLAGS = -Wundef -march=mips32r2 -nostdlib -Os -c
|
2013-12-13 21:37:05 +00:00
|
|
|
|
|
|
|
OBJS = crt0.o test_bl.o
|
|
|
|
LDSCRIPT= test_bl.lds
|
|
|
|
|
2014-09-23 11:30:17 +00:00
|
|
|
LDFLAGS = -Wundef -march=mips32r2 -T$(LDSCRIPT) -nostartfiles \
|
2013-12-13 21:37:05 +00:00
|
|
|
-nostdlib -Xlinker -Map=$(TARGET).map
|
|
|
|
|
|
|
|
all : $(TARGET).bin
|
|
|
|
ls -ls $(TARGET).bin
|
|
|
|
|
|
|
|
%.o : %.c
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(INCDIRS) $< -o $@
|
|
|
|
|
|
|
|
%.o : %.S
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(TARGET).elf : $(OBJS)
|
|
|
|
$(LD) $(LDFLAGS) $(OBJS) $(LIBDIRS) $(LIBS) -o $(TARGET).elf
|
|
|
|
|
|
|
|
$(TARGET).bin : $(TARGET).elf
|
|
|
|
$(OBJCOPY) -O binary $(TARGET).elf $(TARGET).bin
|
|
|
|
|
|
|
|
clean :
|
|
|
|
rm -f $(OBJS)
|
|
|
|
rm -f $(TARGET).elf
|
|
|
|
rm -f $(TARGET).bin
|
|
|
|
rm -f $(TARGET).map
|