Browse Source

Updated Makefile and Added MIPS support.

master
Jiaojinxing 9 years ago
parent
commit
262d1dd9ec
  1. 38
      .cproject
  2. 4
      .template/Makefile.arch
  3. 41
      .template/config.mk
  4. 266
      Makefile
  5. 257
      Makefile.arm
  6. 257
      Makefile.mips
  7. 0
      Makefile.ppc
  8. 0
      Makefile.x86
  9. 17
      config.mk

38
.cproject

@ -1,13 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.sylixos.realcoder.toolChain.armsylixeabi.1389582018">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.sylixos.realcoder.toolChain.armsylixeabi.1389582018" moduleId="org.eclipse.cdt.core.settings" name="Default">
<cconfiguration id="com.sylixos.realcoder.toolChain.armsylixeabi.2062094530">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.sylixos.realcoder.toolChain.armsylixeabi.2062094530" moduleId="org.eclipse.cdt.core.settings" name="Default">
<macros>
<stringMacro name="SYLIXOS_TOOLCHAIN_PATH" type="VALUE_PATH_DIR" value="C:\ACOINFO\arm-sylixos-toolchain"/>
<stringMacro name="SYLIXOS_TEMPLATE_ARCH" type="VALUE_TEXT"/>
<stringMacro name="SYLIXOS_TOOLCHAIN_VER" type="VALUE_TEXT" value="4.9.3"/>
<stringMacro name="SYLIXOS_TOOLCHAIN_PATH" type="VALUE_PATH_DIR" value="F:\ZTHSOFT\arm-sylixos-toolchain"/>
<stringMacro name="SYLIXOS_TOOLCHAIN_PREFIX" type="VALUE_TEXT" value="arm-sylixos-eabi"/>
<stringMacro name="SYLIXOS_BASE_PATH" type="VALUE_PATH_DIR" value="E:/SylixOS/gcc/base"/>
<stringMacro name="SYLIXOS_BASE_PATH" type="VALUE_PATH_DIR" value="D:/workspace/sylixos-base"/>
<stringMacro name="SYLIXOS_TEMPLATE_NAME" type="VALUE_TEXT"/>
</macros>
<externalSettings/>
<extensions>
@ -22,25 +24,25 @@
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.sylixos.realcoder.toolChain.armsylixeabi.1389582018" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="com.sylixos.realcoder.toolChain.armsylixeabi.1389582018.204928594" name="/" resourcePath="">
<toolChain id="com.sylixos.realcoder.toolChain.armsylixeabi.187191158" name="arm-sylixos-toolchain" superClass="com.sylixos.realcoder.toolChain.armsylixeabi">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.GNU_ELF" id="com.sylixos.realcoder.targetPlatform.armsylixoseabi.856030076" isAbstract="false" name="SylixOS TagetPlagform" osList="win32" superClass="com.sylixos.realcoder.targetPlatform.armsylixoseabi"/>
<builder id="com.sylixos.realcoder.builder.armsylixeabi.1512866951" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="SylixOS Builder" superClass="com.sylixos.realcoder.builder.armsylixeabi"/>
<tool id="com.sylixos.realcoder.tool.armsylixeabi.1349398507" name="arm-sylixos-eabi-gcc" superClass="com.sylixos.realcoder.tool.armsylixeabi">
<option id="com.sylixos.realcoder.option.armsylixoseabi.include.760812058" name="Include paths (-I)" superClass="com.sylixos.realcoder.option.armsylixoseabi.include" valueType="includePath">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.sylixos.realcoder.toolChain.armsylixeabi.2062094530" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="com.sylixos.realcoder.toolChain.armsylixeabi.2062094530.544608057" name="/" resourcePath="">
<toolChain id="com.sylixos.realcoder.toolChain.armsylixeabi.659592482" name="SylixOS Toolchain" superClass="com.sylixos.realcoder.toolChain.armsylixeabi">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.GNU_ELF" id="com.sylixos.realcoder.targetPlatform.armsylixoseabi.1188541653" isAbstract="false" name="SylixOS TagetPlagform" osList="win32" superClass="com.sylixos.realcoder.targetPlatform.armsylixoseabi"/>
<builder id="com.sylixos.realcoder.builder.armsylixeabi.1907473864" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="SylixOS Builder" superClass="com.sylixos.realcoder.builder.armsylixeabi"/>
<tool id="com.sylixos.realcoder.tool.armsylixeabi.1127038489" name="arm-sylixos-eabi-gcc" superClass="com.sylixos.realcoder.tool.armsylixeabi">
<option id="com.sylixos.realcoder.option.armsylixoseabi.include.254013916" name="Include paths (-I)" superClass="com.sylixos.realcoder.option.armsylixoseabi.include" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${SYLIXOS_BASE_PATH}/libsylixos/SylixOS&quot;"/>
<listOptionValue builtIn="false" value="&quot;${SYLIXOS_BASE_PATH}/libsylixos/SylixOS/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${SYLIXOS_BASE_PATH}/libsylixos/SylixOS/include/inet&quot;"/>
<listOptionValue builtIn="false" value="&quot;${SYLIXOS_TOOLCHAIN_PATH}/${SYLIXOS_TOOLCHAIN_PREFIX}/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${SYLIXOS_TOOLCHAIN_PATH}/lib/gcc/${SYLIXOS_TOOLCHAIN_PREFIX}/${SYLIXOS_TOOLCHAIN_VER}/include&quot;"/>
</option>
<option id="com.sylixos.realcoder.option.armsylixoseabi.DefinedSymbols.75703099" name="Defined symbols(-D)" superClass="com.sylixos.realcoder.option.armsylixoseabi.DefinedSymbols" valueType="definedSymbols">
<option id="com.sylixos.realcoder.option.armsylixoseabi.DefinedSymbols.1602205966" name="Defined symbols(-D)" superClass="com.sylixos.realcoder.option.armsylixoseabi.DefinedSymbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__GNUC__=4"/>
<listOptionValue builtIn="false" value="SYLIXOS"/>
</option>
<inputType id="com.sylixos.realcoder.inputType.armnsylixeabic.381269677" name="SylixOS Input C" superClass="com.sylixos.realcoder.inputType.armnsylixeabic"/>
<inputType id="com.sylixos.realcoder.inputType.armnsylixeabicpp.345378795" name="SylixOS Input CPP" superClass="com.sylixos.realcoder.inputType.armnsylixeabicpp"/>
<inputType id="com.sylixos.realcoder.inputType.armnsylixeabic.1343998949" name="SylixOS Input C" superClass="com.sylixos.realcoder.inputType.armnsylixeabic"/>
<inputType id="com.sylixos.realcoder.inputType.armnsylixeabicpp.876463260" name="SylixOS Input CPP" superClass="com.sylixos.realcoder.inputType.armnsylixeabicpp"/>
</tool>
</toolChain>
</folderInfo>
@ -50,11 +52,15 @@
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="readline.null.1432636451" name="readline"/>
<project id="readline.null.437525139" name="readline"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Default">
<resource resourceType="PROJECT" workspacePath="/readline"/>
</configuration>
</storageModule>
</cproject>

