📄 omakefile
字号:
###############################################################################
#
# Makefile for building a monitor for the SH2-version of the PPA.
#
# This makefile supports several different versions of the monitor...
# 1. typical, stand-alone monitor
# 2. monitor that will load into RAM and execute.
# 3. monitor that assumes it is called from the boot-block startup code.
# (for more information on the boot-block startup refer to the
# monitor webpage titled "Boot Block Safety").
# 4. the boot-block startup code.
#
TARGET = sh2
FLASH = 29f040
TGTDIR = evalsh2
MONBASE = ../../..
TGTBASE = $(MONBASE)/targets/$(TGTDIR)
COMBASE = $(MONBASE)/common
COMCPU = $(COMBASE)/cpu
ZLIB = $(COMBASE)/zlib
COMMON = $(COMBASE)/monitor
FLASHDIR = $(COMBASE)/flash/$(FLASH)
OBJCOPY = objcopysh
OBJDUMP = objdumpsh
NM = nmsh
#CC = ccsh -M -D PLATFORM_$(TARGET)=1 \
# -I. -I$(COMMON) -I$(COMCPU) -I$(FLASHDIR)
CC = ccsh -Wall -fno-for-scope -nostdinc -fno-builtin -DCPU=SH2 -g \
-o $@ -c -I. -I$(COMMON) -I$(FLASHDIR) -I$(COMCPU)
ASM = assh -o $@
ASMCPP = cppsh -D ASSEMBLY_ONLY -I$(COMCPU)
LIBS = libz.a ../../../tools/vxsh2/lib/lib7040.a
LD = ldsh
AR = arsh
DHCPEXT = dhcp_00
AOUT = mon$(TARGET)
BBMOUT = bbmon$(TARGET)
BBOUT = bb$(TARGET)
RAMOUT = ram$(TARGET)
IMAGEBASE = 0x4000
BIPOFFSET = 0x0050
CRCSTART = 0x0060
BIP = 0x4050
OBJLIST = obj/reset2.o obj/start.o obj/chario.o obj/cpuio.o obj/cache.o \
obj/mprintf.o obj/docmd.o obj/at.o obj/cmdtbl.o obj/genlib.o\
obj/dis_sh.o obj/dld.o obj/env.o obj/edit.o obj/except.o obj/cast.o \
obj/flash.o obj/flashdev.o obj/flashpic.o obj/go.o obj/memcmds.o \
obj/mstat.o obj/reg_cache.o obj/step.o obj/tfs.o obj/tfslog.o \
obj/tfsloader.o obj/tfscli.o obj/tfsapi.o obj/tfsclean.o \
obj/symtbl.o obj/redirect.o obj/bbc.o obj/monprof.o \
obj/unpack.o obj/vectors.o obj/misccmds.o obj/sbrk.o obj/malloc.o \
obj/pio_sh2.o obj/xmodem.o obj/ethernet.o obj/etherdev.o \
obj/dhcpboot.o obj/tftp.o obj/tcpstuff.o obj/if.o obj/arp.o \
obj/moncom.o obj/icmp.o obj/lineedit.o obj/password.o obj/crypt.o \
obj/gdb.o obj/strace_sh2.o obj/$(DHCPEXT).o obj/main.o obj/misc.o
BBOBJS = obj/reset1.o obj/reset2.o obj/start.o obj/bootblk.o obj/cpuio.o \
obj/bbstubs.o
OBJS = obj/reset1.o $(OBJLIST)
include $(ZLIB)/zlib.objlist
###############################################################################
#
# standalone:
# This is the build used for a monitor that does NOT use the boot-block
# safety startup. This means, that this build controls the reset vector.
#
standalone: info $(OBJS) libz.a obj/monlib.o makefile
$(LD) -e _coldstart -o $(AOUT) $(AOUT).lnk $(OBJS) $(LIBS)
rm -f tags
ctags -L cscope.files -n
coff -m $(AOUT)
coff -B $(AOUT).bin $(AOUT)
###############################################################################
#
# bbmon:
# This is the build used for a monitor that USES the boot-block safety.
# Note that reset1.o is omitted because the boot-block code is assumed to
# handle the actual reset of the CPU.
#
bbmon: info $(OBJLIST) libz.a obj/monlib.o makefile
$(LD) -e _coldstart -o $(BBMOUT) $(BBMOUT).lnk $(OBJLIST) $(LIBS)
coff -m $(BBMOUT)
coff -B $(BBMOUT).bin $(BBMOUT)
ibsi -b $(IMAGEBASE) -i $(BIPOFFSET) -c $(CRCSTART) \
-o $(BBMOUT).bsi $(BBMOUT).bin
###############################################################################
#
# ram:
# This is the build used for a monitor that can be downloaded by the
# boot-block code that detects a corrupt monitor. This will execute in
# ram to allow a new monitor to be installed into flash.
#
ram: info $(OBJLIST) libz.a obj/monlib.o makefile
$(LD) -e _coldstart -o $(RAMOUT) $(RAMOUT).lnk $(OBJLIST) libz.a $(LIBS)
coff -m $(RAMOUT)
coff -B $(RAMOUT).bin $(RAMOUT)
###############################################################################
#
# bootblock:
# This target builds the small boot-block code that would be located in the
# reset-vector point of the system's FLASH. If this is used, then the
# monitor should be built with the bbmon target instead of standalone.
#
bootblock: $(BBOBJS) makefile
$(LD) -e _coldstart -o $(BBOUT) $(BBOUT).lnk $(BBOBJS) $(LIBS)
coff -m $(BBOUT)
coff -B $(BBOUT).bin $(BBOUT)
ls -l $(BBOUT).bin
libz.a: $(ZOBJS)
$(AR) rc libz.a $(ZOBJS)
info:
defdate -f %H:%M:%S BUILDTIME >info.h
defdate -f %m/%d/%y BUILDDATE >>info.h
###############################################################################
#
# Individual objects:
#
include $(COMMON)/common.make
include $(ZLIB)/zlib.make
obj/bbstubs.o: bbstubs.c
$(CC) bbstubs.c
obj/cpuio.o: cpuio.c cpu.h cpuio.h config.h $(COMMON)/stddefs.h
$(CC) cpuio.c
obj/dis_sh.o: $(COMCPU)/dis_sh.c cpu.h config.h
$(CC) $(COMCPU)/dis_sh.c
obj/etherdev.o: etherdev.c cpuio.h $(COMMON)/ether.h config.h
$(CC) etherdev.c
obj/except.o: except.c cpu.h config.h
$(CC) except.c
obj/flashdev.o: $(FLASHDIR)/flashdev.c $(COMMON)/flash.h \
$(FLASHDIR)/flashdev.h config.h
$(CC) $(FLASHDIR)/flashdev.c
obj/flashpic.o: $(FLASHDIR)/flashpic.c $(COMMON)/flash.h \
$(FLASHDIR)/flashdev.h config.h
$(CC) $(FLASHDIR)/flashpic.c
obj/main.o: main.c cpu.h $(COMMON)/monlib.h monapp.h config.h
$(CC) main.c
obj/pio_sh2.o: $(COMCPU)/pio_sh2.c cpu.h cpuio.h config.h
$(CC) $(COMCPU)/pio_sh2.c
obj/mstat.o: mstat.c cpu.h config.h
$(CC) mstat.c
obj/sh2start.o: sh2start.c cpu.h config.h
$(CC) sh2start.c
obj/step.o: step.c cpu.h config.h
$(CC) step.c
obj/strace_sh2.o: $(COMCPU)/strace_sh2.c config.h $(COMMON)/tfs.h \
$(COMMON)/genlib.h
$(CC) $(COMCPU)/strace_sh2.c
obj/reset1.o: reset1.s cpuio.h config.h
$(ASM) reset1.s
obj/reset2.o: reset2.s cpuio.h config.h
$(ASM) reset2.s
obj/vectors.o: vectors.s config.h
$(ASM) vectors.s
###############################################################################
#
# Miscellaneous utilities:
# (generic utilities are in $(COMMON)/common.make)
#
clobber1:
ixx:
rm -f $(RAMOUT) $(RAMOUT).s1 $(RAMOUT).str $(RAMOUT).bin
rm -f $(BBOUT) $(BBOUT).s1 $(BBOUT).str $(BBOUT).bin
rm -f $(BBMOUT) $(BBMOUT).s1 $(BBMOUT).str $(BBMOUT).bin
cscope1:
ls $(COMCPU)/*sh2* >cscope.files
f2mem:
f2mem -T1 -v -Ob -m $(AOUT).bin -a monrc,e -t0x30000 -B0x0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -