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())