4
.template/Makefile.arch

@ -0,0 +1,4 @@
#*********************************************************************************************************
# include architecture related Makefile
#*********************************************************************************************************
include Makefile.$(SylixOS_Arch)

41
.template/config.mk

@ -0,0 +1,41 @@
#*********************************************************************************************************
#
# 中国软件开源组织
#
# 嵌入式实时操作系统
#
# SylixOS(TM) LW : long wing
#
# Copyright All Rights Reserved
#
#--------------文件信息--------------------------------------------------------------------------------
#
# 文 件 名: config.mk
#
# 创 建 人: RealEvo-IDE
#
# 文件创建日期: $(Create_Date)
#
# 描 述: 本文件由 RealEvo-IDE 生成,用于配置 Makefile 功能,请勿手动修改
#*********************************************************************************************************
#*********************************************************************************************************
# SylixOS Base Project path
#*********************************************************************************************************
SYLIXOS_BASE_PATH = $(SylixOS_Base_Path)
#*********************************************************************************************************
# Toolchain prefix
#*********************************************************************************************************
TOOLCHAIN_PREFIX = $(SylixOS_Toolchain)-
#*********************************************************************************************************
# Debug options (debug or release)
#*********************************************************************************************************
DEBUG_LEVEL = $(SylixOS_Debug_Level)
#*********************************************************************************************************
# NOTICE: libsylixos, BSP and other kernel modules projects CAN NOT use vfp!
#*********************************************************************************************************
FPUFLAGS = $(SylixOS_Fpu_Type)
CPUFLAGS = $(SylixOS_Cpu_Type) $(FPUFLAGS)

266
Makefile

