def build(ctx): """Compile Felix.""" # configure the phases phases, iscr = configure(ctx) # -------------------------------------------------------------------------- # Compile the compiler. compilers = call('buildsystem.flx_compiler.build_flx_drivers', ctx, phases.host) # -------------------------------------------------------------------------- # Compile the runtime dependencies. call('buildsystem.judy.build_runtime', phases.host, phases.target) call('buildsystem.re2.build_runtime', phases.target) # -------------------------------------------------------------------------- # Build the standard library. # copy files into the library buildsystem.copy_dir_to( ctx, ctx.buildroot / 'share', 'src/lib', pattern='*.{flx,flxh,fsyn,fdoc,files,html,sql,css,js,py,png}') for module in ('flx_stdlib', ): call('buildsystem.' + module + '.build_flx', phases.target) # -------------------------------------------------------------------------- # Compile the runtime drivers. drivers = call('buildsystem.flx_drivers.build', phases.host, phases.target) # -------------------------------------------------------------------------- # Compile the builder. flx_builder = call('buildsystem.flx.build', ctx, compilers.flxg, phases.target.cxx.static, drivers) flx_pkgconfig = call('buildsystem.flx.build_flx_pkgconfig', phases.host, phases.target, flx_builder) flx = call('buildsystem.flx.build_flx', phases.host, phases.target, flx_builder) # -------------------------------------------------------------------------- # now, try building a file felix = call('fbuild.builders.felix.Felix', ctx, exe=ctx.buildroot / 'host/bin/bootflx', debug=ctx.options.debug, flags=['--test=' + ctx.buildroot]) call('buildsystem.plugins.build', phases.target, felix) return phases, iscr, felix
def build(ctx): """Compile Felix.""" # configure the phases phases, iscr = configure(ctx) # -------------------------------------------------------------------------- # Compile the compiler. compilers = call('buildsystem.flx_compiler.build_flx_drivers', ctx, phases.host) # -------------------------------------------------------------------------- # Compile the runtime dependencies. call('buildsystem.judy.build_runtime', phases.host, phases.target) call('buildsystem.re2.build_runtime', phases.target) # -------------------------------------------------------------------------- # Build the standard library. # copy files into the library buildsystem.copy_dir_to(ctx, ctx.buildroot/'share', 'src/lib', pattern='*.{flx,flxh,fdoc,files,html,sql,css,js,py,png}') for module in ( 'flx_stdlib',): call('buildsystem.' + module + '.build_flx', phases.target) # -------------------------------------------------------------------------- # Compile the runtime drivers. drivers = call('buildsystem.flx_drivers.build', phases.host, phases.target) # -------------------------------------------------------------------------- # Compile the builder. flx_builder = call('buildsystem.flx.build', ctx, compilers.flxg, phases.target.cxx.static, drivers) flx_pkgconfig = call('buildsystem.flx.build_flx_pkgconfig', phases.host, phases.target, flx_builder) flx = call('buildsystem.flx.build_flx', phases.host, phases.target, flx_builder) # -------------------------------------------------------------------------- # now, try building a file felix = call('fbuild.builders.felix.Felix', ctx, exe=ctx.buildroot / 'host/bin/bootflx', debug=ctx.options.debug, flags=['--test=' + ctx.buildroot]) call('buildsystem.plugins.build', phases.target, felix) return phases, iscr, felix
def doc(ctx): """Build the Felix documentation.""" phases, iscr, felix = build(ctx) # copy documentation into target ctx.logger.log('building documentation', color='cyan') # copy website index buildsystem.copy_to(ctx, ctx.buildroot, Path('src/*.html').glob()) # copy website buildsystem.copy_dir_to(ctx, ctx.buildroot, Path('src')/'web')
def doc(ctx): """Build the Felix documentation.""" phases, iscr, felix = build(ctx) # copy documentation into target ctx.logger.log('building documentation', color='cyan') # copy website index buildsystem.copy_to(ctx, ctx.buildroot, Path('src/*.html').glob()) # copy website buildsystem.copy_dir_to(ctx, ctx.buildroot, Path('src')/'web') # copy the entire src directory so the user can browse it not actually used # in the build process buildsystem.copy_dir_to(ctx, ctx.buildroot, 'src', pattern='*.{ml,mli,c,cc,cpp,h,hpp,flx,flxh}') # copy the entire test directory so the user can browse it buildsystem.copy_dir_to(ctx, ctx.buildroot, 'test', pattern='*.{flx,expect}') # copy the entire tut examples directory so the user can browse it buildsystem.copy_dir_to(ctx, ctx.buildroot, 'tut', pattern='*.{flx,expect}') # copy docs buildsystem.copy_to(ctx, ctx.buildroot / 'doc', Path('src/doc/*.fdoc').glob())
def build(ctx): """Compile Felix.""" # configure the phases phases, iscr = configure(ctx) # -------------------------------------------------------------------------- # Compile the compiler. compilers = call('buildsystem.flx_compiler.build_flx_drivers', ctx, phases.host) # -------------------------------------------------------------------------- # Compile the runtime dependencies. call('buildsystem.judy.build_runtime', phases.host, phases.target) call('buildsystem.tre.build_runtime', phases.target) call('buildsystem.re2.build_runtime', phases.target) call('buildsystem.flx_glob.build_runtime', phases.host, phases.target) # -------------------------------------------------------------------------- # Build the standard library. # copy files into the library buildsystem.copy_dir_to(ctx, ctx.buildroot, 'src/lib', pattern='*.{flx,flxh,files}') # copy tools buildsystem.copy_dir_to(ctx, ctx.buildroot, 'src/tools', pattern='*.flx{,h}') for module in ( 'sqlite3', 'flx_stdlib', 'flx_pthread', 'demux', 'faio', 'judy', 'bindings'): call('buildsystem.' + module + '.build_flx', phases.target) # -------------------------------------------------------------------------- # Compile the runtime drivers. drivers = call('buildsystem.flx_drivers.build', phases.host, phases.target) # -------------------------------------------------------------------------- # Compile the builder. flx_builder = call('buildsystem.flx.build', ctx, compilers.flxg, phases.target.cxx.static, drivers) flx_pkgconfig = call('buildsystem.flx.build_flx_pkgconfig', phases.host, phases.target, flx_builder) flx = call('buildsystem.flx.build_flx', phases.host, phases.target, flx_builder) # -------------------------------------------------------------------------- # now, try building a file felix = call('fbuild.builders.felix.Felix', ctx, exe=ctx.buildroot / 'bin/flx', debug=ctx.options.debug, flags=['--test=' + ctx.buildroot]) # -------------------------------------------------------------------------- # build support tools # # C tools # mk_daemon = call('buildsystem.mk_daemon.build', phases.target) timeout = call('buildsystem.timeout.build', phases.target) # -------------------------------------------------------------------------- # build support tools # # Felix tools # call('buildsystem.tools.build', phases.target, felix) return phases, iscr, felix
def configure(ctx): """Configure Felix.""" build = config_build(ctx) host = config_host(ctx, build) target = config_target(ctx, host) # Make sure the config directories exist. (ctx.buildroot / 'config/build').makedirs() (ctx.buildroot / 'config/host').makedirs() (ctx.buildroot / 'config/target').makedirs() # copy the config directory for initial config # this will be overwritten by subsequent steps if # necessary # buildsystem.copy_dir_to(ctx, ctx.buildroot, 'src/config', pattern='*.fpc') # most of these ones are actually platform independent # just do the windows EXTERN to dllexport mapping # which is controlled by compile time switches anyhow # should probably move these out of config directory # they're put in config in case there really are any # platform mods. buildsystem.copy_to(ctx, ctx.buildroot/'config/target', Path('src/config/target/*.hpp').glob()) # this is a hack: assume we're running on Unix. # later when Erick figures out how to fix this # we'd copy the win32 subdirectory entries instead buildsystem.copy_to(ctx, ctx.buildroot / 'config', Path('src/config/unix/*.fpc').glob()) # enable this on win32 **instead** of the above to copy fpc files #buildsystem.copy_to(ctx, # ctx.buildroot / 'config', Path('src/config/win32/*.fpc').glob()) # enable this on solaris to clobber any fpc files # where the generic unix ones are inadequate #buildsystem.copy_to(ctx, # ctx.buildroot / 'config', Path('src/config/solaris/*.fpc').glob()) # enable this on osx to clobber any fpc files # where the generic unix ones are inadequate if 'macosx' in target.platform: buildsystem.copy_to(ctx, ctx.buildroot / 'config', Path('src/config/macosx/*.fpc').glob()) # extract the configuration iscr = call('buildsystem.iscr.Iscr', ctx) # convert the config into something iscr can use call('buildsystem.iscr.config_iscr_config', ctx, build, host, target) # re-extract packages if any of them changed ctx.scheduler.map(iscr, (src_dir(ctx)/'lpsrc/*.pak').glob()) # overwrite or add *.fpc files to the config directory call('buildsystem.post_config.copy_user_fpcs', ctx) # make Felix representation of whole build config call('buildsystem.show_build_config.build',ctx) return Record(build=build, host=host, target=target), iscr
def build(ctx): """Compile Felix.""" set_version(ctx.buildroot) print("[fbuild] RUNNING PACKAGE MANAGER") tangle_packages(Path("src") / "packages", ctx.buildroot) print("[fbuild] CONFIGURING FELIX") # configure the phases phases, iscr = configure(ctx) # -------------------------------------------------------------------------- # Compile the compiler. print("[fbuild] [ocaml] COMPILING COMPILER") compilers = call('buildsystem.flx_compiler.build_flx_drivers', ctx, phases.host) print("[fbuild] COPYING REPOSITORY from current directory ..") buildsystem.copy_dir_to(ctx, ctx.buildroot / 'share' / 'src', 'src', pattern='*') print("[fbuild] INSTALLING FELIX LIBRARIES") buildsystem.copy_dir_to(ctx, ctx.buildroot / 'share' / 'lib', ctx.buildroot / 'share' / 'src' / 'lib', pattern='*') print("[fbuild] RUNNING SYNTAX EXTRACTOR") find_grammar(ctx.buildroot) # -------------------------------------------------------------------------- # Compile the runtime dependencies. print("[fbuild] [C++] COMPILING RUN TIME LIBRARY") call('buildsystem.judy.build_runtime', phases.target) call('buildsystem.re2.build_runtime', phases.target) # -------------------------------------------------------------------------- # Build the standard library. print("[fbuild] [Felix] BUILDING STANDARD LIBRARY") # copy files into the library for module in ('flx_stdlib', ): call('buildsystem.' + module + '.build_flx', phases.target) # -------------------------------------------------------------------------- # Compile the runtime drivers. print("[fbuild] [C++] COMPILING DRIVERS") drivers = call('buildsystem.flx_drivers.build', phases.target) # -------------------------------------------------------------------------- # Compile the builder. print("[fbuild] [Felix] COMPILING TOOLS") flx_builder = call('buildsystem.flx.build', ctx, compilers.flxg, phases.target.cxx.static, drivers) flx_pkgconfig = call('buildsystem.flx.build_flx_pkgconfig', phases.target, flx_builder) flx = call('buildsystem.flx.build_flx', phases.target, flx_builder) # -------------------------------------------------------------------------- # now, try building a file print("[fbuild] [Felix] TEST BUILD") felix = call('fbuild.builders.felix.Felix', ctx, exe=ctx.buildroot / 'host/bin/bootflx', debug=ctx.options.debug, flags=['--test=' + ctx.buildroot]) print("[fbuild] [Felix] BUILDING PLUGINS") call('buildsystem.plugins.build', phases.target, felix) print("[fbuild] BUILD COMPLETE") return phases, iscr, felix
def build(ctx): """Compile Felix.""" # configure the phases phases, iscr = configure(ctx) # -------------------------------------------------------------------------- # Compile the compiler. compilers = call('buildsystem.flx_compiler.build_flx_drivers', ctx, phases.host) # -------------------------------------------------------------------------- # Compile the runtime dependencies. call('buildsystem.judy.build_runtime', phases.host, phases.target) call('buildsystem.tre.build_runtime', phases.target) call('buildsystem.re2.build_runtime', phases.target) call('buildsystem.flx_glob.build_runtime', phases.host, phases.target) call('buildsystem.sqlite3.build_runtime', phases.host, phases.target) # -------------------------------------------------------------------------- # Build the standard library. # copy files into the library buildsystem.copy_dir_to(ctx, ctx.buildroot, 'src/lib', pattern='*.{flx,flxh,files,html,sql,css,js,py,png}') # copy extra files for web #buildsystem.copy_dir_to(ctx, ctx.buildroot+'/lib/web', 'src/lib/web', # pattern='*') #buildsystem.copy_dir_to(ctx, ctx.buildroot+'/lib/db', 'src/lib/db', # pattern='*') #buildsystem.copy_dir_to(ctx, ctx.buildroot+'/lib/codec', 'src/lib/codec', # pattern='*') #buildsystem.copy_dir_to(ctx, ctx.buildroot+'/lib/web', 'src/lib/io', # pattern='*') #buildsystem.copy_dir_to(ctx, ctx.buildroot+'/lib/web', 'src/lib/collection', # pattern='*') # copy tools buildsystem.copy_dir_to(ctx, ctx.buildroot, 'src/tools', pattern='*.flx{,h}') buildsystem.copy_dir_to(ctx, ctx.buildroot, 'src/wiki', pattern='*.*') for module in ( 'flx_stdlib', 'bindings'): call('buildsystem.' + module + '.build_flx', phases.target) # -------------------------------------------------------------------------- # Compile the runtime drivers. drivers = call('buildsystem.flx_drivers.build', phases.host, phases.target) # -------------------------------------------------------------------------- # Compile the builder. flx_builder = call('buildsystem.flx.build', ctx, compilers.flxg, phases.target.cxx.static, drivers) flx_pkgconfig = call('buildsystem.flx.build_flx_pkgconfig', phases.host, phases.target, flx_builder) flx = call('buildsystem.flx.build_flx', phases.host, phases.target, flx_builder) # -------------------------------------------------------------------------- # now, try building a file felix = call('fbuild.builders.felix.Felix', ctx, exe=ctx.buildroot / 'bin/flx', debug=ctx.options.debug, flags=['--test=' + ctx.buildroot]) # -------------------------------------------------------------------------- # build support tools # # C tools # if 'windows' not in phases.target.platform: mk_daemon = call('buildsystem.mk_daemon.build', phases.target) timeout = call('buildsystem.timeout.build', phases.target) sqlite3_shell = call('buildsystem.sqlite3_shell.build', phases.target) # -------------------------------------------------------------------------- # build support tools # # Felix tools # call('buildsystem.tools.build', phases.target, felix) return phases, iscr, felix
def build(ctx): """Compile Felix.""" set_version(ctx.buildroot) print("[fbuild] RUNNING PACKAGE MANAGER") tangle_packages(Path("src")/"packages", ctx.buildroot) print("[fbuild] CONFIGURING FELIX") # configure the phases phases, iscr = configure(ctx) # -------------------------------------------------------------------------- # Compile the compiler. print("[fbuild] [ocaml] COMPILING COMPILER") compilers = call('buildsystem.flx_compiler.build_flx_drivers', ctx, phases.host) print("[fbuild] COPYING REPOSITORY from current directory ..") buildsystem.copy_dir_to(ctx, ctx.buildroot/'share'/'src', 'src', pattern='*') print("[fbuild] INSTALLING FELIX LIBRARIES") buildsystem.copy_dir_to(ctx, ctx.buildroot/'share'/'lib', ctx.buildroot/'share'/'src'/'lib', pattern='*') print("[fbuild] RUNNING SYNTAX EXTRACTOR") find_grammar(ctx.buildroot); # -------------------------------------------------------------------------- # Compile the runtime dependencies. print("[fbuild] [C++] COMPILING RUN TIME LIBRARY") call('buildsystem.judy.build_runtime', phases.target) call('buildsystem.re2.build_runtime', phases.target) # -------------------------------------------------------------------------- # Build the standard library. print("[fbuild] [Felix] BUILDING STANDARD LIBRARY") # copy files into the library for module in ( 'flx_stdlib',): call('buildsystem.' + module + '.build_flx', phases.target) # -------------------------------------------------------------------------- # Compile the runtime drivers. print("[fbuild] [C++] COMPILING DRIVERS") drivers = call('buildsystem.flx_drivers.build', phases.target) # -------------------------------------------------------------------------- # Compile the builder. print("[fbuild] [Felix] COMPILING TOOLS") flx_builder = call('buildsystem.flx.build', ctx, compilers.flxg, phases.target.cxx.static, drivers) flx_pkgconfig = call('buildsystem.flx.build_flx_pkgconfig', phases.target, flx_builder) flx = call('buildsystem.flx.build_flx', phases.target, flx_builder) # -------------------------------------------------------------------------- # now, try building a file print("[fbuild] [Felix] TEST BUILD") felix = call('fbuild.builders.felix.Felix', ctx, exe=ctx.buildroot / 'host/bin/bootflx', debug=ctx.options.debug, flags=['--test=' + ctx.buildroot]) print("[fbuild] [Felix] BUILDING PLUGINS") call('buildsystem.plugins.build', phases.target, felix) print("[fbuild] BUILD COMPLETE") return phases, iscr, felix