mirror of
https://gitee.com/Vancouver2017/luban-lite-t3e-pro.git
synced 2025-12-16 03:18:54 +00:00
v1.0.3
This commit is contained in:
@@ -1,151 +0,0 @@
|
||||
#
|
||||
# File : building.py
|
||||
# This file is part of RT-Thread RTOS
|
||||
# COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Change Logs:
|
||||
# Date Author Notes
|
||||
# 2015-01-20 Bernard Add copyright information
|
||||
#
|
||||
|
||||
import os
|
||||
import sys
|
||||
import string
|
||||
|
||||
from SCons.Script import *
|
||||
|
||||
BuildOptions = {}
|
||||
Projects = []
|
||||
Env = None
|
||||
|
||||
def GetCurrentDir():
|
||||
conscript = File('SConscript')
|
||||
fn = conscript.rfile()
|
||||
name = fn.name
|
||||
path = os.path.dirname(fn.abspath)
|
||||
return path
|
||||
|
||||
def PrepareHostModuleBuilding(env):
|
||||
global Env
|
||||
Env = env;
|
||||
|
||||
def GetDepend(depend):
|
||||
# always true
|
||||
return True
|
||||
|
||||
def MergeGroup(src_group, group):
|
||||
src_group['src'] = src_group['src'] + group['src']
|
||||
if group.has_key('CCFLAGS'):
|
||||
if src_group.has_key('CCFLAGS'):
|
||||
src_group['CCFLAGS'] = src_group['CCFLAGS'] + group['CCFLAGS']
|
||||
else:
|
||||
src_group['CCFLAGS'] = group['CCFLAGS']
|
||||
if group.has_key('CPPPATH'):
|
||||
if src_group.has_key('CPPPATH'):
|
||||
src_group['CPPPATH'] = src_group['CPPPATH'] + group['CPPPATH']
|
||||
else:
|
||||
src_group['CPPPATH'] = group['CPPPATH']
|
||||
if group.has_key('CPPDEFINES'):
|
||||
if src_group.has_key('CPPDEFINES'):
|
||||
src_group['CPPDEFINES'] = src_group['CPPDEFINES'] + group['CPPDEFINES']
|
||||
else:
|
||||
src_group['CPPDEFINES'] = group['CPPDEFINES']
|
||||
|
||||
# for local CCFLAGS/CPPPATH/CPPDEFINES
|
||||
if group.has_key('LOCAL_CCFLAGS'):
|
||||
if src_group.has_key('LOCAL_CCFLAGS'):
|
||||
src_group['LOCAL_CCFLAGS'] = src_group['LOCAL_CCFLAGS'] + group['LOCAL_CCFLAGS']
|
||||
else:
|
||||
src_group['LOCAL_CCFLAGS'] = group['LOCAL_CCFLAGS']
|
||||
if group.has_key('LOCAL_CPPPATH'):
|
||||
if src_group.has_key('LOCAL_CPPPATH'):
|
||||
src_group['LOCAL_CPPPATH'] = src_group['LOCAL_CPPPATH'] + group['LOCAL_CPPPATH']
|
||||
else:
|
||||
src_group['LOCAL_CPPPATH'] = group['LOCAL_CPPPATH']
|
||||
if group.has_key('LOCAL_CPPDEFINES'):
|
||||
if src_group.has_key('LOCAL_CPPDEFINES'):
|
||||
src_group['LOCAL_CPPDEFINES'] = src_group['LOCAL_CPPDEFINES'] + group['LOCAL_CPPDEFINES']
|
||||
else:
|
||||
src_group['LOCAL_CPPDEFINES'] = group['LOCAL_CPPDEFINES']
|
||||
|
||||
if group.has_key('LINKFLAGS'):
|
||||
if src_group.has_key('LINKFLAGS'):
|
||||
src_group['LINKFLAGS'] = src_group['LINKFLAGS'] + group['LINKFLAGS']
|
||||
else:
|
||||
src_group['LINKFLAGS'] = group['LINKFLAGS']
|
||||
if group.has_key('LIBS'):
|
||||
if src_group.has_key('LIBS'):
|
||||
src_group['LIBS'] = src_group['LIBS'] + group['LIBS']
|
||||
else:
|
||||
src_group['LIBS'] = group['LIBS']
|
||||
if group.has_key('LIBPATH'):
|
||||
if src_group.has_key('LIBPATH'):
|
||||
src_group['LIBPATH'] = src_group['LIBPATH'] + group['LIBPATH']
|
||||
else:
|
||||
src_group['LIBPATH'] = group['LIBPATH']
|
||||
|
||||
def DefineGroup(name, src, depend, **parameters):
|
||||
global Env
|
||||
if not GetDepend(depend):
|
||||
return []
|
||||
|
||||
# find exist group and get path of group
|
||||
group_path = ''
|
||||
for g in Projects:
|
||||
if g['name'] == name:
|
||||
group_path = g['path']
|
||||
if group_path == '':
|
||||
group_path = GetCurrentDir()
|
||||
|
||||
group = parameters
|
||||
group['name'] = name
|
||||
group['path'] = group_path
|
||||
if type(src) == type(['src1']):
|
||||
group['src'] = File(src)
|
||||
else:
|
||||
group['src'] = src
|
||||
|
||||
if group.has_key('CCFLAGS'):
|
||||
Env.Append(CCFLAGS = group['CCFLAGS'])
|
||||
if group.has_key('CPPPATH'):
|
||||
Env.Append(CPPPATH = group['CPPPATH'])
|
||||
if group.has_key('CPPDEFINES'):
|
||||
Env.Append(CPPDEFINES = group['CPPDEFINES'])
|
||||
if group.has_key('LINKFLAGS'):
|
||||
Env.Append(LINKFLAGS = group['LINKFLAGS'])
|
||||
|
||||
if group.has_key('LIBS'):
|
||||
Env.Append(LIBS = group['LIBS'])
|
||||
if group.has_key('LIBPATH'):
|
||||
Env.Append(LIBPATH = group['LIBPATH'])
|
||||
|
||||
if group.has_key('LIBRARY'):
|
||||
objs = Env.Library(name, group['src'])
|
||||
else:
|
||||
objs = group['src']
|
||||
|
||||
# merge group
|
||||
for g in Projects:
|
||||
if g['name'] == name:
|
||||
# merge to this group
|
||||
MergeGroup(g, group)
|
||||
return objs
|
||||
|
||||
# add a new group
|
||||
Projects.append(group)
|
||||
|
||||
return objs
|
||||
@@ -1,11 +0,0 @@
|
||||
from building import *
|
||||
|
||||
src = Glob('*.c') + Glob('*.cpp')
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
CPPPATH = [cwd]
|
||||
CPPDEFINES = ['HOST_BUILD']
|
||||
|
||||
group = DefineGroup('RT-Thread', src, depend = [''], CPPPATH=CPPPATH, CPPDEFINES = CPPDEFINES)
|
||||
|
||||
Return('group')
|
||||
@@ -1,10 +0,0 @@
|
||||
#ifndef FINSH_H__
|
||||
#define FINSH_H__
|
||||
|
||||
#define MSH_CMD_EXPORT(command, desc)
|
||||
#define MSH_CMD_EXPORT_ALIAS(command, alias, desc)
|
||||
|
||||
#define FINSH_FUNCTION_EXPORT(name, desc)
|
||||
#define FINSH_FUNCTION_EXPORT_ALIAS(name, alias, desc)
|
||||
|
||||
#endif
|
||||
@@ -1,41 +0,0 @@
|
||||
#include "rtthread.h"
|
||||
|
||||
#include <time.h>
|
||||
|
||||
void rt_kprintf(const char *fmt, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
|
||||
va_start(argptr,fmt);
|
||||
vprintf(fmt,argptr);
|
||||
va_end(argptr);
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
rt_tick_t rt_tick_get(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *rt_malloc(rt_size_t nbytes)
|
||||
{
|
||||
void* ret = malloc(nbytes);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void rt_free(void *ptr)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
int rt_hw_interrupt_disable(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void rt_hw_interrupt_enable(int level)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
#ifndef RTTHREAD_H__
|
||||
#define RTTHREAD_H__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define RT_USING_DFS
|
||||
#define RT_USING_DEVICE
|
||||
#define RT_TICK_PER_SECOND 100
|
||||
#define RT_CONSOLEBUF_SIZE 256
|
||||
|
||||
#define RT_NULL NULL
|
||||
#define RT_ASSERT(EX) \
|
||||
if (!(EX)) \
|
||||
{ \
|
||||
printf(#EX); \
|
||||
exit(-1); \
|
||||
}
|
||||
|
||||
#define rt_vsnprintf vsnprintf
|
||||
|
||||
typedef size_t rt_size_t;
|
||||
typedef uint32_t rt_tick_t;
|
||||
|
||||
void rt_kprintf(const char *fmt, ...);
|
||||
rt_tick_t rt_tick_get(void);
|
||||
|
||||
void *rt_malloc(rt_size_t nbytes);
|
||||
void rt_free(void *ptr);
|
||||
|
||||
int rt_hw_interrupt_disable(void);
|
||||
void rt_hw_interrupt_enable(int level);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user