Autobuild: use (only?) double dots operator to interpolate strings

git-svn-id: svn://kolibrios.org@8723 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Ivan Baravy 2021-05-22 18:02:57 +00:00
parent 4b058cc36e
commit 64e1e52eba
5 changed files with 18 additions and 17 deletions

View File

@ -6,7 +6,7 @@ tup.include(HELPERDIR .. "/use_newlib.lua")
SDK_DIR = "../../../sdk" SDK_DIR = "../../../sdk"
CFLAGS = CFLAGS .. " -std=c99 -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32" CFLAGS = CFLAGS .. " -std=c99 -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32"
INCLUDES = INCLUDES .. " -I . -I $(SDK_DIR)/sources/freetype/include -I $(SDK_DIR)/sources/libjpeg -I $(SDK_DIR)/sources/zlib -I $(SDK_DIR)/sources/libopenjpeg -I $(SDK_DIR)/sources/libjbig2dec" INCLUDES = INCLUDES .. " -I . -I " .. SDK_DIR .. "/sources/freetype/include -I " .. SDK_DIR .. "/sources/libjpeg -I " .. SDK_DIR .. "/sources/zlib -I " .. SDK_DIR .. "/sources/libopenjpeg -I " .. SDK_DIR .. "/sources/libjbig2dec"
compile_gcc{"base_error.c", "base_geometry.c", "base_getopt.c", "base_hash.c", "base_memory.c", "base_object.c", "base_string.c", "base_time.c", "crypt_aes.c", "crypt_arc4.c", "crypt_md5.c", "crypt_sha2.c", "dev_bbox.c", "dev_list.c", "dev_null.c", "dev_text.c", "dev_trace.c", "filt_basic.c", "filt_dctd.c", "filt_faxd.c", "filt_flate.c", "filt_jbig2d.c", "filt_jpxd.c", "filt_lzwd.c", "filt_predict.c", "lrintf.c", "obj_print.c", "res_bitmap.c", "res_colorspace.c", "res_font.c", "res_halftone.c", "res_path.c", "res_pixmap.c", "res_shade.c", "res_text.c", "stm_buffer.c", "stm_open.c", "stm_read.c", "strtoll.c", "strtoull.c"} compile_gcc{"base_error.c", "base_geometry.c", "base_getopt.c", "base_hash.c", "base_memory.c", "base_object.c", "base_string.c", "base_time.c", "crypt_aes.c", "crypt_arc4.c", "crypt_md5.c", "crypt_sha2.c", "dev_bbox.c", "dev_list.c", "dev_null.c", "dev_text.c", "dev_trace.c", "filt_basic.c", "filt_dctd.c", "filt_faxd.c", "filt_flate.c", "filt_jbig2d.c", "filt_jpxd.c", "filt_lzwd.c", "filt_predict.c", "lrintf.c", "obj_print.c", "res_bitmap.c", "res_colorspace.c", "res_font.c", "res_halftone.c", "res_path.c", "res_pixmap.c", "res_shade.c", "res_text.c", "stm_buffer.c", "stm_open.c", "stm_read.c", "strtoll.c", "strtoull.c"}
tup.rule(OBJS, "kos32-ar rcs %o %f", {"../lib/libfitz.a", "<../lib/libfitz>"}) tup.rule(OBJS, "kos32-ar rcs %o %f", {"../lib/libfitz.a", "<../lib/libfitz>"})

View File

