<s> """<STR_LIT>""" <EOL> from os . path import join <EOL> from SCons . Script import ( COMMAND_LINE_TARGETS , AlwaysBuild , Builder , Default , <EOL> DefaultEnvironment ) <EOL> def BeforeUpload ( target , source , env ) : <EOL> if "<STR_LIT>" in COMMAND_LINE_TARGETS : <EOL> return <EOL> env . AutodetectUploadPort ( ) <EOL> env . Prepend ( UPLOADERFLAGS = [ '<STR_LIT>' ] ) <EOL> if env . get ( "<STR_LIT>" , { } ) . get ( "<STR_LIT>" , { } ) . get ( <EOL> "<STR_LIT>" , False ) : <EOL> env . TouchSerialPort ( "<STR_LIT>" , <NUM_LIT> ) <EOL> env = DefaultEnvironment ( ) <EOL> env . Replace ( <EOL> AR = "<STR_LIT>" , <EOL> AS = "<STR_LIT>" , <EOL> CC = "<STR_LIT>" , <EOL> CXX = "<STR_LIT>" , <EOL> OBJCOPY = "<STR_LIT>" , <EOL> RANLIB = "<STR_LIT>" , <EOL> SIZETOOL = "<STR_LIT>" , <EOL> ARFLAGS = [ "<STR_LIT>" ] , <EOL> ASFLAGS = [ "<STR_LIT>" , "<STR_LIT>" ] , <EOL> CCFLAGS = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] , <EOL> CXXFLAGS = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] , <EOL> CPPDEFINES = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" % ( <EOL> int ( env . subst ( "<STR_LIT>" ) . replace ( <EOL> "<STR_LIT:L>" , "<STR_LIT>" ) ) / <NUM_LIT> ) , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] , <EOL> LINKFLAGS = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] , <EOL> LIBS = [ "<STR_LIT:c>" , "<STR_LIT:m>" , "<STR_LIT>" ] , <EOL> SIZEPRINTCMD = '<STR_LIT>' , <EOL> UPLOADER = join ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) , <EOL> DFUUTIL = join ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) , <EOL> UPLOADCMD = '<STR_LIT>' , <EOL> PROGNAME = "<STR_LIT>" , <EOL> PROGSUFFIX = "<STR_LIT>" <EOL> ) <EOL> env . Append ( <EOL> ASFLAGS = env . get ( "<STR_LIT>" , [ ] ) [ : ] , <EOL> BUILDERS = dict ( <EOL> ElfToBin = Builder ( <EOL> action = "<STR_LIT:U+0020>" . join ( [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" ] ) , <EOL> suffix = "<STR_LIT>" <EOL> ) , <EOL> ElfToHex = Builder ( <EOL> action = "<STR_LIT:U+0020>" . join ( [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" ] ) , <EOL> suffix = "<STR_LIT>" <EOL> ) <EOL> ) <EOL> ) <EOL> target_elf = env . BuildProgram ( ) <EOL> if "<STR_LIT>" in COMMAND_LINE_TARGETS : <EOL> target_firm = join ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> else : <EOL> target_firm = env . ElfToBin ( join ( "<STR_LIT>" , "<STR_LIT>" ) , target_elf ) <EOL> target_size = env . Alias ( "<STR_LIT:size>" , target_elf , "<STR_LIT>" ) <EOL> AlwaysBuild ( target_size ) <EOL> upload = env . Alias ( <EOL> [ "<STR_LIT>" , "<STR_LIT>" ] , target_firm , [ BeforeUpload , "<STR_LIT>" ] ) <EOL> AlwaysBuild ( upload ) <EOL> Default ( [ target_firm , target_size ] ) </s>