@ -1,266 +1,4 @@
#*********************************************************************************************************
# readline Makefile
# target -> libreadline.a
# libreadline.so
#*********************************************************************************************************
#*********************************************************************************************************
# include config.mk
#*********************************************************************************************************
CONFIG_MK_EXIST = $(shell if [ -f ../config.mk ]; then echo exist; else echo notexist; fi;)
ifeq ($(CONFIG_MK_EXIST), exist)
include ../config.mk
else
CONFIG_MK_EXIST = $(shell if [ -f config.mk ]; then echo exist; else echo notexist; fi;)
ifeq ($(CONFIG_MK_EXIST), exist)
include config.mk
else
CONFIG_MK_EXIST =
endif
endif
#*********************************************************************************************************
# check configure
#*********************************************************************************************************
check_defined = \
$(foreach 1,$1,$(__check_defined))
__check_defined = \
$(if $(value $1),, \
$(error Undefined $1$(if $(value 2), ($(strip $2)))))
$(call check_defined, CONFIG_MK_EXIST, Please configure this project in RealCoder or \
create a config.mk file!)
$(call check_defined, SYLIXOS_BASE_PATH, SylixOS base project path)
$(call check_defined, TOOLCHAIN_PREFIX, the prefix name of toolchain)
$(call check_defined, DEBUG_LEVEL, debug level(debug or release))
#*********************************************************************************************************
# configure area you can set the following config to you own system
# FPUFLAGS (-mfloat-abi=softfp -mfpu=vfpv3 ...)
# CPUFLAGS (-mcpu=arm920t ...)
# NOTICE: libsylixos, BSP and other kernel modules projects CAN NOT use vfp!
#*********************************************************************************************************
FPUFLAGS =
CPUFLAGS = -mcpu=arm920t $(FPUFLAGS)
#*********************************************************************************************************
# toolchain select
#*********************************************************************************************************
CC = $(TOOLCHAIN_PREFIX)gcc
CXX = $(TOOLCHAIN_PREFIX)g++
AS = $(TOOLCHAIN_PREFIX)gcc
AR = $(TOOLCHAIN_PREFIX)ar
LD = $(TOOLCHAIN_PREFIX)g++
#*********************************************************************************************************
# do not change the following code
# buildin internal application source
#*********************************************************************************************************
#*********************************************************************************************************
# src(s) file
#*********************************************************************************************************
SRCS = \
readline/bind.c \
readline/callback.c \
readline/colors.c \
readline/compat.c \
readline/complete.c \
readline/display.c \
readline/funmap.c \
readline/histexpand.c \
readline/histfile.c \
readline/history.c \
readline/histsearch.c \
readline/input.c \
readline/isearch.c \
readline/keymaps.c \
readline/kill.c \
readline/macro.c \
readline/mbutil.c \
readline/misc.c \
readline/nls.c \
readline/parens.c \
readline/parse-colors.c \
readline/readline.c \
readline/rltty.c \
readline/savestring.c \
readline/search.c \
readline/shell.c \
readline/signals.c \
readline/terminal.c \
readline/text.c \
readline/tilde.c \
readline/undo.c \
readline/util.c \
readline/vi_mode.c \
readline/xfree.c \
readline/xmalloc.c
#*********************************************************************************************************
# build path
#*********************************************************************************************************
ifeq ($(DEBUG_LEVEL), debug)
OUTDIR = Debug
else
OUTDIR = Release
endif
OUTPATH = ./$(OUTDIR)
OBJPATH = $(OUTPATH)/obj
DEPPATH = $(OUTPATH)/dep
#*********************************************************************************************************
# target
#*********************************************************************************************************
LIB = $(OUTPATH)/libreadline.a
DLL = $(OUTPATH)/libreadline.so
#*********************************************************************************************************
# objects
#*********************************************************************************************************
OBJS = $(addprefix $(OBJPATH)/, $(addsuffix .o, $(basename $(SRCS))))
DEPS = $(addprefix $(DEPPATH)/, $(addsuffix .d, $(basename $(SRCS))))
#*********************************************************************************************************
# include path
#*********************************************************************************************************
INCDIR = -I"$(SYLIXOS_BASE_PATH)/libsylixos/SylixOS"
INCDIR += -I"$(SYLIXOS_BASE_PATH)/libsylixos/SylixOS/include"
INCDIR += -I"$(SYLIXOS_BASE_PATH)/libsylixos/SylixOS/include/inet"
INCDIR += -I"."
INCDIR += -I"./readline"
#*********************************************************************************************************
# compiler preprocess
#*********************************************************************************************************
DSYMBOL = -DSYLIXOS
DSYMBOL += -DSYLIXOS_LIB
DSYMBOL += -DHAVE_CONFIG_H
DSYMBOL += -D_POSIX_VERSION=2008
#*********************************************************************************************************
# depend dynamic library
#*********************************************************************************************************
DEPEND_DLL = -lcextern
#*********************************************************************************************************
# depend dynamic library search path
#*********************************************************************************************************
DEPEND_DLL_PATH = -L"$(SYLIXOS_BASE_PATH)/libcextern/$(OUTDIR)"
#*********************************************************************************************************
# compiler optimize
#*********************************************************************************************************
ifeq ($(DEBUG_LEVEL), debug)
OPTIMIZE = -O0 -g3 -gdwarf-2
else
OPTIMIZE = -O2 -g1 -gdwarf-2 # Do NOT use -O3 and -Os
endif # -Os is not align for function
# loop and jump.
#*********************************************************************************************************
# depends and compiler parameter (cplusplus in kernel MUST NOT use exceptions and rtti)
#*********************************************************************************************************
DEPENDFLAG = -MM
CXX_EXCEPT = -fno-exceptions -fno-rtti
COMMONFLAGS = $(CPUFLAGS) $(OPTIMIZE) -Wall -fmessage-length=0 -fsigned-char -fno-short-enums
ASFLAGS = -x assembler-with-cpp $(DSYMBOL) $(INCDIR) $(COMMONFLAGS) -c
CFLAGS = $(DSYMBOL) $(INCDIR) $(COMMONFLAGS) -fPIC -c
CXXFLAGS = $(DSYMBOL) $(INCDIR) $(CXX_EXCEPT) $(COMMONFLAGS) -fPIC -c
ARFLAGS = -r
#*********************************************************************************************************
# define some useful variable
#*********************************************************************************************************
DEPEND = $(CC) $(DEPENDFLAG) $(CFLAGS)
DEPEND.d = $(subst -g ,,$(DEPEND))
COMPILE.S = $(AS) $(ASFLAGS)
COMPILE_VFP.S = $(AS) $(ASFLAGS)
COMPILE.c = $(CC) $(CFLAGS)
COMPILE.cxx = $(CXX) $(CXXFLAGS)
#*********************************************************************************************************
# target
#*********************************************************************************************************
all: $(LIB) $(DLL)
@echo create "$(LIB) $(DLL)" success.
#*********************************************************************************************************
# include depends
#*********************************************************************************************************
ifneq ($(MAKECMDGOALS), clean)
ifneq ($(MAKECMDGOALS), clean_project)
sinclude $(DEPS)
endif
endif
#*********************************************************************************************************
# create depends files
#*********************************************************************************************************
$(DEPPATH)/%.d: %.c
@echo creating $@
@if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
@rm -f $@; \
echo -n '$@ $(addprefix $(OBJPATH)/, $(dir $<))' > $@; \
$(DEPEND.d) $< >> $@ || rm -f $@; exit;
$(DEPPATH)/%.d: %.cpp
@echo creating $@
@if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
@rm -f $@; \
echo -n '$@ $(addprefix $(OBJPATH)/, $(dir $<))' > $@; \
$(DEPEND.d) $< >> $@ || rm -f $@; exit;
#*********************************************************************************************************
# compile source files
#*********************************************************************************************************
$(OBJPATH)/%.o: %.S
@if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
$(COMPILE.S) $< -o $@
$(OBJPATH)/%.o: %.c
@if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
$(COMPILE.c) $< -o $@
$(OBJPATH)/%.o: %.cpp
@if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
$(COMPILE.cxx) $< -o $@
#*********************************************************************************************************
# link libreadline.a object files
#*********************************************************************************************************
$(LIB): $(OBJS)
$(AR) $(ARFLAGS) $(LIB) $(OBJS)
#*********************************************************************************************************
# link libreadline.so object files
#*********************************************************************************************************
$(DLL): $(OBJS)
$(LD) $(CPUFLAGS) -nostdlib -fPIC -shared -o $(DLL) $(OBJS) \
$(DEPEND_DLL_PATH) $(DEPEND_DLL) -lm -lgcc
#*********************************************************************************************************
# clean
#*********************************************************************************************************
.PHONY: clean
.PHONY: clean_project
#*********************************************************************************************************
# clean objects
#*********************************************************************************************************
clean:
-rm -rf $(LIB)
-rm -rf $(DLL)
-rm -rf $(OBJS)
-rm -rf $(OBJPATH)
-rm -rf $(DEPPATH)
#*********************************************************************************************************
# clean project
#*********************************************************************************************************
clean_project:
-rm -rf $(OUTPATH)
#*********************************************************************************************************
# END
# include architecture related Makefile
#*********************************************************************************************************
include Makefile.arm

257
Makefile.arm

@ -0,0 +1,257 @@
#*********************************************************************************************************
# readline Makefile
# target -> libreadline.a
# libreadline.so
#*********************************************************************************************************
#*********************************************************************************************************
# include config.mk
#*********************************************************************************************************
CONFIG_MK_EXIST = $(shell if [ -f ../config.mk ]; then echo exist; else echo notexist; fi;)
ifeq ($(CONFIG_MK_EXIST), exist)
include ../config.mk
else
CONFIG_MK_EXIST = $(shell if [ -f config.mk ]; then echo exist; else echo notexist; fi;)
ifeq ($(CONFIG_MK_EXIST), exist)
include config.mk
else
CONFIG_MK_EXIST =
endif
endif
#*********************************************************************************************************
# check configure
#*********************************************************************************************************
check_defined = \
$(foreach 1,$1,$(__check_defined))
__check_defined = \
$(if $(value $1),, \
$(error Undefined $1$(if $(value 2), ($(strip $2)))))
$(call check_defined, CONFIG_MK_EXIST, Please configure this project in RealEvo-IDE or \
create a config.mk file!)
$(call check_defined, SYLIXOS_BASE_PATH, SylixOS base project path)
$(call check_defined, TOOLCHAIN_PREFIX, the prefix name of toolchain)
$(call check_defined, DEBUG_LEVEL, debug level(debug or release))
#*********************************************************************************************************
# toolchain select
#*********************************************************************************************************
CC = $(TOOLCHAIN_PREFIX)gcc
CXX = $(TOOLCHAIN_PREFIX)g++
AS = $(TOOLCHAIN_PREFIX)gcc
AR = $(TOOLCHAIN_PREFIX)ar
LD = $(TOOLCHAIN_PREFIX)g++
#*********************************************************************************************************
# do not change the following code
# buildin internal application source
#*********************************************************************************************************
#*********************************************************************************************************
# src(s) file
#*********************************************************************************************************
SRCS = \
readline/bind.c \
readline/callback.c \
readline/colors.c \
readline/compat.c \
readline/complete.c \
readline/display.c \
readline/funmap.c \
readline/histexpand.c \
readline/histfile.c \
readline/history.c \
readline/histsearch.c \
readline/input.c \
readline/isearch.c \
readline/keymaps.c \
readline/kill.c \
readline/macro.c \
readline/mbutil.c \
readline/misc.c \
readline/nls.c \
readline/parens.c \
readline/parse-colors.c \
readline/readline.c \
readline/rltty.c \
readline/savestring.c \
readline/search.c \
readline/shell.c \
readline/signals.c \
readline/terminal.c \
readline/text.c \
readline/tilde.c \
readline/undo.c \
readline/util.c \
readline/vi_mode.c \
readline/xfree.c \
readline/xmalloc.c
#*********************************************************************************************************
# build path
#*********************************************************************************************************
ifeq ($(DEBUG_LEVEL), debug)
OUTDIR = Debug
else
OUTDIR = Release
endif
OUTPATH = ./$(OUTDIR)
OBJPATH = $(OUTPATH)/obj
DEPPATH = $(OUTPATH)/dep
#*********************************************************************************************************
# target
#*********************************************************************************************************
LIB = $(OUTPATH)/libreadline.a
DLL = $(OUTPATH)/libreadline.so
#*********************************************************************************************************
# objects
#*********************************************************************************************************
OBJS = $(addprefix $(OBJPATH)/, $(addsuffix .o, $(basename $(SRCS))))
DEPS = $(addprefix $(DEPPATH)/, $(addsuffix .d, $(basename $(SRCS))))
#*********************************************************************************************************
# include path
#*********************************************************************************************************
INCDIR = -I"$(SYLIXOS_BASE_PATH)/libsylixos/SylixOS"
INCDIR += -I"$(SYLIXOS_BASE_PATH)/libsylixos/SylixOS/include"
INCDIR += -I"$(SYLIXOS_BASE_PATH)/libsylixos/SylixOS/include/inet"
INCDIR += -I"."
INCDIR += -I"./readline"
#*********************************************************************************************************
# compiler preprocess
#*********************************************************************************************************
DSYMBOL = -DSYLIXOS
DSYMBOL += -DSYLIXOS_LIB
DSYMBOL += -DHAVE_CONFIG_H
DSYMBOL += -D_POSIX_VERSION=2008
#*********************************************************************************************************
# depend dynamic library
#*********************************************************************************************************
DEPEND_DLL = -lcextern
#*********************************************************************************************************
# depend dynamic library search path
#*********************************************************************************************************
DEPEND_DLL_PATH = -L"$(SYLIXOS_BASE_PATH)/libcextern/$(OUTDIR)"
#*********************************************************************************************************
# compiler optimize
#*********************************************************************************************************
ifeq ($(DEBUG_LEVEL), debug)
OPTIMIZE = -O0 -g3 -gdwarf-2
else
OPTIMIZE = -O2 -g1 -gdwarf-2 # Do NOT use -O3 and -Os
endif # -Os is not align for function
# loop and jump.
#*********************************************************************************************************
# depends and compiler parameter (cplusplus in kernel MUST NOT use exceptions and rtti)
#*********************************************************************************************************
DEPENDFLAG = -MM
CXX_EXCEPT = -fno-exceptions -fno-rtti
COMMONFLAGS = $(CPUFLAGS) $(OPTIMIZE) -Wall -fmessage-length=0 -fsigned-char -fno-short-enums
ASFLAGS = -x assembler-with-cpp $(DSYMBOL) $(INCDIR) $(COMMONFLAGS) -c
CFLAGS = $(DSYMBOL) $(INCDIR) $(COMMONFLAGS) -fPIC -c
CXXFLAGS = $(DSYMBOL) $(INCDIR) $(CXX_EXCEPT) $(COMMONFLAGS) -fPIC -c
ARFLAGS = -r
#*********************************************************************************************************
# define some useful variable
#*********************************************************************************************************
DEPEND = $(CC) $(DEPENDFLAG) $(CFLAGS)
DEPEND.d = $(subst -g ,,$(DEPEND))
COMPILE.S = $(AS) $(ASFLAGS)
COMPILE_VFP.S = $(AS) $(ASFLAGS)
COMPILE.c = $(CC) $(CFLAGS)
COMPILE.cxx = $(CXX) $(CXXFLAGS)
#*********************************************************************************************************
# target
#*********************************************************************************************************
all: $(LIB) $(DLL)
@echo create "$(LIB) $(DLL)" success.
#*********************************************************************************************************
# include depends
#*********************************************************************************************************
ifneq ($(MAKECMDGOALS), clean)
ifneq ($(MAKECMDGOALS), clean_project)
sinclude $(DEPS)
endif
endif
#*********************************************************************************************************
# create depends files
#*********************************************************************************************************
$(DEPPATH)/%.d: %.c
@echo creating $@
@if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
@rm -f $@; \
echo -n '$@ $(addprefix $(OBJPATH)/, $(dir $<))' > $@; \
$(DEPEND.d) $< >> $@ || rm -f $@; exit;
$(DEPPATH)/%.d: %.cpp
@echo creating $@
@if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
@rm -f $@; \
echo -n '$@ $(addprefix $(OBJPATH)/, $(dir $<))' > $@; \
$(DEPEND.d) $< >> $@ || rm -f $@; exit;
#*********************************************************************************************************
# compile source files
#*********************************************************************************************************
$(OBJPATH)/%.o: %.S
@if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
$(COMPILE.S) $< -o $@
$(OBJPATH)/%.o: %.c
@if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
$(COMPILE.c) $< -o $@
$(OBJPATH)/%.o: %.cpp
@if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
$(COMPILE.cxx) $< -o $@
#*********************************************************************************************************
# link libreadline.a object files
#*********************************************************************************************************
$(LIB): $(OBJS)
$(AR) $(ARFLAGS) $(LIB) $(OBJS)
#*********************************************************************************************************
# link libreadline.so object files
#*********************************************************************************************************
$(DLL): $(OBJS)
$(LD) $(CPUFLAGS) -nostdlib -fPIC -shared -o $(DLL) $(OBJS) \
$(DEPEND_DLL_PATH) $(DEPEND_DLL) -lm -lgcc
#*********************************************************************************************************
# clean
#*********************************************************************************************************
.PHONY: clean
.PHONY: clean_project
#*********************************************************************************************************
# clean objects
#*********************************************************************************************************
clean:
-rm -rf $(LIB)
-rm -rf $(DLL)
-rm -rf $(OBJS)
-rm -rf $(OBJPATH)
-rm -rf $(DEPPATH)
#*********************************************************************************************************
# clean project
#*********************************************************************************************************
clean_project:
-rm -rf $(OUTPATH)
#*********************************************************************************************************
# END
#*********************************************************************************************************

