提交 c99ca774 编写于 作者: qiuyiuestc's avatar qiuyiuestc

Modify the link mode, compile each component to static library first and then link them

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1405 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 7a6949f2
...@@ -15,6 +15,7 @@ TARGET = 'rtthread-mini2440.' + rtconfig.TARGET_EXT ...@@ -15,6 +15,7 @@ TARGET = 'rtthread-mini2440.' + rtconfig.TARGET_EXT
env = Environment(tools = ['mingw'], env = Environment(tools = ['mingw'],
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS, CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
CXX = rtconfig.CXX,
AR = rtconfig.AR, ARFLAGS = '-rc', AR = rtconfig.AR, ARFLAGS = '-rc',
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
env.PrependENVPath('PATH', rtconfig.EXEC_PATH) env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
...@@ -22,20 +23,25 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) ...@@ -22,20 +23,25 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
Export('RTT_ROOT') Export('RTT_ROOT')
Export('rtconfig') Export('rtconfig')
# prepare building environment if rtconfig.PLATFORM == 'gcc':
objs = PrepareBuilding(env, RTT_ROOT) start_obj = 'build/libcpu/' + rtconfig.ARCH + '/' + rtconfig.CPU + '/start_gcc.o',
elif rtconfig.PLATFORM == 'armcc':
start_obj = 'build/libcpu/' + rtconfig.ARCH + '/' + rtconfig.CPU + '/start_rvds.o',
if GetDepend('RT_USING_WEBSERVER'): # prepare building environment
objs = objs + SConscript(RTT_ROOT + '/components/net/webserver/SConscript', variant_dir='build/net/webserver', duplicate=0) libs = PrepareBuilding(env, RTT_ROOT)
if GetDepend('RT_USING_RTGUI'): if GetDepend('RT_USING_RTGUI'):
objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0) libs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
# libc testsuite # libc testsuite
# objs = objs + SConscript(RTT_ROOT + '/examples/libc/SConscript', variant_dir='build/examples/libc', duplicate=0) # libs = libs + SConscript(RTT_ROOT + '/examples/libc/SConscript', variant_dir='build/examples/libc', duplicate=0)
# build program # build program
env.Program(TARGET, objs) if GetDepend('RT_USING_NEWLIB'):
env.Program(target = TARGET, source = [start_obj, 'build/components/libc/newlib/syscalls.o', 'build/components/libc/newlib/libc.o'], LIBS = libs)
else:
env.Program(target = TARGET, source = start_obj, LIBS = libs)
# end building # end building
EndBuilding(TARGET) EndBuilding(TARGET)
...@@ -224,10 +224,12 @@ void calibration_init() ...@@ -224,10 +224,12 @@ void calibration_init()
2048, 20, 5); 2048, 20, 5);
if (calibration_ptr->tid != RT_NULL) rt_thread_startup(calibration_ptr->tid); if (calibration_ptr->tid != RT_NULL) rt_thread_startup(calibration_ptr->tid);
} }
#ifdef RT_USING_FINSH
#include <finsh.h> #include <finsh.h>
void calibration() void calibration()
{ {
calibration_init(); calibration_init();
} }
FINSH_FUNCTION_EXPORT(calibration, perform touch calibration); FINSH_FUNCTION_EXPORT(calibration, perform touch calibration);
#endif
...@@ -96,12 +96,12 @@ ...@@ -96,12 +96,12 @@
/* use long file name feature */ /* use long file name feature */
#define RT_DFS_ELM_USE_LFN 1 #define RT_DFS_ELM_USE_LFN 1
/* the max number of file length */ /* the max number of file length */
#define RT_DFS_ELM_MAX_LFN 32 #define RT_DFS_ELM_MAX_LFN 128
/* #define RT_USING_DFS_YAFFS2 */ /* #define RT_USING_DFS_YAFFS2 */
/* #define RT_USING_DFS_UFFS */ /* #define RT_USING_DFS_UFFS */
/* #define RT_USING_DFS_DEVFS */ /* #define RT_USING_DFS_DEVFS */
#define RT_USING_DFS_NFS /* #define RT_USING_DFS_NFS */
#define RT_NFS_HOST_EXPORT "192.168.1.5:/" #define RT_NFS_HOST_EXPORT "192.168.1.5:/"
/* #define DFS_USING_WORKDIR */ /* #define DFS_USING_WORKDIR */
...@@ -220,11 +220,12 @@ ...@@ -220,11 +220,12 @@
/* RTGUI image options */ /* RTGUI image options */
#define RTGUI_IMAGE_XPM #define RTGUI_IMAGE_XPM
#define RTGUI_IMAGE_JPEG #define RTGUI_IMAGE_JPEG
#define RTGUI_IMAGE_PNG
#define RTGUI_IMAGE_BMP #define RTGUI_IMAGE_BMP
/* SECTION: FTK support */ /* SECTION: FTK support */
/* using FTK support */ /* using FTK support */
/* #define RT_USING_FTK */ /* #define RT_USING_FTK */
/* /*
* Note on FTK: * Note on FTK:
......
...@@ -11,16 +11,17 @@ CROSS_TOOL = 'gcc' ...@@ -11,16 +11,17 @@ CROSS_TOOL = 'gcc'
if CROSS_TOOL == 'gcc': if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc' PLATFORM = 'gcc'
EXEC_PATH = 'E:/Program Files/CodeSourcery/Sourcery G++ Lite/bin' EXEC_PATH = 'C:/Program Files/CodeSourcery/Sourcery G++ Lite/bin'
elif CROSS_TOOL == 'keil': elif CROSS_TOOL == 'keil':
PLATFORM = 'armcc' PLATFORM = 'armcc'
EXEC_PATH = 'E:/Keil' EXEC_PATH = 'C:/Keil'
BUILD = 'debug' BUILD = 'debug'
if PLATFORM == 'gcc': if PLATFORM == 'gcc':
# toolchains # toolchains
PREFIX = 'arm-none-eabi-' PREFIX = 'arm-none-eabi-'
CC = PREFIX + 'gcc' CC = PREFIX + 'gcc'
CXX = PREFIX + 'g++'
AS = PREFIX + 'gcc' AS = PREFIX + 'gcc'
AR = PREFIX + 'ar' AR = PREFIX + 'ar'
LINK = PREFIX + 'gcc' LINK = PREFIX + 'gcc'
...@@ -48,6 +49,7 @@ if PLATFORM == 'gcc': ...@@ -48,6 +49,7 @@ if PLATFORM == 'gcc':
elif PLATFORM == 'armcc': elif PLATFORM == 'armcc':
# toolchains # toolchains
CC = 'armcc' CC = 'armcc'
CXX = 'armcc'
AS = 'armasm' AS = 'armasm'
AR = 'armar' AR = 'armar'
LINK = 'armlink' LINK = 'armlink'
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
* 2009-05-27 Yi.qiu The first version. * 2009-05-27 Yi.qiu The first version.
* 2010-07-18 Bernard add stat and statfs structure definitions. * 2010-07-18 Bernard add stat and statfs structure definitions.
* 2011-05-16 Yi.qiu Change parameter name of rename, "new" is C++ key word.
*/ */
#ifndef __DFS_POSIX_H__ #ifndef __DFS_POSIX_H__
#define __DFS_POSIX_H__ #define __DFS_POSIX_H__
...@@ -100,7 +101,7 @@ int close(int d); ...@@ -100,7 +101,7 @@ int close(int d);
int read(int fd, void *buf, size_t len); int read(int fd, void *buf, size_t len);
int write(int fd, const void *buf, size_t len); int write(int fd, const void *buf, size_t len);
off_t lseek(int fd, off_t offset, int whence); off_t lseek(int fd, off_t offset, int whence);
int rename(const char* old, const char* new ); int rename(const char *from, const char *to);
int unlink(const char *pathname); int unlink(const char *pathname);
int stat(const char *file, struct stat *buf); int stat(const char *file, struct stat *buf);
int fstat(int fildes, struct stat *buf); int fstat(int fildes, struct stat *buf);
......
...@@ -22,13 +22,13 @@ ...@@ -22,13 +22,13 @@
#ifdef __RT_THREAD__ #ifdef __RT_THREAD__
#include <rtthread.h> #include <rtthread.h>
#define PNG_MAX_MALLOC_64K #define PNG_MAX_MALLOC_64K
#define PNG_NO_STDIO
#ifndef RT_USING_NEWLIB #ifndef RT_USING_NEWLIB
#define PNG_NO_WRITE_SUPPORTED #define PNG_NO_WRITE_SUPPORTED
#define PNG_NO_STDIO
#define PNG_NO_SETJMP_SUPPORTED #define PNG_NO_SETJMP_SUPPORTED
#define malloc rtgui_malloc #define malloc rtgui_malloc
#define free rtgui_free #define free rtgui_free
#endif #endif
#endif #endif
......
...@@ -291,6 +291,7 @@ void zcfree (voidpf opaque, voidpf ptr) ...@@ -291,6 +291,7 @@ void zcfree (voidpf opaque, voidpf ptr)
#ifndef MY_ZCALLOC /* Any system without a special alloc function */ #ifndef MY_ZCALLOC /* Any system without a special alloc function */
#ifdef RT_USING_RTGUI
extern voidp rtgui_malloc OF((uInt size)); extern voidp rtgui_malloc OF((uInt size));
extern voidp rtgui_calloc OF((uInt items, uInt size)); extern voidp rtgui_calloc OF((uInt items, uInt size));
extern void rtgui_free OF((voidpf ptr)); extern void rtgui_free OF((voidpf ptr));
...@@ -312,5 +313,25 @@ void zcfree (opaque, ptr) ...@@ -312,5 +313,25 @@ void zcfree (opaque, ptr)
rtgui_free(ptr); rtgui_free(ptr);
if (opaque) return; /* make compiler happy */ if (opaque) return; /* make compiler happy */
} }
#else
voidpf zcalloc (opaque, items, size)
voidpf opaque;
unsigned items;
unsigned size;
{
if (opaque) items += size - size; /* make compiler happy */
return sizeof(uInt) > 2 ? (voidpf)rt_malloc(items * size) :
(voidpf)rt_calloc(items, size);
}
void zcfree (opaque, ptr)
voidpf opaque;
voidpf ptr;
{
rt_free(ptr);
if (opaque) return; /* make compiler happy */
}
#endif
#endif /* MY_ZCALLOC */ #endif /* MY_ZCALLOC */
...@@ -176,15 +176,15 @@ struct timeval { ...@@ -176,15 +176,15 @@ struct timeval {
#include <dfs_posix.h> #include <dfs_posix.h>
#else #else
typedef rt_uint16_t mode_t; typedef rt_uint16_t mode_t;
#define O_RDONLY 0000000 #define O_RDONLY 0x0000000
#define O_WRONLY 0000001 #define O_WRONLY 0x0000001
#define O_RDWR 0000002 #define O_RDWR 0x0000002
#define O_ACCMODE 0000003 #define O_ACCMODE 0x0000003
#define O_CREAT 0000100 #define O_CREAT 0x0000100
#define O_EXCL 0000200 #define O_EXCL 0x0000200
#define O_TRUNC 0001000 #define O_TRUNC 0x0001000
#define O_APPEND 0002000 #define O_APPEND 0x0002000
#define O_DIRECTORY 0200000 #define O_DIRECTORY 0x0200000
#endif #endif
#elif defined (__GNUC__) /* GNU GCC Compiler, with minilibc */ #elif defined (__GNUC__) /* GNU GCC Compiler, with minilibc */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册