📄 makefile
字号:
#
# id: @(#)makefile 1.7 96/07/24
#
# Copyright(c) 1995, FMI, Fujitsu Microelectronics, Inc.
# All rights reserved.
#
# This software (including any documentation) is untested, has not been
# fully tested for viruses and has been provided to you without charge.
# ACCORDINGLY, IT IS DELIVERED "AS IS" WITH NO WARRANTIES EXPRESS OR
# IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. You bear all
# risk of nonperformance, loss of data and other problems and Fujitsu
# Microelectronics, Inc. and Fujitsu Limited will not be liable under any
# contract, negligence, strict liability or other theory for any damages
# including, without limitation, direct, consequential or incidental nor
# be required to provide substitute goods, services or technology.
#
#
SLITELIB = ../../../gnulib
# Specific SPARClite chip: eg. 930, 933h, 936
CHIP = 832
BOARD = 832ek
# Name of executable program
PROGRAM = mailbox
HOME = ..
INCDIR = $(HOME)/include
LIBDIR = $(HOME)/lib
# List of object modules
OBJS = $(PROGRAM).o
# Controls if GDB debugger stub is invoked (i.e. controls which crt0** is linked)
#DEBUG =
DEBUG = debug
# Address where programs is to be loaded
# We use beginning of DRAM
LOADADR = 4010000
# Optimization level (from -O0 to -O3)
# -O0 is recommended for easy use of GDB. When code is optimized
# sometimes the code execution path does not match the source
# which can cause confusion when using GDB.
# The higher optimization levels are recommended when benchmarking code
OPTIMIZATION = -O0
# Additional special compiler flags
PROGFLAGS = -DLANGUAGE_C
CHIPLIB = $(SLITELIB)/chips/$(CHIP)
BOARDLIB = $(SLITELIB)/boards/$(BOARD)
# Definition of host (Unix v. DOS) specifics
include $(SLITELIB)/host.mak
# This the startup module. When linked in first, the entry point
# is simply the first address of the executable.
CRT0 = $(BOARDLIB)/crt0$(DEBUG).o
# SPARClite system and debug code which is to be linked with
# application programs.
SLITEOBJ = $(BOARDLIB)/libslite.a
DEBUG_SPRT = $(BOARDLIB)/asi.o
OSLIB = $(LIBDIR)
BSPLIB = $(LIBDIR)/bsp
# Chip specific stuff
include $(CHIPLIB)/chip.mak
# Compiler etc. switches.
INCLUDES = -I . -I $(INCDIR)
CCFLAGS = -g -c $(OPTIMIZATION) $(INCLUDES) $(FPUCCFLAG)
CCFLAGS += $(PROGFLAGS)
CPPFLAGS = $(INCLUDES)
ASFLAGS =
C_LIB = $(C_LIB_BASE)/$(FPULDFLAG)
CYGNUS_LIB = $(CYGNUS_LIB_BASE)/$(FPULDFLAG)
LDFLAGS = -Ttext $(LOADADR) -T$(SLITELIB)/sparclit.ld \
-L$(BOARDLIB) -L$(CYGNUS_LIB) -L$(C_LIB) -L$(OSLIB)
# These are default make rules for making any C or assembly modules
# which do not have explicit rules. We include the application makefile
# in the dependecy list since it defines some compiler flags.
%.o: %.s makefile
$(CPP) $(CPPFLAGS) $*.s $*.i
$(AS) $(ASFLAGS) -o $*.o $*.i
%.o: %.c makefile
$(CC) $(CCFLAGS) $*.c -o $*.o
# default: $(PROGRAM).sr
default: clean $(PROGRAM)
# Executable program
$(PROGRAM): $(CRT0) $(OBJS) $(DEBUG_SPRT) $(SLITEOBJ)
$(LD) $(LDFLAGS) \
-o $@ $(CRT0) $(OBJS) $(DEBUG_SPRT) \
-lbsp -lucos -lm -lc -lslite -lc -lslite -lgcc -Map $(PROGRAM).map
# Delete all objects etc. to rebuild from scratch.
clean:
${DEL} $(PROGRAM)
${DEL} *.i
${DEL} *.o
${DEL} *.map
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -