📄 makefile
字号:
###############################################################################
# Makefile for library building,written by Yu-Cheng Chang
# Date: Tue 03-06-2001
#
# Desc: 1.To change this makefile to build another library ,
# those MACROs are need to be modified.
# LIB_F: the file name of library.
# OBJS: the object files of library.
# INCS: include files.
# (one of those files is modified,all objects are rebuild)
# SRC_DIR: Directoris of source code.
# (each directory is seperated with space)
# INC_DIR: Directoris of include files.
# (each directory is seperated with space)
# OBJ_DIR: Directory to place object code(one directory ONLY)
# LIB_DIR: Directory to place library file(one directory ONLY)
#
# 2.Modifing MACROs below is according to your requirement.
# PRE_SYM: The defined symbols for preprocessor.
###############################################################################
!if $(OS_TYPE) == NT
S=\\
REMOVE = del
COPY = copy
MOVE = move
!else
S=/
REMOVE = rm -f
COPY = cp
MOVE = mv
!endif
# Object files
OBJS = \
basic.o \
c_zlib.o \
defrag.o \
dskblk.o \
findx.o \
fio.o \
piece.o \
rddebug.o \
rename.o \
scan.o
# Include files
INCS = \
# Library name
LIB_F = ramdisk.a
# Define preprocess symbol for Compiler
PRE_SYM +=
# Directoris of source code
SRC_DIR = $(RTOSHOME)driver$(S)ramdisk4.2$(S)src$(S)
# Directory to place object code
OBJ_DIR = $(RTOSHOME)driver$(S)ramdisk4.2$(S)$(TARGET_DIR)$(S)obj$(S)
# Directory to place library file
LIB_DIR = $(RTOSHOME)$(TARGET_DIR)$(S)LIB$(S)
# Directoris of include files
INC_DIR = \
$(RTOSHOME)kernel/include/\
$(RTOSHOME)kernel/include/ansi_c\
$(RTOSHOME)driver/ramdisk4.2/include\
.
# Source code searching path (VPATH is the specify feature of emake)
VPATH = $(SRC_DIR,>;)$(INC_DIR,>;)
# Assign Compiler
CC = $(S_CC)
AS = $(S_AS)
AR = $(S_AR)
ASFLAGS = $(S_ASFLAGS)
CCFLAGS = $(S_CCFLAGS)
CCFLAGS1 = $(CCFLAGS,S/mips16/mips1) # For some targets can't build in mips16
ARFLAGS = $(S_ARFLAGS)
#####
# Construct include path options
!if !(null(INC_DIR)) #null() is the specify feature of emake.
INC_PATH = $(INC_DIR:<$(INC_OPT))
!endif
# Build defined symbol options for compiling
!if !(null(PRE_SYM)) #null() is the specify feature of emake.
SYMBOLS = $(PRE_SYM:<$(SYM_OPT)) #modifier < s the specify feature of emake.
!endif
#####
# Infernece rule
.SUFFIXES: .a .o .c
.c.o:
!if !(null(OUT_OPT))
$(CC) $(CCFLAGS) $(INC_PATH) $(SYMBOLS) $(OUT_OPT) $@ $<
!else
$(CC) $(CCFLAGS) $(INC_PATH) $(SYMBOLS) $<
!endif
SPC_CC = $(CC) $(CCFLAGS1) $(INC_PATH) $(SYMBOLS)
!if !(null(OUT_OPT))
SPC_CC += $(OUT_OPT) $@
!endif
SPC_CC += $<
#####
.PHONY all clean dump
# Target
all: $(OBJS:F,<$(OBJ_DIR)) $(LIB_DIR)$(LIB_F)
# Dependencies
# All object files
$(OBJS:F,<$(OBJ_DIR)) : $(INCS)
# The elements' pathes of OBJS are filter out.
# The library file
$(LIB_DIR)$(LIB_F) : $(OBJS:F,<$(OBJ_DIR))
@echo Building $@....
!if $(AR) == ar # GNU ar has problem in replace option
@$(REMOVE) $@
!endif
@$(AR) $(ARFLAGS) $@ $(OBJS:F,<$(OBJ_DIR))
# End.
# Command
clean:
!if -e $(LIB_DIR)$(LIB_F)
$(REMOVE) $(LIB_DIR)$(LIB_F)
!endif
$(REMOVE) $(OBJ_DIR)*.o
dump:
@echo $(CC)
@echo $(CCFLAGS)
@echo $(AS)
@echo $(ASFLAGS)
@echo $(AR)
@echo $(ARFLAGS)
@echo $(SYMBOLS)
@echo $(LIB_DIR)
@echo $(INC_PATH)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -