1
0
mirror of https://github.com/elua/elua.git synced 2025-01-25 01:02:54 +08:00
elua/rfs_server.py
Bogdan Marinescu e7702bb0e2 Manual merge of remotefs/ into trunk. Tested with the simulator and (partially) on a ET-STM32 board. Other changes:
- FAT changed to support the new opendir/readdir/closedir mechanism, and to use lseek directly instead of ioctl (also fixed a bug in FAT's lseek that always returned 0 instead of file position).
- ET-STM32 console moved to UART2@19200bps (to allow RFS to run on UART0). If UART0 is needee for console, remember to disable RFS.
- freed 700+ bytes of RAM by changing the devman implementation to keep pointers instead of actual DM_DEVICE structures
- other minor code changes and fixes
2010-02-01 18:47:41 +00:00

47 lines
1.3 KiB
Python

import os, sys, platform
sim = ARGUMENTS.get( 'sim', '0' )
flist = ""
cdefs = ""
if sim == '0':
mainname = "main.c"
else:
mainname = 'main_sim.c'
if platform.system() == "Windows":
if sim == '1':
print "SIM target not supported under Windows"
os.exit( 1 )
flist = "main.c server.c client.c os_io_win32.c log.c"
cdefs = "-DWIN32_BUILD"
exeprefix = "exe"
else:
flist = "%s server.c client.c os_io_posix.c log.c" % mainname
exeprefix = "elf"
if sim == '0':
output = 'rfs_server.%s' % exeprefix
else:
output = 'rfs_sim_server.%s' % exeprefix
#endif
full_files = " " + " ".join( [ "rfs_server/%s" % name for name in flist.split() ] )
full_files = full_files + " src/remotefs/remotefs.c"
if platform.system() == "Windows":
full_files = full_files + " rfs_server/serial_win32.c"
else:
full_files = full_files + " rfs_server/serial_posix.c"
local_include = "-Irfs_server -Iinc/remotefs"
# Compiler/linker options
cccom = "gcc -O0 -g %s -Wall %s -c $SOURCE -o $TARGET" % ( local_include, cdefs )
linkcom = "gcc -o $TARGET $SOURCES"
# Env for building the program
comp = Environment( CCCOM = cccom,
LINKCOM = linkcom,
ENV = os.environ )
Decider( 'MD5' )
Default( comp.Program( output, Split( full_files ) ) )