while dealing with fasm code in kolibri I'm always facing include directives like these.
I'm also tired of duplicate files like skin.inc (170 of them in svn) and once duplicate but now different files like proc32.inc (12 total, 6 different). Five years ago we had a similar issue
with mem.inc and dll.inc files.
Fortunately, recent versions of fasm (including the one on autobuild server) can look for include files into directories specified in an environment variable.
fasm manual писал(а):
The file is first
searched for in the directory containing file which included it and when it is
not found there, the search is continued in the directories specified in the
environment variable called INCLUDE (the multiple paths separated with
semicolons can be defined there, they will be searched in the same order as
- You can use standard includes without duplicate files and without ../../../../ paths;
- You can still copy standard includes into a program's dir if you checked out that single dir, and you don't have to edit include paths in source. I.e. you want to build inside kolibri to use debug info;
- Thus no duplicates and ../../../../ paths;
- As a bonus, it's possible to define lang variable inside use_fasm.lua via -d fasm option, then no 'echo lang fix en > lang.inc' is needed.
- Those who don't use tup will have to set environment variables manually;
- If we switch to fasm's -d option to specify language, non-tup users will have to type -dlang=en/ru manually.
I attached a patch that adds use_fasm.lua file to /programs directory and updates /system/launch/Tupfile.lua as an example.
I tested the patch on linux. If you like my idea and have windows, please, try it there (build launch app).