From 3befb301cfd16b347b629390f38f6068b52ef1ae Mon Sep 17 00:00:00 2001 From: Ivan Baravy Date: Tue, 5 Dec 2017 07:29:50 +0000 Subject: [PATCH] Add use_fasm.lua and example: launch. Now one can avoid ../../../../ includes and lang.inc files. git-svn-id: svn://kolibrios.org@7127 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/system/launch/trunk/Tupfile.lua | 6 +++++- programs/system/launch/trunk/launch.asm | 8 ++++---- programs/use_fasm.lua | 16 ++++++++++++++++ 3 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 programs/use_fasm.lua diff --git a/programs/system/launch/trunk/Tupfile.lua b/programs/system/launch/trunk/Tupfile.lua index ff561b0899..3574746d3b 100644 --- a/programs/system/launch/trunk/Tupfile.lua +++ b/programs/system/launch/trunk/Tupfile.lua @@ -1,2 +1,6 @@ if tup.getconfig("NO_FASM") ~= "" then return end -tup.rule("launch.asm", "fasm %f %o -dlang=" .. tup.getconfig("LANG") .. tup.getconfig("KPACK_CMD"), "launch") +HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR") +tup.include(HELPERDIR .. "/use_fasm.lua") + +add_include(HELPERDIR .. "/develop/libraries/libs-dev/libio") +tup.rule("launch.asm", FASM .. " -dlang=" .. tup.getconfig("LANG") .. " %f %o" .. tup.getconfig("KPACK_CMD"), "launch") diff --git a/programs/system/launch/trunk/launch.asm b/programs/system/launch/trunk/launch.asm index c2f1c2de1f..960f8917c4 100755 --- a/programs/system/launch/trunk/launch.asm +++ b/programs/system/launch/trunk/launch.asm @@ -43,10 +43,10 @@ define DEBUG_MAX_LEN 8 define DEBUG_DEFAULT 0 define BUFF_SIZE 1024 -include '../../../proc32.inc' -include '../../../macros.inc' -include '../../../develop/libraries/libs-dev/libio/libio.inc' -include '../../../dll.inc' +include 'proc32.inc' +include 'macros.inc' +include 'libio.inc' +include 'dll.inc' purge mov diff --git a/programs/use_fasm.lua b/programs/use_fasm.lua new file mode 100644 index 0000000000..a008bd7546 --- /dev/null +++ b/programs/use_fasm.lua @@ -0,0 +1,16 @@ +INCLUDES = "" +FASM_DEFAULT = "fasm" + +function add_include(dir) + if INCLUDES == "" + then INCLUDES = dir + else INCLUDES = INCLUDES .. ";" .. dir + end + if tup.getconfig("TUP_PLATFORM") == "win32" + then env_prefix = "set INCLUDE='$(INCLUDES)'&&" + else env_prefix = "INCLUDE='$(INCLUDES)' " + end + FASM = env_prefix .. FASM_DEFAULT +end + +add_include(tup.getcwd())