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

📄 makefile

📁 嵌入式系统中文件系统源代码
💻
字号:
f###############################################################################
# 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_FILESYS = \
crc32.o\
filesys.o\
fsutils.o\
bak2nand.o\
fs_ext.o\
curpath.o

OBJS_RAMDISK = \
basic.o \
c_zlib.o \
defrag.o \
dskblk.o \
findx.o \
fio.o \
piece.o \
rddebug.o \
rename.o \
scan.o

OBJS_FFS_NAND = \
FFS_NAND.o\
NANDfblk.o\
NANDfdbg.o\
NANDfdrv.o\
NANDfile.o\
NANDlump.o\
NANDfind.o\
#nflash1.o
   
OBJS_FAT = \
ata.o\
b52uni.o\
cluster.o\
fat1x.o\
fdefrag.o\
ffindx.o\
frename.o\
fscan.o\
gb2uni.o\
init.o\
translat.o\
truncate.o\
unicode.o\
CFFmt.o

OBJS = $(OBJS_FILESYS) $(OBJS_RAMDISK) $(OBJS_FFS_NAND) $(OBJS_FAT)

# Include files
INCS = \
  uigui_cfg.h

# Library name
LIB_F = filesys.a

LOCAL_DIR = $(RTOSHOME)kernel$(S)usrlib$(S)File_Sys$(S)

# Directoris of source code
SRC_DIR = \
	$(LOCAL_DIR)fat1x/src/\
	$(LOCAL_DIR)ffs_nand/src/\
	$(LOCAL_DIR)RAMDisk4.2/src/\
	$(LOCAL_DIR)filesys/src/\

# Directory to place object code
OBJ_DIR = $(LOCAL_DIR)$(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/usrlib/file_sys/\
 $(RTOSHOME)kernel/include/\
 $(RTOSHOME)kernel/include/ansi_c\
 $(RTOSHOME)kernel/include/sys\sysvar\
 $(RTOSHOME)kernel/usrlib/pda_win/include\
 $(RTOSHOME)driver\
 $(RTOSHOME)driver/include\
 $(RTOSHOME)kernel/usrlib\
 $(RTOSHOME)kernel/usrlib/database/include\
 $(RTOSHOME)kernel/usrlib/file_sys/ffs_nand/include/\
 $(RTOSHOME)kernel/usrlib/file_sys/RAMDisk4.2/include/\
 $(RTOSHOME)kernel/usrlib/file_sys/filesys/include/

# $(RTOSHOME)kernel/usrlib/file_sys/fat1x/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)

#!if '$(LONG_CALL)' == 'on'
# CCFLAGS += -mlong-calls
#!endif


CCFLAGS1 = $(CCFLAGS,S/mips16/mips1) 	# For some targets can't build in mips16
!if '$(LONG_CALL)' == 'on'
 CCFLAGS1 += -mlong-calls
!endif
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
$(OBJS) : makefile
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 -e $(LIB_DIR)$(LIB_F)
 @$(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 $(CCFLAGS1)
	@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 + -