257
Makefile.mips

@ -0,0 +1,257 @@
#*********************************************************************************************************
# readline Makefile
# target -> libreadline.a
# libreadline.so
#*********************************************************************************************************
#*********************************************************************************************************
# include config.mk
#*********************************************************************************************************
CONFIG_MK_EXIST = $(shell if [ -f ../config.mk ]; then echo exist; else echo notexist; fi;)
ifeq ($(CONFIG_MK_EXIST), exist)
include ../config.mk
else
CONFIG_MK_EXIST = $(shell if [ -f config.mk ]; then echo exist; else echo notexist; fi;)
ifeq ($(CONFIG_MK_EXIST), exist)
include config.mk
else
CONFIG_MK_EXIST =
endif
endif
#*********************************************************************************************************
# check configure
#*********************************************************************************************************
check_defined = \
$(foreach 1,$1,$(__check_defined))
__check_defined = \
$(if $(value $1),, \
$(error Undefined $1$(if $(value 2), ($(strip $2)))))
$(call check_defined, CONFIG_MK_EXIST, Please configure this project in RealEvo-IDE or \
create a config.mk file!)
$(call check_defined, SYLIXOS_BASE_PATH, SylixOS base project path)
$(call check_defined, TOOLCHAIN_PREFIX, the prefix name of toolchain)
$(call check_defined, DEBUG_LEVEL, debug level(debug or release))
#*********************************************************************************************************
# toolchain select
#*********************************************************************************************************
CC = $(TOOLCHAIN_PREFIX)gcc
CXX = $(TOOLCHAIN_PREFIX)g++
AS = $(TOOLCHAIN_PREFIX)gcc
AR = $(TOOLCHAIN_PREFIX)ar
LD = $(TOOLCHAIN_PREFIX)g++
#*********************************************************************************************************
# do not change the following code
# buildin internal application source
#*********************************************************************************************************
#*********************************************************************************************************
# src(s) file
#*********************************************************************************************************
SRCS = \
readline/bind.c \
readline/callback.c \
readline/colors.c \
readline/compat.c \
readline/complete.c \
readline/display.c \
readline/funmap.c \
readline/histexpand.c \
readline/histfile.c \
readline/history.c \
readline/histsearch.c \
readline/input.c \
readline/isearch.c \
readline/keymaps.c \
readline/kill.c \
readline/macro.c \
readline/mbutil.c \
readline/misc.c \
readline/nls.c \
readline/parens.c \
readline/parse-colors.c \
readline/readline.c \
readline/rltty.c \
readline/savestring.c \
readline/search.c \
readline/shell.c \
readline/signals.c \
readline/terminal.c \
readline/text.c \
readline/tilde.c \
readline/undo.c \
readline/util.c \
readline/vi_mode.c \
readline/xfree.c \
readline/xmalloc.c
#*********************************************************************************************************
# build path
#*********************************************************************************************************
ifeq ($(DEBUG_LEVEL), debug)
OUTDIR = Debug
else
OUTDIR = Release
endif
OUTPATH = ./$(OUTDIR)
OBJPATH = $(OUTPATH)/obj
DEPPATH = $(OUTPATH)/dep
#*********************************************************************************************************
# target
#*********************************************************************************************************
LIB = $(OUTPATH)/libreadline.a
DLL = $(OUTPATH)/libreadline.so
#*********************************************************************************************************
# objects
#*********************************************************************************************************
OBJS = $(addprefix $(OBJPATH)/, $(addsuffix .o, $(basename $(SRCS))))
DEPS = $(addprefix $(DEPPATH)/, $(addsuffix .d, $(basename $(SRCS))))
#*********************************************************************************************************
# include path
#*********************************************************************************************************
INCDIR = -I"$(SYLIXOS_BASE_PATH)/libsylixos/SylixOS"
INCDIR += -I"$(SYLIXOS_BASE_PATH)/libsylixos/SylixOS/include"
INCDIR += -I"$(SYLIXOS_BASE_PATH)/libsylixos/SylixOS/include/inet"
INCDIR += -I"."
INCDIR += -I"./readline"
#*********************************************************************************************************
# compiler preprocess
#*********************************************************************************************************
DSYMBOL = -DSYLIXOS
DSYMBOL += -DSYLIXOS_LIB
DSYMBOL += -DHAVE_CONFIG_H
DSYMBOL += -D_POSIX_VERSION=2008
#*********************************************************************************************************
# depend dynamic library
#*********************************************************************************************************
DEPEND_DLL = -lcextern
#*********************************************************************************************************
# depend dynamic library search path
#*********************************************************************************************************
DEPEND_DLL_PATH = -L"$(SYLIXOS_BASE_PATH)/libcextern/$(OUTDIR)"
#*********************************************************************************************************
# compiler optimize
#*********************************************************************************************************
ifeq ($(DEBUG_LEVEL), debug)
OPTIMIZE = -O0 -g3 -gdwarf-2
else
OPTIMIZE = -O2 -g1 -gdwarf-2 # Do NOT use -O3 and -Os
endif # -Os is not align for function
# loop and jump.
#*********************************************************************************************************
# depends and compiler parameter (cplusplus in kernel MUST NOT use exceptions and rtti)
#*********************************************************************************************************
DEPENDFLAG = -MM
CXX_EXCEPT = -fno-exceptions -fno-rtti
COMMONFLAGS = $(CPUFLAGS) $(OPTIMIZE) -Wall -fmessage-length=0 -fsigned-char -fno-short-enums
ASFLAGS = -x assembler-with-cpp $(DSYMBOL) $(INCDIR) $(COMMONFLAGS) -mabicalls -c
CFLAGS = $(DSYMBOL) $(INCDIR) $(COMMONFLAGS) -fPIC -mabicalls -c
CXXFLAGS = $(DSYMBOL) $(INCDIR) $(CXX_EXCEPT) $(COMMONFLAGS) -fPIC -mabicalls -c
ARFLAGS = -r
#*********************************************************************************************************
# define some useful variable
#*********************************************************************************************************
DEPEND = $(CC) $(DEPENDFLAG) $(CFLAGS)
DEPEND.d = $(subst -g ,,$(DEPEND))
COMPILE.S = $(AS) $(ASFLAGS)
COMPILE_VFP.S = $(AS) $(ASFLAGS) -mhard-float
COMPILE.c = $(CC) $(CFLAGS)
COMPILE.cxx = $(CXX) $(CXXFLAGS)
#*********************************************************************************************************
# target
#*********************************************************************************************************
all: $(LIB) $(DLL)
@echo create "$(LIB) $(DLL)" success.
#*********************************************************************************************************
# include depends
#*********************************************************************************************************
ifneq ($(MAKECMDGOALS), clean)
ifneq ($(MAKECMDGOALS), clean_project)
sinclude $(DEPS)
endif
endif
#*********************************************************************************************************
# create depends files
#*********************************************************************************************************
$(DEPPATH)/%.d: %.c
@echo creating $@
@if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
@rm -f $@; \
echo -n '$@ $(addprefix $(OBJPATH)/, $(dir $<))' > $@; \
$(DEPEND.d) $< >> $@ || rm -f $@; exit;
$(DEPPATH)/%.d: %.cpp
@echo creating $@
@if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
@rm -f $@; \
echo -n '$@ $(addprefix $(OBJPATH)/, $(dir $<))' > $@; \
$(DEPEND.d) $< >> $@ || rm -f $@; exit;
#*********************************************************************************************************
# compile source files
#*********************************************************************************************************
$(OBJPATH)/%.o: %.S
@if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
$(COMPILE.S) $< -o $@
$(OBJPATH)/%.o: %.c
@if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
$(COMPILE.c) $< -o $@
$(OBJPATH)/%.o: %.cpp
@if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
$(COMPILE.cxx) $< -o $@
#*********************************************************************************************************
# link libreadline.a object files
#*********************************************************************************************************
$(LIB): $(OBJS)
$(AR) $(ARFLAGS) $(LIB) $(OBJS)
#*********************************************************************************************************
# link libreadline.so object files
#*********************************************************************************************************
$(DLL): $(OBJS)
$(LD) $(CPUFLAGS) -fPIC -mabicalls -shared -o $(DLL) $(OBJS) \
$(DEPEND_DLL_PATH) $(DEPEND_DLL) -lm -lgcc
#*********************************************************************************************************
# clean
#*********************************************************************************************************
.PHONY: clean
.PHONY: clean_project
#*********************************************************************************************************
# clean objects
#*********************************************************************************************************
clean:
-rm -rf $(LIB)
-rm -rf $(DLL)
-rm -rf $(OBJS)
-rm -rf $(OBJPATH)
-rm -rf $(DEPPATH)
#*********************************************************************************************************
# clean project
#*********************************************************************************************************
clean_project:
-rm -rf $(OUTPATH)
#*********************************************************************************************************
# END
#*********************************************************************************************************