@ -6,7 +6,7 @@ tup.include(HELPERDIR .. "/use_newlib.lua")
SDK_DIR = "../../../sdk" SDK_DIR = "../../../sdk"
CFLAGS = CFLAGS .. " -std=c99" CFLAGS = CFLAGS .. " -std=c99"
INCLUDES = INCLUDES .. " -I . -I ../fitz -I $(SDK_DIR)/sources/freetype/include" INCLUDES = INCLUDES .. " -I . -I ../fitz -I " .. SDK_DIR .. "/sources/freetype/include"
compile_gcc{"pdf_annot.c", "pdf_cmap.c", "pdf_cmap_load.c", "pdf_cmap_parse.c", "pdf_cmap_table.c", "pdf_colorspace.c", "pdf_crypt.c", "pdf_encoding.c", "pdf_font.c", "pdf_fontfile.c", "pdf_function.c", "pdf_image.c", "pdf_interpret.c", "pdf_lex.c", "pdf_metrics.c", "pdf_nametree.c", "pdf_outline.c", "pdf_page.c", "pdf_parse.c", "pdf_pattern.c", "pdf_repair.c", "pdf_shade.c", "pdf_store.c", "pdf_stream.c", "pdf_type3.c", "pdf_unicode.c", "pdf_xobject.c", "pdf_xref.c", "snprintf.c"} compile_gcc{"pdf_annot.c", "pdf_cmap.c", "pdf_cmap_load.c", "pdf_cmap_parse.c", "pdf_cmap_table.c", "pdf_colorspace.c", "pdf_crypt.c", "pdf_encoding.c", "pdf_font.c", "pdf_fontfile.c", "pdf_function.c", "pdf_image.c", "pdf_interpret.c", "pdf_lex.c", "pdf_metrics.c", "pdf_nametree.c", "pdf_outline.c", "pdf_page.c", "pdf_parse.c", "pdf_pattern.c", "pdf_repair.c", "pdf_shade.c", "pdf_store.c", "pdf_stream.c", "pdf_type3.c", "pdf_unicode.c", "pdf_xobject.c", "pdf_xref.c", "snprintf.c"}
tup.rule(OBJS, "kos32-ar rcs %o %f", {"../lib/libmupdf.a", "<../lib/libmupdf>"}) tup.rule(OBJS, "kos32-ar rcs %o %f", {"../lib/libmupdf.a", "<../lib/libmupdf>"})

View File

@ -7,11 +7,11 @@ tup.include(HELPERDIR .. "/use_sdl_newlib.lua")
SDK_DIR = "../../sdk" SDK_DIR = "../../sdk"
CFLAGS = CFLAGS .. " -Dstricmp=strcasecmp -DZLIB_SUPPORT -Dstrnicmp=strncasecmp -DUSE_SDL -DNDEBUG -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32" CFLAGS = CFLAGS .. " -Dstricmp=strcasecmp -DZLIB_SUPPORT -Dstrnicmp=strncasecmp -DUSE_SDL -DNDEBUG -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32"
INCLUDES = INCLUDES .. " -I. -I $(SDK_DIR)/sources/zlib" INCLUDES = INCLUDES .. " -I. -I " .. SDK_DIR .. "/sources/zlib"
LDFLAGS = LDFLAGS .. " -Lsdl --subsystem native" LDFLAGS = LDFLAGS .. " -Lsdl --subsystem native"
LIBS = "-ls -lz " .. LIBS LIBS = "-ls -lz " .. LIBS
table.insert(LIBDEPS, "$(SDK_DIR)/lib/<libz>") table.insert(LIBDEPS, SDK_DIR .. "/lib/<libz>")
table.insert(LIBDEPS, "sdl/<libs>") table.insert(LIBDEPS, "sdl/<libs>")
compile_gcc{"filter.c", "fireworks.c", "main.c", "menu.c", "stub.c"} compile_gcc{"filter.c", "fireworks.c", "main.c", "menu.c", "stub.c"}

View File

