summaryrefslogtreecommitdiffhomepage
path: root/Rakefile
AgeCommit message (Collapse)Author
2020-12-05Make it possible that `libmruby.a` is not createdKOBAYASHI Shuji
Previously, `libmruby.a` was created even if only `mruby-bin-mrbc` or` mruby-compiler` was specified for gem, but by specifying `disable_libmruby`, the creation of `libmruby.a` can be suppressed. ### Note The https://github.com/mruby/mruby/pull/5084#issuecomment-723521971 incompatibility seems to be difficult for users to avoid, so the original behavior has been restored. Therefore, if we need `mrbc` other than the `host` build, we need to explicitly specify `mruby-bin-mrbc` gem. Due to the above changes, `build_config/boxing.rb` etc. will not work, but I have added` mruby-bin-mrbc` to `default.gembox` to fix it. I don't think this change is a big deal because originally `mruby-compiler` was included.
2020-12-02Remove `build/presym{,.inc}` by `rake clean` [ci skip]KOBAYASHI Shuji
Currently, adding gems to build configuration and rebuilding does not regenerate `presym`, which can lead to build errors. Therefore in this case we need to remove the `presym` file and then rebuild mruby, but when the` presym` file is regenerated we will need to recompile most of the files, so it seems useful to have the `presym` file deleted by `rake clean`.
2020-12-01Revert "Create presym files for each build target" (58ba883e)KOBAYASHI Shuji
Due to the above changes, it may not work with the existing build configurations in cross-compilation (even if we can build without presym), therefore revert it once (ref https://github.com/mruby/mruby/pull/5202#issuecomment-735412643). Sorry for the lack of consideration.
2020-11-27Fix build failure; ref #5194KOBAYASHI Shuji
Fix the following two issues: 1. Compile failure when external gem is specified. * https://github.com/mruby/mruby/pull/5194#issuecomment-734303442 2. When there are multiple build targets, presym parsing sometimes fails or output result of presym is broken. * https://github.com/mruby/mruby/pull/5194#issuecomment-734322142 The root cause of 2 is unknown, but it seems to occur when presym parsing is performed in parallel, therefore I change them so that they are not run in parallel.
2020-11-26Create presym files for each build targetKOBAYASHI Shuji
Previously, presym files were always created in `build/{presym,presym.inc}`. However, this constraint is inconvenient because it is common to use multiple build configurations and build targets in a single mruby tree. Therefore, change to create presym file for each build target.
2020-11-24Optimize `presym_find`KOBAYASHI Shuji
Chang to compare string length first. ### Benchmark #### Code * https://github.com/shuujii/mruby-presym_find-benchmark #### Result ```console Previous: 10.240772M i/s (25M times in 2.441222s) New: 16.412985M i/s (25M times in 1.523184s) ```
2020-11-23Fix #5177 - set MRUBY_CONFIG earlyAbinoam Praxedes Marques Junior
2020-11-22Refine build log for generated filesKOBAYASHI Shuji
* Output `GEN` log for generated files * `MRBC` log is outputted one for each `mrbc` execution #### Before this patch: ```console CC src/array.c -> build/host/src/array.o (snip) GEN mrblib/*.rb -> build/host/mrblib/mrblib.c MRBC mrblib/00class.rb MRBC mrblib/10error.rb (snip) CC mrbgems/mruby-time/src/time.c -> build/host/mrbgems/mruby-time/src/time.o MRBC mrbgems/mruby-time/mrblib/time.rb (snip) CC mrbgems/mruby-socket/test/sockettest.c -> build/host/mrbgems/mruby-socket/test/sockettest.o MRBC mrbgems/mruby-socket/test/addrinfo.rb MRBC mrbgems/mruby-socket/test/basicsocket.rb (snip) ``` #### After this patch: ```console GEN build/presym GEN build/presym.inc CC src/array.c -> build/host/src/array.o (snip) GEN mrblib/*.rb -> build/host/mrblib/mrblib.c MRBC mrblib/00class.rb mrblib/10error.rb (snip) CC mrbgems/mruby-time/src/time.c -> build/host/mrbgems/mruby-time/src/time.o GEN build/host/mrbgems/mruby-time/gem_init.c MRBC mrbgems/mruby-time/mrblib/time.rb (snip) CC mrbgems/mruby-socket/test/sockettest.c -> build/host/mrbgems/mruby-socket/test/sockettest.o GEN build/host/mrbgems/mruby-socket/gem_test.c MRBC mrbgems/mruby-socket/test/addrinfo.rb MRBC mrbgems/mruby-socket/test/basicsocket.rb (snip) ```
2020-11-22Move global function for build to `lib/mruby/core_ext.rb`KOBAYASHI Shuji
Because `_pp` is originally defined in `lib/mruby/core_ext.rb`, other global functions are moved to the file.
2020-11-21Move some `.rake` files to `tasks` directory for consistencyKOBAYASHI Shuji
2020-11-20Move `lib/mruby-core-ext.rb` to `lib/mruby/core_ext.rb` for consistencyKOBAYASHI Shuji
2020-11-17Scan all active C source files; ref 600e333Yukihiro "Matz" Matsumoto
In addition, `include/mruby.h` will be scanned for error class symbols.
2020-11-15Fix paths of gem files to be scanned for presymKOBAYASHI Shuji
When building from outside `MRUBY_ROOT` (e.g. `rake -f`), gem files were not scanned.
2020-11-14Scan source files only from `cdump` enabled gems.Yukihiro "Matz" Matsumoto
2020-11-13Change name and usage of presym macrosKOBAYASHI Shuji
To be also able to build mruby without presym in the future. However, `MRB_QSYM` has been removed and changed as follows: ### Example | Type | Symbol | Previous Style | New Style | |---------------------------|--------|------------------|----------------| | Operator | & | MRB_QSYM(and) | MRB_OPSYM(and) | | Class Variable | @@foo | MRB_QSYM(00_foo) | MRB_CVSYM(foo) | | Instance Variable | @foo | MRB_QSYM(0_foo) | MRB_IVSYM(foo) | | Method with Bang | foo! | MRB_QSYM(foo_b) | MRB_SYM_B(foo) | | Method with Question mark | foo? | MRB_QSYM(foo_p) | MRB_SYM_Q(foo) | | Mmethod with Equal | foo= | MRB_QSYM(foo_e) | MRB_SYM_E(foo) | This change makes it possible to define, for example, `MRB_IVSYM(foo)` as `mrb_intern_lit(mrb, "@" "foo")`, which is useful if we support building without presym in the future.
2020-11-03Reduce recompilation when updating presym target filesKOBAYASHI Shuji
Fix that updating presym target files would recompile almost all files even if symbols did not change.
2020-11-02Fix parallel buildKOBAYASHI Shuji
When `rake -m` and so on are used to build in parallel, building may be started before presym files are generated. Then, for example, the following error occurs and this issue is fixed. ```console In file included from /Users/shuujii/mruby/mruby/include/mruby.h:92: /mruby/mruby/include/mruby/presym.h:16:10: fatal error: '../build/presym.inc' file not found #include <../build/presym.inc> ^~~~~~~~~~~~~~~~~~~~~ ```
2020-10-29Exclude symbols from `mruby-test` gem only used for tests.Yukihiro "Matz" Matsumoto
2020-10-19Revert `MRUBY_TARGET` mechanism; ref #5096KOBAYASHI Shuji
* In explanation of mruby, the expression `build_config.rb` is frequently used including official documents, so I think that it will not make sense if the file is no longer used. * The `MRUBY_TARGET` mechanism seems to have little improvement, so I don't think it should be changed to avoid unnecessary confusion. * `MRUBY_TARGET` and `MRuby.targets` represent somewhat different things, so using the same term "target" is a bit confusing. The mechanism that can be written short when using a file under `build_config` (renamed from `target`) directory remains (`build_config/${MRUBY_CONFIG}.rb` is used if the path specified in `MRUBY_CONFIG` doesn't exist).
2020-10-14Avoid using C struct dump for test Ruby code.Yukihiro "Matz" Matsumoto
Files under `test/t` and `mrbgem/*/test` are for tests, not for actual execution. So symbols in those files need not to be pre-allocated. This change slightly reduce the memory consumption.
2020-10-12Remove `host-debug` internal target.Yukihiro "Matz" Matsumoto
Target `host-debug` to use `host` internal target with debugging configuration.
2020-10-12Remove duplicated patternKondo Uchio
2020-10-12Scan ruby files in directoriesUchio Kondo
2020-10-12Exact match to allowed method/variable namesKondo Uchio
2020-10-12Ensure exact match for symbols like foo!/foo?/foo=Uchio Kondo
e.g. symbols like "foo[]=" make invalid C codes
2020-10-12Skip C comments from scan target; close #5072Yukihiro "Matz" Matsumoto
The original PR was skipping Ruby comments as well, but caused some issues in test suites.
2020-10-12Scan source code lines from downloaded mrbgems; fix #5071Yukihiro "Matz" Matsumoto
2020-10-12Update `Rakefile`.Yukihiro "Matz" Matsumoto
So that you can omit `host` target. Now `host-debug` works.
2020-10-12Allow `MRUBY_CONFIG` to specify target file out of source tree.Yukihiro "Matz" Matsumoto
2020-10-12Generate C struct from `irep` instead of binary dump.Yukihiro "Matz" Matsumoto
2020-10-12Scan more symbols from Ruby files by `rake gensym`.Yukihiro "Matz" Matsumoto
2020-10-12Remove remaining `chomp:true` option from `Rakefile`.Yukihiro "Matz" Matsumoto
2020-10-12Avoid using `chomp:true` option to `File.readlines`.Yukihiro "Matz" Matsumoto
The option is not available in the old version of Ruby.
2020-10-12Stringify non C identifier symbols to stop macro errors by old gcc.Yukihiro "Matz" Matsumoto
2020-10-12Add `Rakefile` to `build/presym` dependency.Yukihiro "Matz" Matsumoto
2020-10-12Add dependency from `all` to `gensym`.Yukihiro "Matz" Matsumoto
You don't need to invoke `rake gensym` explicitly any longer.
2020-10-12Add operators to `presym` from `Rakefile`.Yukihiro "Matz" Matsumoto
2020-10-12Rename `MRB_OPSYM()` to `MRB_QSYM()`.Yukihiro "Matz" Matsumoto
Where `QSYM` means quoted symbols, which cannot be represented C symbols, so specify aliases instead. - operators: name of the operation, e.g. add for `+` - predicates: add `_p` suffix instead of `?` - bang methods: add `_b` suffix instead of `!` - instance variables: add `a_` prefix instead of `@` - global variables: add `d_` prefix instead of `@` - class variables: unsupported; don't use them
2020-10-12Simplified `Rakefile`.Yukihiro "Matz" Matsumoto
2020-10-12Create `MRB_OPSYM()` macro to refer symbols corresponding operators.Yukihiro "Matz" Matsumoto
For example, `MRB_OPSYM(add)` refers a symbol for `+`.
2020-10-12Create `build` directory first before `gensym`.Yukihiro "Matz" Matsumoto
2020-10-12Remove unused variable from `Rakefile`.Yukihiro "Matz" Matsumoto
2020-10-12Use `File.open` instead of `File.write` shortcut.Yukihiro "Matz" Matsumoto
2020-10-12Remove `presym` files before writing just to make sure.Yukihiro "Matz" Matsumoto
2020-10-12Build process updated:Yukihiro "Matz" Matsumoto
You have to specify `TARGET` to specify a configuration, e.g. ``` rake TARGET=host-debug all test ``` When you port `mruby` to a new configuration: 1. copy an existing configuration under `target` directory 2. modify the new configuration file 3. build using the new configuration 4. send PR if you please
2020-10-12Keep `build/presym` through `rake clean`.Yukihiro "Matz" Matsumoto
2020-10-12Prepend `gensym` rule to `depfiles`.Yukihiro "Matz" Matsumoto
2020-10-12Remove `build/presym` and `build/presym.inc` on `rake clean`.Yukihiro "Matz" Matsumoto
2020-10-12Scan `.rb` files as well to generate `presym` table.Yukihiro "Matz" Matsumoto
2020-10-12Update Rakefile to generate presym.Yukihiro "Matz" Matsumoto