- #
- # Makefile
- #
- # DVD
- #
- PATH := $(PATH) .
- VPATH = MIPS
- .SUFFIXES:
- .PHONY: force oldold
- sinclude Makefile.utl
- ENDIAN := LITTLE
- #ENDIAN := BIG
- ifeq "$(ENDIAN)" "LITTLE"
- TARGET = mipsel-elf
- ENDIAN =
- LIBDIR = mipsel-elf
- GOAL = romL.obj
- LDSCRIPT = dvdL.ld
- CFLAGS_ENDIAN = -DLITTLE_ENDIAN
- else
- TARGET = mips-ecoff
- ENDIAN =
- LIBDIR = ECOFF
- GOAL = romB.obj
- LDSCRIPT = dvdB.ld
- CFLAGS_ENDIAN = -DBIG_ENDIAN
- endif
- CC = gcc
- AS = as
- LD = ld
- OBJDUMP = objdump
- #PREFIX = $(TARGET)-
- INIT0 = MIPS/init0.o
- ROMINIT0 = MIPS/rominit.o
- ROMFINIT0 = MIPS/romfinit.o
- CRT0 = MIPS/crt0.o
- XCC = $(PREFIX)gcc $(ENDIAN)
- XAS = $(PREFIX)as
- XLD = $(PREFIX)ld
- XAR = $(PREFIX)ar
- XOBJDUMP = $(PREFIX)objdump $(ENDIAN)
- INCLUDE_DIR = -I. -Iemu/ -Inav/ -Iauth/
- #BITSTREAM = AMGframe
- BITSTREAM = sonyct3
- CFLAGS_MACHINE = -mlx4080 -msoft-float -membedded-data
- CFLAGS_C =
- -g
- -Os
- -fno-writable-strings
- -fstrength-reduce
- -fthread-jumps
- -W -Wall
- $(INCLUDE_DIR)
- # -fforce-mem
- # -fforce-addr
- CFLAGS_S =
- -g1
- -O2
- $(INCLUDE_DIR)
- #
- # generic flags
- #
- #
- # __EMU__ / __BORLANDC__
- # used to define atapi interface
- #
- # VIDEO_ONLY
- # disable audio functionality
- #
- # SIMULATION/EMULATION/FINALSYS
- # setup environment according to debugging configuration
- #
- # SIMULATION_FAST
- # accelerate some parameter during SIMULATION (or testing)
- #
- CFLAGS_SUPPORT =
- CFLAGS_WORK = -D__EMU__ -DFINALSYS
- #CFLAGS_WORK = -D__EMU__ -DVIDEO_ONLY -DEMULATION
- CFLAGS_COMPILE =
- -DBIT=$(BITSTREAM)
- $(CFLAGS_SUPPORT) $(CFLAGS_WORK) $(CFLAGS_ENDIAN)
- CFLAGS_MIPS = $(CFLAGS_MACHINE) $(CFLAGS_C) $(CFLAGS_COMPILE)
- CFLAGS_MIPS_S = $(CFLAGS_MACHINE) $(CFLAGS_S) $(CFLAGS_COMPILE)
- LIBRARIES = libdrv.a libdsp3.a libmon.a
- LDFLAGS_LIB = -ldrv -ldsp3 -lmon -lbits -lnav -latapi -lauth -lkern -lm -lstd -lchinese
- LDFLAGS = -nostartfiles -T $(LDSCRIPT) -L. -L$(LIBDIR) $(LDFLAGS_LIB) --cref
- # -Wl,--sort-common
- #cyue: HDD ADDED
- SOURCES_HDD =
- hdd_play.c
- SOURCES_TV =
- line21.c
- SOURCES_NES = NESInit.c
- SOURCES_KERN =
- kinf.c
- kernel.c
- avd.c
- SOURCES_SRC =
- navif.c
- lbaif.c
- task.c
- membuf.c
- membufv.c
- memcfg.c
- genint.c
- sio.c
- cd.c
- cdfunc.c
- cderr.c
- psd.c
- svcd.c
- repeat.c
- fs9660.c
- udf.c
- UartComm.c
- UartTxd.c
- graph.c
- hw.c
- mp3cdda.c
- dvdpe.c
- check_ir_power.c
- srv2.c
- $(SOURCES_TV)
- # $(SOURCES_KERN)
- # $(SOURCES_NES)
- # $(SOURCES_HDD)
- SOURCES_S =
- DEPENDS_C =
- $(addprefix MIPS/,$(SOURCES:.c=.d))
- DEPENDS_S =
- $(addprefix MIPS/,$(SOURCES_S:.S=.d))
- DEPENDS = $(DEPENDS_C) $(DEPENDS_S)
- OBJS = $(DEPENDS:.d=.o)
- ASMS = $(DEPENDS:.d=.s))
- DISASMS = $(DEPENDS:.d=.dis))
- .PHONY: all clean depends bak debug tar
- #
- # main target
- #
- all: $(GOAL)
- @$(ECHO) "all made"
- copy romL.bin rom.bin
- checksum
- depends: $(DEPENDS)
- @$(ECHO) "dependency made"
- DEP_SRC = $(addprefix MIPS/,$(SOURCES_SRC:.c=.d))
- OBJ_SRC = $(DEP_SRC:.d=.o)
- libsrc.a : $(OBJ_SRC)
- $(XAR) -cr $@ $(OBJ_SRC)
- %.dis : %.obj
- @$(ECHO) "disassembling.."
- @$(XOBJDUMP) --disassemble -j .rom1 --source $< > $@
- MIPS:
- mkdir MIPS
- MIPS/%.d : %.c
- @$(ECHO) "mkdep $<"
- @$(XCC) $(CFLAGS_MIPS) -M $< > depend.tmp
- @$(MAKEDEP) depend.tmp $@
- MIPS/%.o : MIPS/%.d
- MIPS/%.o : %.c
- @$(ECHO) "compile $<"
- @$(XCC) $(CFLAGS_MIPS) -c -o $@ $<
- MIPS/%.o : %.S
- @$(ECHO) "compile $<"
- @$(XCC) $(CFLAGS_MIPS_S) -c -o $@ $<
- MIPS/%.s : %.c
- @$(ECHO) "compile $<"
- @$(XCC) $(CFLAGS_MIPS) -S -fverbose-asm -o $@ $<
- MIPS/%.dis : %.o
- @$(XOBJDUMP) --source -d --syms $< > $@
- #
- # special commands.
- #
- MIPS/init0.o : user_init.h
- #ioprom.inc: ioprom.bin
- # binobj IOPcode ioprom.bin > ioprom.inc
- DSP3BIN =
- dsp3dts.bin
- dsp3mp3.bin
- dsp3mp3p.bin
- dsp3mp3d.bin
- dsp3cd.bin
- dsp3lpcm.bin
- dsp3ac3.bin
- dsp3jpg.bin
- dsp3nes.bin
- dsp3spdif.bin
- dsp3dtscd.bin
- DSP3INC = $(DSP3BIN:.bin=.inc)
- DSP3_C = $(DSP3BIN:.bin=.c)
- $(DSP3_C) : %.c : %.inc
- $(DSP3INC) : %.inc : %.bin
- @fgzip -9 -f $<
- @rzip $<.gz MIPS/$*.rz
- @binobj DSPcode MIPS/$*.rz $@
- MIPS/dsp3ac3.bin: dsp3rom.d16.ac3
- makeim -b $< $@
- MIPS/dsp3dts.bin: dsp3rom.d16.dts
- makeim -b $< $@
- MIPS/dsp3mp3.bin: dsp3rom.d16.mp3
- makeim -b $< $@
- MIPS/dsp3cd.bin: dsp3rom.d16.cd
- makeim -b $< $@
- MIPS/dsp3lpcm.bin: dsp3rom.d16.lpcm
- makeim -b $< $@
- MIPS/dsp3jpg.bin: dsp3rom.d16.jp
- makeim -b $< $@
- MIPS/dsp3nes.bin: dsp3rom.d16.nes
- makeim -b $< $@
- MIPS/dsp3spdif.bin: dsp3rom.d16.spdif
- makeim -b $< $@
- MIPS/dsp3dtscd.bin: dsp3rom.d16.dtscd
- makeim -b $< $@
- MIPS/font_offset.d : osdfont.inc
- MIPS/font_offset.o : font_offset.c font.c osdfont.inc
- @$(ECHO) "compile $<"
- @$(XCC) $(CFLAGS_MIPS) -O0 -g0 -c -o $@ $<
- MIPS/osdfont_decompress.d : osdfont.inc
- MIPS/osdfont_decompress.o : osdfont_decompress.c font.c font_offset.c osdfont.inc
- @$(ECHO) "compile $<"
- @$(XCC) $(CFLAGS_MIPS) -O0 -g0 -c -o $@ $<
- osdfont.inc: osdfont.bin
- @fgzip -9 -f $<
- @rzip $<.gz MIPS/$*.rz
- @binobj OSDfontbin MIPS/$*.rz osdfont.inc
- osdfont.bin: user_init.h font_ori.c font_traditional.c font_konka.c
- font_parse
- dsp3pm.c: dsp3pm.d16
- makepm $< $@
- MIPS/dsp3ac3.d : dsp3ac3.inc
- MIPS/dsp3dts.d : dsp3dts.inc
- MIPS/dsp3mp3.d : dsp3mp3.inc
- MIPS/dsp3cd.d : dsp3cd.inc
- MIPS/dsp3lpcm.d : dsp3lpcm.inc
- MIPS/dsp3jpg.d : dsp3jpg.inc
- MIPS/dsp3nes.d : dsp3nes.inc
- MIPS/dsp3spdif.d : dsp3spdif.inc
- MIPS/dsp3ac3.o : dsp3ac3.c dsp3ac3.inc
- @$(ECHO) "compile $<"
- @$(XCC) $(CFLAGS_MIPS) -O0 -g0 -c -o $@ $<
- MIPS/dsp3dts.o : dsp3dts.c dsp3dts.inc
- @$(ECHO) "compile $<"
- @$(XCC) $(CFLAGS_MIPS) -O0 -g0 -c -o $@ $<
- MIPS/dsp3mp3.o : dsp3mp3.c dsp3mp3.inc
- @$(ECHO) "compile $<"
- @$(XCC) $(CFLAGS_MIPS) -O0 -g0 -c -o $@ $<
- MIPS/dsp3cd.o : dsp3cd.c dsp3cd.inc
- @$(ECHO) "compile $<"
- @$(XCC) $(CFLAGS_MIPS) -O0 -g0 -c -o $@ $<
- MIPS/dsp3lpcm.o : dsp3lpcm.c dsp3lpcm.inc
- @$(ECHO) "compile $<"
- @$(XCC) $(CFLAGS_MIPS) -O0 -g0 -c -o $@ $<
- MIPS/dsp3jpg.o : dsp3jpg.c dsp3jpg.inc
- @$(ECHO) "compile $<"
- @$(XCC) $(CFLAGS_MIPS) -O0 -g0 -c -o $@ $<
- MIPS/dsp3nes.o : dsp3nes.c dsp3nes.inc
- @$(ECHO) "compile $<"
- @$(XCC) $(CFLAGS_MIPS) -O0 -g0 -c -o $@ $<
- MIPS/dsp3spdif.o : dsp3spdif.c dsp3spdif.inc
- @$(ECHO) "compile $<"
- @$(XCC) $(CFLAGS_MIPS) -O0 -g0 -c -o $@ $<
- MIPS/dsp3dtscd.o : dsp3dtscd.c dsp3dtscd.inc
- @$(ECHO) "compile $<"
- @$(XCC) $(CFLAGS_MIPS) -O0 -g0 -c -o $@ $<
- ifneq ($(MAKECMDGOALS),clean)
- ifneq ($(MAKECMDGOALS),tar)
- ifneq ($(MAKECMDGOALS),bak)
- sinclude $(DEPENDS)
- endif
- endif
- endif