⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 common.make

📁 umon bootloader source code, support mips cpu.
💻 MAKE
字号:
############################################################################
#
# common.make:
# This file contains all the common stuff used by MicroMonitor port-specific
# make files.

############################################################################
#
# Various relative directories used to build the monitor:
#
BASE		= $(TOPDIR)/target
CPUDIR		= $(BASE)/cpu/$(CPUTYPE)
ZLIBDIR		= $(BASE)/zlib
COMDIR		= $(BASE)/common
MAKEDIR		= $(BASE)/make
DEVDIR		= $(BASE)/dev
INCLUDEDIR	= $(BASE)/include
TOOLBIN		= $(TOPDIR)/host/bin

############################################################################
#
# Generic tools used by all make files:
# Names are derived from the TOOL_PREFIX variable
# assumed to be established in the make file that
# includes this.
#

ifeq ($(TOOL_PREFIX),)
TOOL_PREFIX		= $(CPUTYPE)-$(FILETYPE)
endif
SDE = sde
NM				= $(SDE)-nm
AR				= $(SDE)-ar
LD				= $(SDE)-ld
ASM				= $(SDE)-as
CC				= $(SDE)-gcc
STRIP			= $(SDE)-strip
OBJCOPY			= $(SDE)-objcopy
OBJDUMP			= $(SDE)-objdump

LIBGCC			= `$(CC) --print-libgcc-file-name`
LIBDIR			= $(LIBGCC:/libgcc.a=)
NOF_LIBGCC		= $(LIBDIR)/nof/libgcc.a

# FLASHSUBDIR:
# This is actually a portion of the PATH to the flash source files.
# If not specified in the port-specific makefile, then assign the
# default type of "devices".  This then makes the assumption that
# the files specified by the FLASHSRC variable in the port-specific
# makefile are under $(BASE)/flash/devices (the new style flash
# driver for uMon).  For the older drivers, use the appropriate
# directory found under "boards" in the umon_main tree.
# The prefix $(BASE)/flash is assumed.
#
ifeq ($(FLASHSUBDIR),)
FLASHSUBDIR	= devices
endif

ifeq ($(FLASHDIR),)
FLASHDIR	= $(BASE)/flash/$(FLASHSUBDIR)
endif

# PORTDIR:
# By default, PORTDIR is umon/umon_ports; however some ports are not part
# of the CVS distribution; hence, umon/umon_ports sometimes needs to be
# overridden...
ifeq ($(PORTDIR),)
PORTDIR	= umon/umon_ports
endif

############################################################################
#
# Miscellaneous variables used by all targets:
#
DEPEND			= depend
DEPENDFILE		= depends
BUILDDIR		= build_$(PLATFORM)

COMMON_INCLUDE	= -I. -I$(COMDIR) -I$(CPUDIR) -I$(FLASHDIR) -I$(DEVDIR) -I$(INCLUDEDIR)

COMMON_CFLAGS	= -g -c -Wall -DPLATFORM_$(PLATFORM)=1 \
				  -fno-builtin 

COMMON_AFLAGS	= -g -xassembler-with-cpp -c -D PLATFORM_$(PLATFORM)=1 \
				  -D ASSEMBLY_ONLY

CFLAGS			= $(COMMON_CFLAGS) $(CUSTOM_CFLAGS) $(COMMON_INCLUDE) \
				  $(CUSTOM_INCLUDE)
ASMFLAGS		= $(COMMON_AFLAGS) $(CUSTOM_AFLAGS) $(COMMON_INCLUDE) \
				  $(CUSTOM_INCLUDE)


MAKE_LDFILE		= $(TOOLBIN)/vsub $(PLATFORM)_$(@F:.$(FILETYPE)=.ldt) \
				  $(PLATFORM)_$(@F:.$(FILETYPE)=.ld)
MAKE_MONBUILT	= $(CC) $(COMMON_CFLAGS) $(CUSTOM_CFLAGS) \
					$(COMMON_INCLUDE) -omonbuilt.o $(COMDIR)/monbuilt.c
MAKE_GNUSYMS	= $(NM) --numeric-sort $@ > $(@:.$(FILETYPE)=.gsym)
DUMP_MAP		= $(OBJDUMP) -fh $@
MAKE_BINARY		= $(OBJCOPY) -O binary $@ $(@:.$(FILETYPE)=.bin)
LINK			= $(LD) -nostartfiles -o $@ \
				  -T $(PLATFORM)_$(@F:.$(FILETYPE)=.ld)
DISASSEMBLE		= $(OBJDUMP) --source --disassemble $@> \
				  $(@:.$(FILETYPE)=.dis)

MAKE_CTAGS		= ctags --file-tags=yes -n -L cscope.files
MAKE_MONSYMS	= $(TOOLBIN)/monsym -p0x -Pmm_ -Sx $(@:.$(FILETYPE)=.gsym) > \
				  $(@:.$(FILETYPE)=.usym)
DUMP_MAP_ALT	= $(TOOLBIN)/$(FILETYPE) -m $@
MAKE_BINARY_ALT	= $(TOOLBIN)/$(FILETYPE) -B $(@:.$(FILETYPE)=.bin) $@

############################################################################
#
# Common source lists used by all targets:
#
ZLIBSRC		= adler32.c gzio.c infblock.c infcodes.c inffast.c inflate.c \
			  inftrees.c infutil.c trees.c uncompr.c zcrc32.c zutil.c

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -