Skip to content

Commit

Permalink
Update GUI examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
BernardXiong committed Sep 17, 2015
1 parent 731c725 commit 0a6dd3c
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 40 deletions.
8 changes: 8 additions & 0 deletions software/rtthread_examples/examples/4_gui_button/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ objs += SConscript(cwd + "/../../libraries/SConscript")
# Add RT-Thread lowlevel drivers
objs += SConscript(cwd + "/../../drivers/SConscript", variant_dir='drivers',
duplicate=0)
# Add RTGUI
if os.getenv('RTT_RTGUI'):
RTT_RTGUI = os.getenv('RTT_RTGUI')
else:
RTT_RTGUI = os.path.abspath(os.path.join(cwd, '..', '..', 'rtgui'))

print 'RTT_RTGUI=', RTT_RTGUI
objs += SConscript(RTT_RTGUI + '/SConscript', duplicate = 0)

for d in list:
path = os.path.join(cwd, d)
Expand Down
7 changes: 2 additions & 5 deletions software/rtthread_examples/examples/4_gui_button/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,5 @@ Export('rtconfig')
# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)

# build program
env.Program(TARGET, objs)

# end building
EndBuilding(TARGET)
# do building
DoBuilding(TARGET, objs)
8 changes: 8 additions & 0 deletions software/rtthread_examples/examples/4_gui_examples/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ objs += SConscript(cwd + "/../../libraries/SConscript")
# Add RT-Thread lowlevel drivers
objs += SConscript(cwd + "/../../drivers/SConscript", variant_dir='drivers',
duplicate=0)
# Add RTGUI
if os.getenv('RTT_RTGUI'):
RTT_RTGUI = os.getenv('RTT_RTGUI')
else:
RTT_RTGUI = os.path.abspath(os.path.join(cwd, '..', '..', 'rtgui'))

print 'RTT_RTGUI=', RTT_RTGUI
objs += SConscript(RTT_RTGUI + '/SConscript', duplicate = 0)

for d in list:
path = os.path.join(cwd, d)
Expand Down
23 changes: 6 additions & 17 deletions software/rtthread_examples/examples/4_gui_examples/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import sys
import rtconfig

if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
RTT_ROOT = os.getenv('RTT_ROOT')
else:
RTT_ROOT = os.path.join(Dir('#').get_abspath(), 'rt-thread')
RTT_ROOT = os.path.join(Dir('#').get_abspath(), '..', '..', 'rt-thread')

sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
from building import *

TARGET = 'rtthread-stm32f4xx.' + rtconfig.TARGET_EXT
TARGET = 'rtthread-lpc40xx.' + rtconfig.TARGET_EXT

env = Environment(tools = ['mingw'],
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
Expand All @@ -23,18 +23,7 @@ Export('RTT_ROOT')
Export('rtconfig')

# prepare building environment
RTT_RTGUI = os.getenv('RTT_RTGUI')
if RTT_RTGUI:
# if GUI dir is set to other place, don't use the one in RTT_ROOT
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False, remove_components=['rtgui'])
objs += SConscript(os.path.join(RTT_RTGUI, 'SConscript'),
variant_dir='build/components/rtgui',
duplicate=0)
else:
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)

# build program
env.Program(TARGET, objs)
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)

# end building
EndBuilding(TARGET)
# do building
DoBuilding(TARGET, objs)
8 changes: 8 additions & 0 deletions software/rtthread_examples/examples/4_gui_hello/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ objs += SConscript(cwd + "/../../libraries/SConscript")
# Add RT-Thread lowlevel drivers
objs += SConscript(cwd + "/../../drivers/SConscript", variant_dir='drivers',
duplicate=0)
# Add RTGUI
if os.getenv('RTT_RTGUI'):
RTT_RTGUI = os.getenv('RTT_RTGUI')
else:
RTT_RTGUI = os.path.abspath(os.path.join(cwd, '..', '..', 'rtgui'))

print 'RTT_RTGUI=', RTT_RTGUI
objs += SConscript(RTT_RTGUI + '/SConscript', duplicate = 0)

for d in list:
path = os.path.join(cwd, d)
Expand Down
7 changes: 2 additions & 5 deletions software/rtthread_examples/examples/4_gui_hello/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,5 @@ Export('rtconfig')
# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)

# build program
env.Program(TARGET, objs)

# end building
EndBuilding(TARGET)
# do building
DoBuilding(TARGET, objs)
6 changes: 3 additions & 3 deletions software/rtthread_examples/examples/4_gui_logo/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ objs += SConscript(cwd + "/../../drivers/SConscript", variant_dir='drivers',
if os.getenv('RTT_RTGUI'):
RTT_RTGUI = os.getenv('RTT_RTGUI')
else:
print 'Please set RTT_RTGUI directory.'
exit (0)
RTT_RTGUI = os.path.abspath(os.path.join(cwd, '..', '..', 'rtgui'))

objs += SConscript(RTT_RTGUI + '/SConscript', variant_dir='rtgui', duplicate = 0)
print 'RTT_RTGUI=', RTT_RTGUI
objs += SConscript(RTT_RTGUI + '/SConscript', duplicate = 0)

for d in list:
path = os.path.join(cwd, d)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ objs += SConscript(cwd + "/../../libraries/SConscript")
# Add RT-Thread lowlevel drivers
objs += SConscript(cwd + "/../../drivers/SConscript", variant_dir='drivers',
duplicate=0)
# Add RTGUI
if os.getenv('RTT_RTGUI'):
RTT_RTGUI = os.getenv('RTT_RTGUI')
else:
RTT_RTGUI = os.path.abspath(os.path.join(cwd, '..', '..', 'rtgui'))

print 'RTT_RTGUI=', RTT_RTGUI
objs += SConscript(RTT_RTGUI + '/SConscript', duplicate = 0)

for d in list:
path = os.path.join(cwd, d)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,5 @@ Export('rtconfig')
# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)

# build program
env.Program(TARGET, objs)

# end building
EndBuilding(TARGET)
# do building
DoBuilding(TARGET, objs)
8 changes: 8 additions & 0 deletions software/rtthread_examples/examples/4_gui_ttf/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ objs += SConscript(cwd + "/../../libraries/SConscript")
# Add RT-Thread lowlevel drivers
objs += SConscript(cwd + "/../../drivers/SConscript", variant_dir='drivers',
duplicate=0)
# Add RTGUI
if os.getenv('RTT_RTGUI'):
RTT_RTGUI = os.getenv('RTT_RTGUI')
else:
RTT_RTGUI = os.path.abspath(os.path.join(cwd, '..', '..', 'rtgui'))

print 'RTT_RTGUI=', RTT_RTGUI
objs += SConscript(RTT_RTGUI + '/SConscript', duplicate = 0)

for d in list:
path = os.path.join(cwd, d)
Expand Down
7 changes: 2 additions & 5 deletions software/rtthread_examples/examples/4_gui_ttf/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,5 @@ Export('rtconfig')
# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)

# build program
env.Program(TARGET, objs)

# end building
EndBuilding(TARGET)
# do building
DoBuilding(TARGET, objs)

0 comments on commit 0a6dd3c

Please sign in to comment.