0
Makefile.ppc

0
Makefile.x86

17
config.mk

@ -12,16 +12,16 @@
#
# ÎÄ ¼þ Ãû: config.mk
#
# 创 建 人: RealCoder
# 创 建 人: RealEvo-IDE
#
# 文件创建日期: 2015 年05 月25
# 文件创建日期: 2016 年02 月27
#
# 描 述: 本文件由RealCoder生成,用于配置Makefile功能,请勿手动修改
# 描 述: 本文件由 RealEvo-IDE 生成,用于配置 Makefile 功能,请勿手动修改
#*********************************************************************************************************
#*********************************************************************************************************
# SylixOS Base Project path
#*********************************************************************************************************
SYLIXOS_BASE_PATH = E:/SylixOS/gcc/base
SYLIXOS_BASE_PATH = D:/workspace/sylixos-base
#*********************************************************************************************************
# Toolchain prefix
@ -31,4 +31,11 @@ TOOLCHAIN_PREFIX = arm-sylixos-eabi-
#*********************************************************************************************************
# Debug options (debug or release)
#*********************************************************************************************************
DEBUG_LEVEL = debug
DEBUG_LEVEL = debug
#*********************************************************************************************************
# NOTICE: libsylixos, BSP and other kernel modules projects CAN NOT use vfp!
#*********************************************************************************************************
FPUFLAGS =
CPUFLAGS = -mcpu=arm920t $(FPUFLAGS)

Loading…
Cancel
Save