2013-11-09 09:27:32 -05:00
|
|
|
MSCDIR=../..
|
|
|
|
include $(MSCDIR)/software/common.mak
|
2014-04-18 07:56:18 -04:00
|
|
|
PYTHON = python3
|
2013-03-21 05:42:31 -04:00
|
|
|
|
2013-11-30 17:07:19 -05:00
|
|
|
OBJECTS=isr.o processor.o dvisampler0.o dvisampler1.o edid.o pll.o ci.o config.o main.o
|
2013-03-21 05:42:31 -04:00
|
|
|
|
2013-06-01 11:20:40 -04:00
|
|
|
all: videomixer.bin videomixer.fbi
|
2013-03-21 05:42:31 -04:00
|
|
|
|
|
|
|
# pull in dependency info for *existing* .o files
|
|
|
|
-include $(OBJECTS:.o=.d)
|
|
|
|
|
|
|
|
%.bin: %.elf
|
|
|
|
$(OBJCOPY) -O binary $< $@
|
|
|
|
chmod -x $@
|
|
|
|
|
2013-06-01 11:20:40 -04:00
|
|
|
%.fbi: %.bin
|
2014-04-18 07:56:18 -04:00
|
|
|
$(PYTHON) $(MSCDIR)/mkmscimg.py -i $< -o $@
|
2013-06-01 11:20:40 -04:00
|
|
|
|
2013-07-11 12:49:42 -04:00
|
|
|
videomixer.elf: $(OBJECTS) libs
|
2013-03-21 05:42:31 -04:00
|
|
|
|
|
|
|
%.elf:
|
2013-07-11 12:49:42 -04:00
|
|
|
$(LD) $(LDFLAGS) \
|
2013-11-09 09:27:32 -05:00
|
|
|
-T $(MSCDIR)/software/libbase/linker-sdram.ld \
|
2013-07-11 12:49:42 -04:00
|
|
|
-N -o $@ \
|
2013-11-09 09:27:32 -05:00
|
|
|
$(MSCDIR)/software/libbase/crt0.o \
|
2013-07-11 12:36:26 -04:00
|
|
|
$(OBJECTS) \
|
2013-11-09 09:27:32 -05:00
|
|
|
-L$(MSCDIR)/software/libbase \
|
|
|
|
-L$(MSCDIR)/software/libcompiler-rt \
|
2013-03-21 05:42:31 -04:00
|
|
|
-lbase -lcompiler-rt
|
|
|
|
chmod -x $@
|
|
|
|
|
|
|
|
main.o: main.c
|
|
|
|
$(compile-dep)
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(compile-dep)
|
|
|
|
|
|
|
|
%.o: %.S
|
|
|
|
$(assemble)
|
|
|
|
|
2013-05-09 07:41:21 -04:00
|
|
|
define gen0
|
|
|
|
@echo " GEN " $@
|
2013-11-20 18:33:22 -05:00
|
|
|
@sed -e "s/dvisamplerX/dvisampler0/g;s/DVISAMPLERX/DVISAMPLER0/g;s/fb_fi_baseX/fb_fi_base0/g" $< > $@
|
2013-05-09 07:41:21 -04:00
|
|
|
endef
|
|
|
|
|
|
|
|
define gen1
|
|
|
|
@echo " GEN " $@
|
2013-11-20 18:33:22 -05:00
|
|
|
@sed -e "s/dvisamplerX/dvisampler1/g;s/DVISAMPLERX/DVISAMPLER1/g;s/fb_fi_baseX/fb_fi_base1/g" $< > $@
|
2013-05-09 07:41:21 -04:00
|
|
|
endef
|
|
|
|
|
|
|
|
dvisampler0.c: dvisamplerX.c
|
|
|
|
$(gen0)
|
|
|
|
dvisampler0.h: dvisamplerX.h
|
|
|
|
$(gen0)
|
|
|
|
dvisampler1.c: dvisamplerX.c
|
|
|
|
$(gen1)
|
|
|
|
dvisampler1.h: dvisamplerX.h
|
|
|
|
$(gen1)
|
|
|
|
|
|
|
|
isr.o: dvisampler0.h dvisampler1.h
|
|
|
|
main.o: dvisampler0.h dvisampler1.h
|
|
|
|
dvisampler0.o: dvisampler0.h
|
|
|
|
dvisampler1.o: dvisampler1.h
|
|
|
|
|
2013-03-21 05:42:31 -04:00
|
|
|
libs:
|
2013-11-09 09:27:32 -05:00
|
|
|
$(MAKE) -C $(MSCDIR)/software/libcompiler-rt
|
|
|
|
$(MAKE) -C $(MSCDIR)/software/libbase
|
2013-03-21 05:42:31 -04:00
|
|
|
|
|
|
|
load: videomixer.bin
|
2013-11-09 09:27:32 -05:00
|
|
|
$(MAKE) -C $(MSCDIR)/tools
|
|
|
|
$(MSCDIR)/tools/flterm --port /dev/ttyUSB0 --kernel videomixer.bin
|
2013-03-21 05:42:31 -04:00
|
|
|
|
2013-06-01 11:20:40 -04:00
|
|
|
flash: videomixer.fbi
|
2014-02-28 12:40:49 -05:00
|
|
|
$(MSCDIR)/flash_extra.py mixxeo videomixer.fbi 0x001a0000
|
2013-06-01 11:20:40 -04:00
|
|
|
|
2013-03-21 05:42:31 -04:00
|
|
|
clean:
|
2013-06-01 11:20:40 -04:00
|
|
|
$(RM) $(OBJECTS) $(OBJECTS:.o=.d) videomixer.elf videomixer.bin videomixer.fbi
|
|
|
|
$(RM) .*~ *~
|
2013-05-10 16:30:28 -04:00
|
|
|
$(RM) dvisampler0.h dvisampler0.c dvisampler1.h dvisampler1.c
|
2013-03-21 05:42:31 -04:00
|
|
|
|
2013-05-10 16:30:28 -04:00
|
|
|
.PHONY: all main.o clean libs load
|