2012-02-05 14:01:28 -05:00
|
|
|
M2DIR=../..
|
|
|
|
include $(M2DIR)/software/include.mak
|
|
|
|
|
2012-02-17 12:47:04 -05:00
|
|
|
OBJECTS=crt0.o isr.o ddrinit.o main.o
|
2012-02-05 14:01:28 -05:00
|
|
|
|
|
|
|
all: bios.bin
|
|
|
|
|
|
|
|
# pull in dependency info for *existing* .o files
|
|
|
|
-include $(OBJECTS:.o=.d)
|
|
|
|
|
|
|
|
%.bin: %.elf
|
|
|
|
$(MAKE) -C $(M2DIR)/tools
|
|
|
|
$(OBJCOPY) -O binary $< $@
|
|
|
|
chmod -x $@
|
|
|
|
$(M2DIR)/tools/mkmmimg $@ write
|
|
|
|
|
|
|
|
bios.elf: linker.ld $(OBJECTS) libs
|
|
|
|
bios-rescue.elf: linker-rescue.ld $(OBJECTS) libs
|
|
|
|
|
|
|
|
%.elf:
|
2012-02-07 09:02:44 -05:00
|
|
|
$(LD) $(LDFLAGS) -T $< -N -o $@ $(OBJECTS) -L$(M2DIR)/software/libbase -L$(M2DIR)/software/libextra -lbase -lextra
|
2012-02-05 14:01:28 -05:00
|
|
|
chmod -x $@
|
|
|
|
|
|
|
|
libs:
|
|
|
|
make -C $(M2DIR)/software/libbase
|
2012-02-07 09:02:44 -05:00
|
|
|
make -C $(M2DIR)/software/libextra
|
2012-02-05 14:01:28 -05:00
|
|
|
|
2012-02-17 12:16:29 -05:00
|
|
|
flash: bios.bin
|
|
|
|
m1nor bios.bin
|
2012-02-05 14:01:28 -05:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(OBJECTS) $(OBJECTS:.o=.d) bios.elf bios.bin bios-rescue.elf bios-rescue.bin .*~ *~
|
2012-02-17 12:16:29 -05:00
|
|
|
|
|
|
|
.PHONY: clean libs flash
|