@ -1,10 +1,10 @@
if tup.getconfig("NO_GCC") ~= "" or tup.getconfig("NO_FASM") ~= "" then return end if tup.getconfig("NO_GCC") ~= "" or tup.getconfig("NO_FASM") ~= "" then return end
tup.include("../../../../../programs/use_gcc.lua") tup.include("../../../../../programs/use_gcc.lua")
SDK_DIR = "../../.."
CFLAGS = "-c -O2 -fno-builtin -fno-ident -fomit-frame-pointer -DMISSING_SYSCALL_NAMES" CFLAGS = "-c -O2 -fno-builtin -fno-ident -fomit-frame-pointer -DMISSING_SYSCALL_NAMES"
LDFLAGS = "-shared -s -T libcdll.lds --out-implib $(SDK_DIR)/lib/libc.dll.a --image-base 0" LDFLAGS = "-shared -s -T libcdll.lds --out-implib " .. SDK_DIR .. "/lib/libc.dll.a --image-base 0"
-- LDFLAGS = LDFLAGS .. " --output-def libc.orig.def" -- LDFLAGS = LDFLAGS .. " --output-def libc.orig.def"
SDK_DIR = "../../.."
LIBC_TOPDIR = "." LIBC_TOPDIR = "."
LIBC_INCLUDES = "include" LIBC_INCLUDES = "include"
@ -20,7 +20,7 @@ if TOOLCHAIN_LIBPATH == "" then
else TOOLCHAIN_LIBPATH="/home/autobuild/tools/win32/mingw32/lib" else TOOLCHAIN_LIBPATH="/home/autobuild/tools/win32/mingw32/lib"
end end
end end
LIBPATH = "-L$(SDK_DIR)/lib" LIBPATH = "-L" .. SDK_DIR .. "/lib"
STATIC_SRCS = {"crt/start.S", "crt/crt2.c", "crt/exit.S"} STATIC_SRCS = {"crt/start.S", "crt/crt2.c", "crt/exit.S"}
LIBDLL_SRCS = {"crt/dllstart.c", "crt/exit.S", "crt/pseudo-reloc.c", "crt/setjmp.S"} LIBDLL_SRCS = {"crt/dllstart.c", "crt/exit.S", "crt/pseudo-reloc.c", "crt/setjmp.S"}
LIBCDLL_SRCS = { LIBCDLL_SRCS = {
@ -515,7 +515,7 @@ function compile(list)
if ALL_OBJS[v] then if ALL_OBJS[v] then
-- already compiled -- already compiled
elseif v:sub(-2) == ".c" or v:sub(-2) == ".S" then elseif v:sub(-2) == ".c" or v:sub(-2) == ".S" then
ALL_OBJS[v] = tup.rule(v, "kos32-gcc $(CFLAGS) $(DEFINES) $(INCLUDES) -o %o %f", v:sub(1, -3) .. ".o") ALL_OBJS[v] = tup.rule(v, "kos32-gcc ".. CFLAGS .. " " .. DEFINES .. " " .. INCLUDES .. " -o %o %f", v:sub(1, -3) .. ".o")
elseif v:sub(-4) == ".asm" then elseif v:sub(-4) == ".asm" then
ALL_OBJS[v] = tup.rule(v, "fasm %f %o", v:sub(1, -5) .. ".obj") ALL_OBJS[v] = tup.rule(v, "fasm %f %o", v:sub(1, -5) .. ".obj")
end end
@ -525,10 +525,10 @@ function compile(list)
end end
LIB_OBJS = compile(LIB_SRCS) LIB_OBJS = compile(LIB_SRCS)
LIB_OBJS += tup.rule("crt/crtdll.c", "kos32-gcc $(CFLAGS) $(DEFINES) $(INCLUDES) -fno-delete-null-pointer-checks -c %f -o %o","crt/crtdll.o") LIB_OBJS += tup.rule("crt/crtdll.c", "kos32-gcc " .. CFLAGS .. " " .. DEFINES .. " " .. INCLUDES .. " -fno-delete-null-pointer-checks -c %f -o %o","crt/crtdll.o")
LIB_OBJS += tup.rule("pe/loader.c", "kos32-gcc $(CFLAGS) $(DEFINES) $(INCLUDES) -fno-delete-null-pointer-checks -c %f -o %o", "pe/loader.o") LIB_OBJS += tup.rule("pe/loader.c", "kos32-gcc " .. CFLAGS .. " " .. DEFINES .. " " .. INCLUDES .. " -fno-delete-null-pointer-checks -c %f -o %o", "pe/loader.o")
LIB_OBJS += tup.rule("reent/renamer.c", "kos32-gcc $(CFLAGS) $(DEFINES) $(INCLUDES) -D_COMPILING_NEWLIB -c %f -o %o", "reent/renamer.o") LIB_OBJS += tup.rule("reent/renamer.c", "kos32-gcc " .. CFLAGS .. " " .. DEFINES .. " " .. INCLUDES .. " -D_COMPILING_NEWLIB -c %f -o %o", "reent/renamer.o")
LIB_OBJS += tup.rule("time/strftime.c", "kos32-gcc $(CFLAGS) $(DEFINES) -DMAKE_WCSFTIME $(INCLUDES) -c %f -o %o", "time/wcsftime.o") LIB_OBJS += tup.rule("time/strftime.c", "kos32-gcc " .. CFLAGS .. " " .. DEFINES .. " -DMAKE_WCSFTIME " .. INCLUDES .. " -c %f -o %o", "time/wcsftime.o")
LIBDLL_OBJS = compile(LIBDLL_SRCS) LIBDLL_OBJS = compile(LIBDLL_SRCS)
@ -541,7 +541,7 @@ vfprintf_extra_objs = {
{"-DINTEGER_ONLY -DSTRING_ONLY", "stdio/svfiprintf.o"}, {"-DINTEGER_ONLY -DSTRING_ONLY", "stdio/svfiprintf.o"},
} }
for i,v in ipairs(vfprintf_extra_objs) do for i,v in ipairs(vfprintf_extra_objs) do
LIB_OBJS += tup.rule("stdio/vfprintf.c", "kos32-gcc $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums " .. v[1] .. " -c %f -o %o", v[2]) LIB_OBJS += tup.rule("stdio/vfprintf.c", "kos32-gcc " .. CFLAGS .. " " .. DEFINES .. " " .. INCLUDES .. " -fshort-enums " .. v[1] .. " -c %f -o %o", v[2])
end end
vfwprintf_extra_objs = { vfwprintf_extra_objs = {
@ -551,7 +551,7 @@ vfwprintf_extra_objs = {
{"-DINTEGER_ONLY -DSTRING_ONLY", "stdio/svfiwprintf.o"}, {"-DINTEGER_ONLY -DSTRING_ONLY", "stdio/svfiwprintf.o"},
} }
for i,v in ipairs(vfwprintf_extra_objs) do for i,v in ipairs(vfwprintf_extra_objs) do
LIB_OBJS += tup.rule("stdio/vfwprintf.c", "kos32-gcc $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums " .. v[1] .. " -c %f -o %o", v[2]) LIB_OBJS += tup.rule("stdio/vfwprintf.c", "kos32-gcc " .. CFLAGS .. " " .. DEFINES .. " " .. INCLUDES .. " -fshort-enums " .. v[1] .. " -c %f -o %o", v[2])
end end
@ -562,7 +562,7 @@ vfscanf_extra_objs = {
{"-DINTEGER_ONLY -DSTRING_ONLY", "stdio/svfiscanf.o"}, {"-DINTEGER_ONLY -DSTRING_ONLY", "stdio/svfiscanf.o"},
} }
for i,v in ipairs(vfscanf_extra_objs) do for i,v in ipairs(vfscanf_extra_objs) do
LIB_OBJS += tup.rule("stdio/vfscanf.c", "kos32-gcc $(CFLAGS) $(DEFINES) $(INCLUDES) " .. v[1] .. " -c %f -o %o", v[2]) LIB_OBJS += tup.rule("stdio/vfscanf.c", "kos32-gcc " .. CFLAGS .. " " .. DEFINES .. " " .. INCLUDES .. " " .. v[1] .. " -c %f -o %o", v[2])
end end
vfwscanf_extra_objs = { vfwscanf_extra_objs = {
@ -571,7 +571,7 @@ vfwscanf_extra_objs = {
{"-DINTEGER_ONLY -DSTRING_ONLY", "stdio/svfiwscanf.o"}, {"-DINTEGER_ONLY -DSTRING_ONLY", "stdio/svfiwscanf.o"},
} }
for i,v in ipairs(vfwscanf_extra_objs) do for i,v in ipairs(vfwscanf_extra_objs) do
LIB_OBJS += tup.rule("stdio/vfwscanf.c", "kos32-gcc $(CFLAGS) $(DEFINES) $(INCLUDES) " .. v[1] .. " -c %f -o %o", v[2]) LIB_OBJS += tup.rule("stdio/vfwscanf.c", "kos32-gcc " .. CFLAGS .. " " .. DEFINES .. " " .. INCLUDES .. " " .. v[1] .. " -c %f -o %o", v[2])
end end

View File

@ -8,7 +8,8 @@ function add_include(dir)
end end
if tup.getconfig("TUP_PLATFORM") == "win32" if tup.getconfig("TUP_PLATFORM") == "win32"
then env_prefix = "set INCLUDE=$(INCLUDES)&&" then env_prefix = "set INCLUDE=$(INCLUDES)&&"
else env_prefix = "INCLUDE='$(INCLUDES)' " -- else env_prefix = "INCLUDE='$(INCLUDES)' "
else env_prefix = "INCLUDE='" .. INCLUDES .. "' "
end end
FASM = env_prefix .. FASM_DEFAULT FASM = env_prefix .. FASM_DEFAULT
end end