From 2cb5c65b2979b05280c6873fc9175713bb6798ed Mon Sep 17 00:00:00 2001 From: Nicholaus Clark Date: Sun, 5 Jan 2025 14:23:02 -0500 Subject: [PATCH] Rename gmake2 to gmake --- .github/ISSUE_TEMPLATE/report-a-bug.md | 2 +- BUILD.txt | 6 +- Bootstrap.mak | 14 +-- modules/gmake/_manifest.lua | 9 ++ modules/{gmake2 => gmake}/_preload.lua | 49 ++++++---- .../{gmake2/gmake2.lua => gmake/gmake.lua} | 82 ++++++++-------- .../gmake2_cpp.lua => gmake/gmake_cpp.lua} | 76 +++++++------- .../gmake_csharp.lua} | 98 +++++++++---------- .../gmake_makefile.lua} | 22 ++--- .../gmake_utility.lua} | 32 +++--- .../gmake_workspace.lua} | 46 ++++----- modules/gmake/tests/_tests.lua | 18 ++++ .../tests/test_gmake_buildcmds.lua} | 8 +- .../tests/test_gmake_clang.lua} | 8 +- .../tests/test_gmake_file_rules.lua} | 16 +-- .../tests/test_gmake_flags.lua} | 8 +- .../tests/test_gmake_includes.lua} | 8 +- .../tests/test_gmake_ldflags.lua} | 8 +- .../tests/test_gmake_linking.lua} | 8 +- .../tests/test_gmake_makefile.lua} | 8 +- .../tests/test_gmake_objects.lua} | 14 +-- .../tests/test_gmake_pch.lua} | 18 ++-- .../tests/test_gmake_perfile_flags.lua} | 8 +- .../tests/test_gmake_target_rules.lua} | 8 +- .../tests/test_gmake_tools.lua} | 10 +- .../tests/test_gmake_wks.lua} | 8 +- modules/gmake2/_manifest.lua | 9 -- modules/gmake2/tests/_tests.lua | 18 ---- scripts/package.lua | 2 +- src/_modules.lua | 2 +- 30 files changed, 317 insertions(+), 306 deletions(-) create mode 100644 modules/gmake/_manifest.lua rename modules/{gmake2 => gmake}/_preload.lua (55%) rename modules/{gmake2/gmake2.lua => gmake/gmake.lua} (82%) rename modules/{gmake2/gmake2_cpp.lua => gmake/gmake_cpp.lua} (91%) rename modules/{gmake2/gmake2_csharp.lua => gmake/gmake_csharp.lua} (80%) rename modules/{gmake2/gmake2_makefile.lua => gmake/gmake_makefile.lua} (87%) rename modules/{gmake2/gmake2_utility.lua => gmake/gmake_utility.lua} (94%) rename modules/{gmake2/gmake2_workspace.lua => gmake/gmake_workspace.lua} (81%) create mode 100644 modules/gmake/tests/_tests.lua rename modules/{gmake2/tests/test_gmake2_buildcmds.lua => gmake/tests/test_gmake_buildcmds.lua} (77%) rename modules/{gmake2/tests/test_gmake2_clang.lua => gmake/tests/test_gmake_clang.lua} (81%) rename modules/{gmake2/tests/test_gmake2_file_rules.lua => gmake/tests/test_gmake_file_rules.lua} (97%) rename modules/{gmake2/tests/test_gmake2_flags.lua => gmake/tests/test_gmake_flags.lua} (95%) rename modules/{gmake2/tests/test_gmake2_includes.lua => gmake/tests/test_gmake_includes.lua} (79%) rename modules/{gmake2/tests/test_gmake2_ldflags.lua => gmake/tests/test_gmake_ldflags.lua} (89%) rename modules/{gmake2/tests/test_gmake2_linking.lua => gmake/tests/test_gmake_linking.lua} (97%) rename modules/{gmake2/tests/test_gmake2_makefile.lua => gmake/tests/test_gmake_makefile.lua} (91%) rename modules/{gmake2/tests/test_gmake2_objects.lua => gmake/tests/test_gmake_objects.lua} (97%) rename modules/{gmake2/tests/test_gmake2_pch.lua => gmake/tests/test_gmake_pch.lua} (93%) rename modules/{gmake2/tests/test_gmake2_perfile_flags.lua => gmake/tests/test_gmake_perfile_flags.lua} (94%) rename modules/{gmake2/tests/test_gmake2_target_rules.lua => gmake/tests/test_gmake_target_rules.lua} (85%) rename modules/{gmake2/tests/test_gmake2_tools.lua => gmake/tests/test_gmake_tools.lua} (82%) rename modules/{gmake2/tests/test_gmake2_wks.lua => gmake/tests/test_gmake_wks.lua} (91%) delete mode 100644 modules/gmake2/_manifest.lua delete mode 100644 modules/gmake2/tests/_tests.lua diff --git a/.github/ISSUE_TEMPLATE/report-a-bug.md b/.github/ISSUE_TEMPLATE/report-a-bug.md index f6c80d3708..438611cf39 100644 --- a/.github/ISSUE_TEMPLATE/report-a-bug.md +++ b/.github/ISSUE_TEMPLATE/report-a-bug.md @@ -30,7 +30,7 @@ Please provide a [minimal, reproducible example](https://stackoverflow.com/help/ - [ ] Visual Studio 2008 (vs2008) - [ ] Visual Studio 2005 (vs2005) - [ ] GNU Makefile (gmake) -- [ ] GNU Makefile 2 (gmake2) +- [ ] GNU Makefile Legacy (gmakelegacy) - [ ] XCode (xcode) - [ ] Codelite - [ ] Other (Please list below) diff --git a/BUILD.txt b/BUILD.txt index b1a54247e0..a8f619b41a 100644 --- a/BUILD.txt +++ b/BUILD.txt @@ -18,7 +18,7 @@ BUILDING FROM A SOURCE PACKAGE officially supported toolsets in the build/ folder. Build the release configuration and you will be ready to go. For makefiles: - $ cd build/gmake2.unix + $ cd build/gmake.unix $ make config=release The binaries will be placed in the ./bin/release directory. @@ -64,7 +64,7 @@ Alternatively, you may call the Makefile directly: files for your toolset by running a command like the following in the top-level Premake directory: - $ premake5 gmake2 # for makefiles + $ premake5 gmake # for makefiles $ premake5 vs2012 # for a Visual Studio 2012 solution $ premake --help # to see a list of supported toolsets @@ -114,7 +114,7 @@ BUILDING deb BINARY PACKAGE 0. sudo apt install devscripts 1. bootstrap the premake - 2. ./bin/release/premake5 gmake2 + 2. ./bin/release/premake5 gmake 3. cp ./packages/debian ./debian 4. debuild --no-lintian --no-sign 5. the built package should appear in the parent dir. diff --git a/Bootstrap.mak b/Bootstrap.mak index 4e583700bb..4d45ea98a4 100644 --- a/Bootstrap.mak +++ b/Bootstrap.mak @@ -89,7 +89,7 @@ mingw: mingw-clean mkdir -p build/bootstrap $(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_STATICLIB -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lole32 -lversion ./build/bootstrap/premake_bootstrap embed - ./build/bootstrap/premake_bootstrap --arch=$(PLATFORM) --os=windows --to=build/bootstrap --cc=mingw $(PREMAKE_OPTS) gmake2 + ./build/bootstrap/premake_bootstrap --arch=$(PLATFORM) --os=windows --to=build/bootstrap --cc=mingw $(PREMAKE_OPTS) gmake $(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG)_$(PLATFORM:x86=win32) macosx: osx @@ -102,7 +102,7 @@ osx: osx-clean mkdir -p build/bootstrap $(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_STATICLIB -DLUA_USE_MACOSX -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" -framework CoreServices -framework Foundation -framework Security -lreadline $(SRC) ./build/bootstrap/premake_bootstrap embed - ./build/bootstrap/premake_bootstrap --arch=$(PLATFORM) --to=build/bootstrap $(PREMAKE_OPTS) gmake2 + ./build/bootstrap/premake_bootstrap --arch=$(PLATFORM) --to=build/bootstrap $(PREMAKE_OPTS) gmake $(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG) linux-clean: nix-clean @@ -111,7 +111,7 @@ linux: linux-clean mkdir -p build/bootstrap $(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_STATICLIB -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lm -ldl -lrt -luuid ./build/bootstrap/premake_bootstrap embed - ./build/bootstrap/premake_bootstrap --to=build/bootstrap $(PREMAKE_OPTS) gmake2 + ./build/bootstrap/premake_bootstrap --to=build/bootstrap $(PREMAKE_OPTS) gmake $(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG) bsd-clean: nix-clean @@ -120,7 +120,7 @@ bsd: bsd-clean mkdir -p build/bootstrap $(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_STATICLIB -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lm ./build/bootstrap/premake_bootstrap embed - ./build/bootstrap/premake_bootstrap --to=build/bootstrap $(PREMAKE_OPTS) gmake2 + ./build/bootstrap/premake_bootstrap --to=build/bootstrap $(PREMAKE_OPTS) gmake $(MAKE) -C build/bootstrap -j`getconf NPROCESSORS_ONLN` config=$(CONFIG) solaris-clean: nix-clean @@ -129,7 +129,7 @@ solaris: solaris-clean mkdir -p build/bootstrap $(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_STATICLIB -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lm ./build/bootstrap/premake_bootstrap embed - ./build/bootstrap/premake_bootstrap --to=build/bootstrap $(PREMAKE_OPTS) gmake2 + ./build/bootstrap/premake_bootstrap --to=build/bootstrap $(PREMAKE_OPTS) gmake $(MAKE) -C build/bootstrap -j`getconf NPROCESSORS_ONLN` config=$(CONFIG) haiku-clean: nix-clean @@ -138,7 +138,7 @@ haiku: haiku-clean mkdir -p build/bootstrap $(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_STATICLIB -DLUA_USE_POSIX -DLUA_USE_DLOPEN -D_BSD_SOURCE -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lbsd ./build/bootstrap/premake_bootstrap embed - ./build/bootstrap/premake_bootstrap --to=build/bootstrap $(PREMAKE_OPTS) gmake2 + ./build/bootstrap/premake_bootstrap --to=build/bootstrap $(PREMAKE_OPTS) gmake $(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG) windows-base: windows-clean @@ -160,5 +160,5 @@ cosmo: cosmo-clean mkdir -p build/bootstrap cosmocc -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_STATICLIB -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lm -ldl -lrt ./build/bootstrap/premake_bootstrap embed - ./build/bootstrap/premake_bootstrap --to=build/bootstrap --cc=cosmocc gmake2 + ./build/bootstrap/premake_bootstrap --to=build/bootstrap --cc=cosmocc gmake $(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG) diff --git a/modules/gmake/_manifest.lua b/modules/gmake/_manifest.lua new file mode 100644 index 0000000000..11adfd1fbd --- /dev/null +++ b/modules/gmake/_manifest.lua @@ -0,0 +1,9 @@ +return { + "_preload.lua", + "gmake.lua", + "gmake_cpp.lua", + "gmake_csharp.lua", + "gmake_makefile.lua", + "gmake_utility.lua", + "gmake_workspace.lua", +} diff --git a/modules/gmake2/_preload.lua b/modules/gmake/_preload.lua similarity index 55% rename from modules/gmake2/_preload.lua rename to modules/gmake/_preload.lua index 6119bf3438..c21074d21d 100644 --- a/modules/gmake2/_preload.lua +++ b/modules/gmake/_preload.lua @@ -1,11 +1,11 @@ -- --- Name: gmake2/_preload.lua --- Purpose: Define the gmake2 action. +-- Name: gmake/_preload.lua +-- Purpose: Define the gmake action. -- Author: Blizzard Entertainment (Tom van Dijck) -- Modified by: Aleksi Juvani -- Vlad Ivanov -- Created: 2016/01/01 --- Copyright: (c) 2016-2017 Jess Perkins, Blizzard Entertainment and the Premake project +-- Copyright: (c) 2016-2025 Jess Perkins, Blizzard Entertainment and the Premake project -- local p = premake @@ -23,8 +23,8 @@ end newaction { - trigger = "gmake2", - shortname = "Alternative GNU Make", + trigger = "gmake", + shortname = "GNU Make", description = "Generate GNU makefiles for POSIX, MinGW, and Cygwin", toolset = defaultToolset(), @@ -38,45 +38,56 @@ }, aliases = { - "gmake", + "gmake2" + }, + + deprecatedaliases = { + ["gmake2"] = { + ["action"] = function() + p.warnOnce("gmake2 has been renamed to gmake. Use gmake to generate makefiles instead.") + end, + ["filter"] = function() + p.warnOnce("gmake2 has been renamed to gmake. Update your filters to use gmake instead.") + end + } }, onInitialize = function() - require("gmake2") - p.modules.gmake2.cpp.initialize() + require("gmake") + p.modules.gmake.cpp.initialize() end, onWorkspace = function(wks) - p.escaper(p.modules.gmake2.esc) + p.escaper(p.modules.gmake.esc) wks.projects = table.filter(wks.projects, function(prj) return p.action.supports(prj.kind) and prj.kind ~= p.NONE end) - p.generate(wks, p.modules.gmake2.getmakefilename(wks, false), p.modules.gmake2.generate_workspace) + p.generate(wks, p.modules.gmake.getmakefilename(wks, false), p.modules.gmake.generate_workspace) end, onProject = function(prj) - p.escaper(p.modules.gmake2.esc) - local makefile = p.modules.gmake2.getmakefilename(prj, true) + p.escaper(p.modules.gmake.esc) + local makefile = p.modules.gmake.getmakefilename(prj, true) if not p.action.supports(prj.kind) or prj.kind == p.NONE then return elseif prj.kind == p.UTILITY then - p.generate(prj, makefile, p.modules.gmake2.utility.generate) + p.generate(prj, makefile, p.modules.gmake.utility.generate) elseif prj.kind == p.MAKEFILE then - p.generate(prj, makefile, p.modules.gmake2.makefile.generate) + p.generate(prj, makefile, p.modules.gmake.makefile.generate) else if project.isdotnet(prj) then - p.generate(prj, makefile, p.modules.gmake2.cs.generate) + p.generate(prj, makefile, p.modules.gmake.cs.generate) elseif project.isc(prj) or project.iscpp(prj) then - p.generate(prj, makefile, p.modules.gmake2.cpp.generate) + p.generate(prj, makefile, p.modules.gmake.cpp.generate) end end end, onCleanWorkspace = function(wks) - p.clean.file(wks, p.modules.gmake2.getmakefilename(wks, false)) + p.clean.file(wks, p.modules.gmake.getmakefilename(wks, false)) end, onCleanProject = function(prj) - p.clean.file(prj, p.modules.gmake2.getmakefilename(prj, true)) + p.clean.file(prj, p.modules.gmake.getmakefilename(prj, true)) end } @@ -85,5 +96,5 @@ -- return function(cfg) - return (_ACTION == "gmake2") + return (_ACTION == "gmake") end diff --git a/modules/gmake2/gmake2.lua b/modules/gmake/gmake.lua similarity index 82% rename from modules/gmake2/gmake2.lua rename to modules/gmake/gmake.lua index b08fc844b2..6797cab370 100644 --- a/modules/gmake2/gmake2.lua +++ b/modules/gmake/gmake.lua @@ -1,14 +1,14 @@ -- --- gmake2.lua +-- gmake.lua -- (c) 2016-2017 Jess Perkins, Blizzard Entertainment and the Premake project -- local p = premake local project = p.project - p.modules.gmake2 = {} - p.modules.gmake2._VERSION = p._VERSION - local gmake2 = p.modules.gmake2 + p.modules.gmake = {} + p.modules.gmake._VERSION = p._VERSION + local gmake = p.modules.gmake -- -- Write out the default configuration rule for a workspace or project. @@ -17,7 +17,7 @@ -- The workspace or project object for which a makefile is being generated. -- - function gmake2.defaultconfig(target) + function gmake.defaultconfig(target) -- find the right configuration iterator function for this object local eachconfig = iif(target.project, project.eachconfig, p.workspace.eachconfig) local defaultconfig = nil @@ -51,7 +51,7 @@ -- Escape a string so it can be written to a makefile. --- - function gmake2.esc(value) + function gmake.esc(value) result = value:gsub("\\", "\\\\") result = result:gsub("\"", "\\\"") result = result:gsub(" ", "\\ ") @@ -70,7 +70,7 @@ -- writes to the same location I use name + ".make" to keep it unique. -- - function gmake2.getmakefilename(this, searchprjs) + function gmake.getmakefilename(this, searchprjs) local count = 0 for wks in p.global.eachWorkspace() do if wks.location == this.location then @@ -101,13 +101,13 @@ -- The workspace or project object for which the makefile is being generated. -- - function gmake2.header(target) + function gmake.header(target) local kind = iif(target.project, "project", "workspace") _p('# %s %s makefile autogenerated by Premake', p.action.current().shortname, kind) _p('') - gmake2.defaultconfig(target) + gmake.defaultconfig(target) _p('ifndef verbose') _p(' SILENT = @') @@ -121,7 +121,7 @@ -- it screws up the escaping of spaces and parenthesis (anyone know a fix?) -- - function gmake2.mkdir(dirname) + function gmake.mkdir(dirname) _p('ifeq (posix,$(SHELLTYPE))') _p('\t$(SILENT) mkdir -p %s', dirname) _p('else') @@ -129,7 +129,7 @@ _p('endif') end - function gmake2.copyfile_cmds(source, dest) + function gmake.copyfile_cmds(source, dest) local cmd = '$(SILENT) {COPYFILE} ' .. source .. ' ' .. dest return { 'ifeq (posix,$(SHELLTYPE))', '\t' .. os.translateCommands(cmd, 'posix'), @@ -138,10 +138,10 @@ 'endif' } end - function gmake2.mkdirRules(dirname) + function gmake.mkdirRules(dirname) _p('%s:', dirname) _p('\t@echo Creating %s', dirname) - gmake2.mkdir(dirname) + gmake.mkdir(dirname) _p('') end @@ -149,7 +149,7 @@ -- Format a list of values to be safely written as part of a variable assignment. -- - function gmake2.list(value, quoted) + function gmake.list(value, quoted) quoted = false if #value > 0 then if quoted then @@ -174,13 +174,13 @@ -- Convert an arbitrary string (project name) to a make variable name. -- - function gmake2.tovar(value) + function gmake.tovar(value) value = value:gsub("[ -]", "_") value = value:gsub("[()]", "") return value end - function gmake2.getToolSet(cfg) + function gmake.getToolSet(cfg) local default = iif(cfg.system == p.MACOSX, "clang", "gcc") local toolset, version = p.tools.canonical(cfg.toolset or default) if not toolset then @@ -190,14 +190,14 @@ end - function gmake2.outputSection(prj, callback) + function gmake.outputSection(prj, callback) local root = {} for cfg in project.eachconfig(prj) do -- identify the toolset used by this configurations (would be nicer if -- this were computed and stored with the configuration up front) - local toolset = gmake2.getToolSet(cfg) + local toolset = gmake.getToolSet(cfg) local settings = {} local funcs = callback(cfg) @@ -261,13 +261,13 @@ -- --------------------------------------------------------------------------- - function gmake2.phonyRules(prj) + function gmake.phonyRules(prj) _p('.PHONY: clean prebuild') _p('') end - function gmake2.shellType() + function gmake.shellType() -- Determine whether the build rules -- of the Makefile are being executed under -- cmd.exe or sh.exe. GNU Make prefers using @@ -286,18 +286,18 @@ end - function gmake2.target(cfg, toolset) + function gmake.target(cfg, toolset) p.outln('TARGETDIR = ' .. project.getrelative(cfg.project, cfg.buildtarget.directory)) p.outln('TARGET = $(TARGETDIR)/' .. cfg.buildtarget.name) end - function gmake2.objdir(cfg, toolset) + function gmake.objdir(cfg, toolset) p.outln('OBJDIR = ' .. project.getrelative(cfg.project, cfg.objdir)) end - function gmake2.settings(cfg, toolset) + function gmake.settings(cfg, toolset) if #cfg.makesettings > 0 then for _, value in ipairs(cfg.makesettings) do p.outln(value) @@ -311,7 +311,7 @@ end - function gmake2.buildCmds(cfg, event) + function gmake.buildCmds(cfg, event) _p('define %sCMDS', event:upper()) local steps = cfg[event .. "commands"] local msg = cfg[event .. "message"] @@ -325,32 +325,32 @@ end - function gmake2.preBuildCmds(cfg, toolset) - gmake2.buildCmds(cfg, "prebuild") + function gmake.preBuildCmds(cfg, toolset) + gmake.buildCmds(cfg, "prebuild") end - function gmake2.preLinkCmds(cfg, toolset) - gmake2.buildCmds(cfg, "prelink") + function gmake.preLinkCmds(cfg, toolset) + gmake.buildCmds(cfg, "prelink") end - function gmake2.postBuildCmds(cfg, toolset) - gmake2.buildCmds(cfg, "postbuild") + function gmake.postBuildCmds(cfg, toolset) + gmake.buildCmds(cfg, "postbuild") end - function gmake2.targetDirRules(cfg, toolset) - gmake2.mkdirRules("$(TARGETDIR)") + function gmake.targetDirRules(cfg, toolset) + gmake.mkdirRules("$(TARGETDIR)") end - function gmake2.objDirRules(cfg, toolset) - gmake2.mkdirRules("$(OBJDIR)") + function gmake.objDirRules(cfg, toolset) + gmake.mkdirRules("$(OBJDIR)") end - function gmake2.preBuildRules(cfg, toolset) + function gmake.preBuildRules(cfg, toolset) _p('prebuild: | $(OBJDIR)') _p('\t$(PREBUILDCMDS)') _p('') @@ -358,10 +358,10 @@ - include("gmake2_cpp.lua") - include("gmake2_csharp.lua") - include("gmake2_makefile.lua") - include("gmake2_utility.lua") - include("gmake2_workspace.lua") + include("gmake_cpp.lua") + include("gmake_csharp.lua") + include("gmake_makefile.lua") + include("gmake_utility.lua") + include("gmake_workspace.lua") - return gmake2 + return gmake diff --git a/modules/gmake2/gmake2_cpp.lua b/modules/gmake/gmake_cpp.lua similarity index 91% rename from modules/gmake2/gmake2_cpp.lua rename to modules/gmake/gmake_cpp.lua index e59e155bb7..8e997b5400 100644 --- a/modules/gmake2/gmake2_cpp.lua +++ b/modules/gmake/gmake_cpp.lua @@ -1,14 +1,14 @@ -- --- gmake2_cpp.lua +-- gmake_cpp.lua -- Generate a C/C++ project makefile. --- (c) 2016-2017 Jess Perkins, Blizzard Entertainment and the Premake project +-- (c) 2016-2025 Jess Perkins, Blizzard Entertainment and the Premake project -- local p = premake - local gmake2 = p.modules.gmake2 + local gmake = p.modules.gmake - gmake2.cpp = {} - local cpp = gmake2.cpp + gmake.cpp = {} + local cpp = gmake.cpp local project = p.project local config = p.config @@ -28,9 +28,9 @@ cpp.elements.makefile = function(prj) return { - gmake2.header, - gmake2.phonyRules, - gmake2.shellType, + gmake.header, + gmake.phonyRules, + gmake.shellType, cpp.createRuleTable, cpp.outputConfigurationSection, cpp.outputPerFileConfigurationSection, @@ -60,13 +60,13 @@ fileExtension { ".cc", ".cpp", ".cxx", ".mm" } buildoutputs { "$(OBJDIR)/%{file.objname}.o" } buildmessage '$(notdir $<)' - buildcommands {'$(CXX) %{premake.modules.gmake2.cpp.fileFlags(cfg, file)} $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"'} + buildcommands {'$(CXX) %{premake.modules.gmake.cpp.fileFlags(cfg, file)} $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"'} rule 'cc' fileExtension {".c", ".s", ".m"} buildoutputs { "$(OBJDIR)/%{file.objname}.o" } buildmessage '$(notdir $<)' - buildcommands {'$(CC) %{premake.modules.gmake2.cpp.fileFlags(cfg, file)} $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"'} + buildcommands {'$(CC) %{premake.modules.gmake.cpp.fileFlags(cfg, file)} $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"'} rule 'resource' fileExtension ".rc" @@ -187,7 +187,7 @@ buildoutputs = { output }, source = node.relpath, buildmessage = '$(notdir $<)', - verbatimbuildcommands = gmake2.copyfile_cmds('"$<"', '"$@"'), + verbatimbuildcommands = gmake.copyfile_cmds('"$<"', '"$@"'), buildinputs = {'$(TARGETDIR)'} } table.insert(cfg._gmake.fileRules, file) @@ -306,8 +306,8 @@ cpp.elements.configuration = function(cfg) return { cpp.tools, - gmake2.target, - gmake2.objdir, + gmake.target, + gmake.objdir, cpp.pch, cpp.defines, cpp.includes, @@ -322,10 +322,10 @@ cpp.linkCmd, cpp.bindirs, cpp.exepaths, - gmake2.settings, - gmake2.preBuildCmds, - gmake2.preLinkCmds, - gmake2.postBuildCmds, + gmake.settings, + gmake.preBuildCmds, + gmake.preLinkCmds, + gmake.postBuildCmds, } end @@ -334,7 +334,7 @@ _p('# Configurations') _p('# #############################################') _p('') - gmake2.outputSection(prj, cpp.elements.configuration) + gmake.outputSection(prj, cpp.elements.configuration) end @@ -381,61 +381,61 @@ function cpp.defines(cfg, toolset) - p.outln('DEFINES +=' .. gmake2.list(table.join(toolset.getdefines(cfg.defines, cfg), toolset.getundefines(cfg.undefines)))) + p.outln('DEFINES +=' .. gmake.list(table.join(toolset.getdefines(cfg.defines, cfg), toolset.getundefines(cfg.undefines)))) end function cpp.includes(cfg, toolset) local includes = toolset.getincludedirs(cfg, cfg.includedirs, cfg.externalincludedirs, cfg.frameworkdirs, cfg.includedirsafter) - p.outln('INCLUDES +=' .. gmake2.list(includes)) + p.outln('INCLUDES +=' .. gmake.list(includes)) end function cpp.forceInclude(cfg, toolset) local includes = toolset.getforceincludes(cfg) - p.outln('FORCE_INCLUDE +=' .. gmake2.list(includes)) + p.outln('FORCE_INCLUDE +=' .. gmake.list(includes)) end function cpp.cppFlags(cfg, toolset) - local flags = gmake2.list(toolset.getcppflags(cfg)) + local flags = gmake.list(toolset.getcppflags(cfg)) p.outln('ALL_CPPFLAGS += $(CPPFLAGS)' .. flags .. ' $(DEFINES) $(INCLUDES)') end function cpp.cFlags(cfg, toolset) - local flags = gmake2.list(table.join(toolset.getcflags(cfg), cfg.buildoptions)) + local flags = gmake.list(table.join(toolset.getcflags(cfg), cfg.buildoptions)) p.outln('ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS)' .. flags) end function cpp.cxxFlags(cfg, toolset) - local flags = gmake2.list(table.join(toolset.getcxxflags(cfg), cfg.buildoptions)) + local flags = gmake.list(table.join(toolset.getcxxflags(cfg), cfg.buildoptions)) p.outln('ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS)' .. flags) end function cpp.resFlags(cfg, toolset) local resflags = table.join(toolset.getdefines(cfg.resdefines), toolset.getincludedirs(cfg, cfg.resincludedirs), cfg.resoptions) - p.outln('ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)' .. gmake2.list(resflags)) + p.outln('ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)' .. gmake.list(resflags)) end function cpp.libs(cfg, toolset) local flags = toolset.getlinks(cfg) - p.outln('LIBS +=' .. gmake2.list(flags, true)) + p.outln('LIBS +=' .. gmake.list(flags, true)) end function cpp.ldDeps(cfg, toolset) local deps = config.getlinks(cfg, "siblings", "fullpath") - p.outln('LDDEPS +=' .. gmake2.list(p.esc(deps))) + p.outln('LDDEPS +=' .. gmake.list(p.esc(deps))) end function cpp.ldFlags(cfg, toolset) local flags = table.join(toolset.getLibraryDirectories(cfg), toolset.getrunpathdirs(cfg, table.join(cfg.runpathdirs, config.getsiblingtargetdirs(cfg))), toolset.getldflags(cfg), cfg.linkoptions) - p.outln('ALL_LDFLAGS += $(LDFLAGS)' .. gmake2.list(flags)) + p.outln('ALL_LDFLAGS += $(LDFLAGS)' .. gmake.list(flags)) end @@ -517,24 +517,24 @@ end function cpp.perFileFlags(cfg, fcfg) - local toolset = gmake2.getToolSet(cfg) + local toolset = gmake.getToolSet(cfg) local isCFile = path.iscfile(fcfg.name) local getflags = iif(isCFile, toolset.getcflags, toolset.getcxxflags) - local value = gmake2.list(table.join(getflags(fcfg), fcfg.buildoptions)) + local value = gmake.list(table.join(getflags(fcfg), fcfg.buildoptions)) if fcfg.defines or fcfg.undefines then local defs = table.join(toolset.getdefines(fcfg.defines, cfg), toolset.getundefines(fcfg.undefines)) if #defs > 0 then - value = value .. gmake2.list(defs) + value = value .. gmake.list(defs) end end if fcfg.includedirs or fcfg.externalincludedirs or fcfg.frameworkdirs then local includes = toolset.getincludedirs(cfg, fcfg.includedirs, fcfg.externalincludedirs, fcfg.frameworkdirs) if #includes > 0 then - value = value .. gmake2.list(includes) + value = value .. gmake.list(includes) end end @@ -600,7 +600,7 @@ end _x('') - gmake2.outputSection(prj, cpp.elements.filesets) + gmake.outputSection(prj, cpp.elements.filesets) end function cpp.outputFileset(cfg, kind, file) @@ -616,10 +616,10 @@ return { cpp.allRules, cpp.targetRules, - gmake2.targetDirRules, - gmake2.objDirRules, + gmake.targetDirRules, + gmake.objDirRules, cpp.cleanRules, - gmake2.preBuildRules, + gmake.preBuildRules, cpp.customDeps, cpp.pchRules, } @@ -630,7 +630,7 @@ _p('# Rules') _p('# #############################################') _p('') - gmake2.outputSection(prj, cpp.elements.rules) + gmake.outputSection(prj, cpp.elements.rules) end @@ -735,7 +735,7 @@ _p('# File Rules') _p('# #############################################') _p('') - gmake2.outputSection(prj, cpp.elements.fileRules) + gmake.outputSection(prj, cpp.elements.fileRules) end diff --git a/modules/gmake2/gmake2_csharp.lua b/modules/gmake/gmake_csharp.lua similarity index 80% rename from modules/gmake2/gmake2_csharp.lua rename to modules/gmake/gmake_csharp.lua index ce48ea5912..f04fe52905 100644 --- a/modules/gmake2/gmake2_csharp.lua +++ b/modules/gmake/gmake_csharp.lua @@ -1,14 +1,14 @@ -- --- gmake2_csharp.lua +-- gmake_csharp.lua -- Generate a C# project makefile. -- (c) 2016-2017 Jess Perkins, Blizzard Entertainment and the Premake project -- local p = premake - local gmake2 = p.modules.gmake2 + local gmake = p.modules.gmake - gmake2.cs = {} - local cs = gmake2.cs + gmake.cs = {} + local cs = gmake.cs local project = p.project local config = p.config @@ -28,23 +28,23 @@ cs.elements.makefile = function(prj) return { - gmake2.header, - gmake2.phonyRules, - gmake2.csConfigs, - gmake2.csProjectConfig, - gmake2.csSources, - gmake2.csEmbedFiles, - gmake2.csCopyFiles, - gmake2.csResponseFile, - gmake2.shellType, - gmake2.csAllRules, - gmake2.csTargetRules, - gmake2.targetDirRules, - gmake2.csResponseRules, - gmake2.objDirRules, - gmake2.csCleanRules, - gmake2.preBuildRules, - gmake2.csFileRules, + gmake.header, + gmake.phonyRules, + gmake.csConfigs, + gmake.csProjectConfig, + gmake.csSources, + gmake.csEmbedFiles, + gmake.csCopyFiles, + gmake.csResponseFile, + gmake.shellType, + gmake.csAllRules, + gmake.csTargetRules, + gmake.targetDirRules, + gmake.csResponseRules, + gmake.objDirRules, + gmake.csCleanRules, + gmake.preBuildRules, + gmake.csFileRules, } end @@ -66,19 +66,19 @@ cs.elements.configuration = function(cfg) return { - gmake2.csTools, - gmake2.target, - gmake2.objdir, - gmake2.csFlags, - gmake2.csLinkCmd, - gmake2.preBuildCmds, - gmake2.preLinkCmds, - gmake2.postBuildCmds, - gmake2.settings, + gmake.csTools, + gmake.target, + gmake.objdir, + gmake.csFlags, + gmake.csLinkCmd, + gmake.preBuildCmds, + gmake.preLinkCmds, + gmake.postBuildCmds, + gmake.settings, } end - function gmake2.csConfigs(prj, toolset) + function gmake.csConfigs(prj, toolset) for cfg in project.eachconfig(prj) do _x('ifeq ($(config),%s)', cfg.shortname) p.callArray(cs.elements.configuration, cfg, toolset) @@ -133,13 +133,13 @@ -- --------------------------------------------------------------------------- - function gmake2.csAllRules(prj, toolset) + function gmake.csAllRules(prj, toolset) _p('all: prebuild $(EMBEDFILES) $(COPYFILES) $(TARGET)') _p('') end - function gmake2.csCleanRules(prj, toolset) + function gmake.csCleanRules(prj, toolset) --[[ -- porting from 4.x _p('clean:') @@ -162,7 +162,7 @@ end - function gmake2.csCopyFiles(prj, toolset) + function gmake.csCopyFiles(prj, toolset) --[[ -- copied from 4.x; needs more porting _p('COPYFILES += \\') @@ -182,16 +182,16 @@ end - function gmake2.csResponseFile(prj, toolset) - _x('RESPONSE += ' .. gmake2.cs.getresponsefilename(prj)) + function gmake.csResponseFile(prj, toolset) + _x('RESPONSE += ' .. gmake.cs.getresponsefilename(prj)) end - function gmake2.csResponseRules(prj) + function gmake.csResponseRules(prj) local toolset = p.tools.dotnet - local ext = gmake2.getmakefilename(prj, true) + local ext = gmake.getmakefilename(prj, true) local makefile = path.getname(p.filename(prj, ext)) - local response = gmake2.cs.getresponsefilename(prj) + local response = gmake.cs.getresponsefilename(prj) _p('$(RESPONSE): %s', makefile) _p('\t@echo Generating response file', prj.name) @@ -215,7 +215,7 @@ end - function gmake2.csEmbedFiles(prj, toolset) + function gmake.csEmbedFiles(prj, toolset) local cfg = project.getfirstconfig(prj) _p('EMBEDFILES += \\') @@ -230,7 +230,7 @@ end - function gmake2.csFileRules(prj, toolset) + function gmake.csFileRules(prj, toolset) --[[ -- porting from 4.x _p('# Per-configuration copied file rules') @@ -260,19 +260,19 @@ end - function gmake2.csFlags(cfg, toolset) - _p(' FLAGS =%s', gmake2.list(toolset.getflags(cfg))) + function gmake.csFlags(cfg, toolset) + _p(' FLAGS =%s', gmake.list(toolset.getflags(cfg))) end - function gmake2.csLinkCmd(cfg, toolset) + function gmake.csLinkCmd(cfg, toolset) local deps = p.esc(config.getlinks(cfg, "dependencies", "fullpath")) - _p(' DEPENDS =%s', gmake2.list(deps)) + _p(' DEPENDS =%s', gmake.list(deps)) _p(' REFERENCES = %s', table.implode(deps, "/r:", "", " ")) end - function gmake2.csProjectConfig(prj, toolset) + function gmake.csProjectConfig(prj, toolset) -- To maintain compatibility with Visual Studio, these values must -- be set on the project level, and not per-configuration. local cfg = project.getfirstconfig(prj) @@ -287,7 +287,7 @@ end - function gmake2.csSources(prj, toolset) + function gmake.csSources(prj, toolset) local cfg = project.getfirstconfig(prj) _p('SOURCES += \\') @@ -302,7 +302,7 @@ end - function gmake2.csTargetRules(prj, toolset) + function gmake.csTargetRules(prj, toolset) _p('$(TARGET): $(SOURCES) $(EMBEDFILES) $(DEPENDS) $(RESPONSE) | $(TARGETDIR)') _p('\t$(PRELINKCMDS)') _p('\t$(SILENT) $(CSC) /nologo /out:$@ $(FLAGS) $(REFERENCES) @$(RESPONSE) $(patsubst %%,/resource:%%,$(EMBEDFILES))') @@ -311,7 +311,7 @@ end - function gmake2.csTools(cfg, toolset) + function gmake.csTools(cfg, toolset) _p(' CSC = %s', toolset.gettoolname(cfg, "csc")) _p(' RESGEN = %s', toolset.gettoolname(cfg, "resgen")) end diff --git a/modules/gmake2/gmake2_makefile.lua b/modules/gmake/gmake_makefile.lua similarity index 87% rename from modules/gmake2/gmake2_makefile.lua rename to modules/gmake/gmake_makefile.lua index a3644e42d1..6a40e8f910 100644 --- a/modules/gmake2/gmake2_makefile.lua +++ b/modules/gmake/gmake_makefile.lua @@ -1,14 +1,14 @@ -- --- gmake2_makefile.lua +-- gmake_makefile.lua -- Generate a C/C++ project makefile. -- (c) 2016-2017 Jess Perkins, Blizzard Entertainment and the Premake project -- local p = premake - local gmake2 = p.modules.gmake2 + local gmake = p.modules.gmake - gmake2.makefile = {} - local makefile = gmake2.makefile + gmake.makefile = {} + local makefile = gmake.makefile local project = p.project local config = p.config @@ -25,8 +25,8 @@ makefile.elements.makefile = function(prj) return { - gmake2.header, - gmake2.phonyRules, + gmake.header, + gmake.phonyRules, makefile.configs, makefile.targetRules } @@ -40,9 +40,9 @@ makefile.elements.configuration = function(cfg) return { - gmake2.target, - gmake2.buildCommands, - gmake2.cleanCommands, + gmake.target, + gmake.buildCommands, + gmake.cleanCommands, } end @@ -86,7 +86,7 @@ end - function gmake2.buildCommands(cfg) + function gmake.buildCommands(cfg) _p(' define BUILDCMDS') local steps = cfg.buildcommands if #steps > 0 then @@ -98,7 +98,7 @@ end - function gmake2.cleanCommands(cfg) + function gmake.cleanCommands(cfg) _p(' define CLEANCMDS') local steps = cfg.cleancommands if #steps > 0 then diff --git a/modules/gmake2/gmake2_utility.lua b/modules/gmake/gmake_utility.lua similarity index 94% rename from modules/gmake2/gmake2_utility.lua rename to modules/gmake/gmake_utility.lua index 5216bf8638..e80059bcb4 100644 --- a/modules/gmake2/gmake2_utility.lua +++ b/modules/gmake/gmake_utility.lua @@ -1,14 +1,14 @@ -- --- gmake2_utility.lua +-- gmake_utility.lua -- Generate a C/C++ project makefile. -- (c) 2016-2017 Jess Perkins, Blizzard Entertainment and the Premake project -- local p = premake - local gmake2 = p.modules.gmake2 + local gmake = p.modules.gmake - gmake2.utility = {} - local utility = gmake2.utility + gmake.utility = {} + local utility = gmake.utility local project = p.project local config = p.config @@ -27,9 +27,9 @@ utility.elements.makefile = function(prj) return { - gmake2.header, - gmake2.phonyRules, - gmake2.shellType, + gmake.header, + gmake.phonyRules, + gmake.shellType, utility.initialize, utility.createFileTable, utility.outputConfigurationSection, @@ -205,10 +205,10 @@ return { utility.bindirs, utility.exepaths, - gmake2.settings, - gmake2.preBuildCmds, - gmake2.preLinkCmds, - gmake2.postBuildCmds, + gmake.settings, + gmake.preBuildCmds, + gmake.preLinkCmds, + gmake.postBuildCmds, } end @@ -217,7 +217,7 @@ _p('# Configurations') _p('# #############################################') _p('') - gmake2.outputSection(prj, utility.elements.configuration) + gmake.outputSection(prj, utility.elements.configuration) end @@ -264,7 +264,7 @@ end _x('') - gmake2.outputSection(prj, utility.elements.filesets) + gmake.outputSection(prj, utility.elements.filesets) end @@ -281,7 +281,7 @@ return { utility.allRules, utility.targetRules, - gmake2.targetDirRules, + gmake.targetDirRules, utility.cleanRules, } end @@ -291,7 +291,7 @@ _p('# Rules') _p('# #############################################') _p('') - gmake2.outputSection(prj, utility.elements.rules) + gmake.outputSection(prj, utility.elements.rules) end @@ -347,7 +347,7 @@ _p('# File Rules') _p('# #############################################') _p('') - gmake2.outputSection(prj, utility.elements.fileRules) + gmake.outputSection(prj, utility.elements.fileRules) end diff --git a/modules/gmake2/gmake2_workspace.lua b/modules/gmake/gmake_workspace.lua similarity index 81% rename from modules/gmake2/gmake2_workspace.lua rename to modules/gmake/gmake_workspace.lua index 88655b8bf3..8a800bd383 100644 --- a/modules/gmake2/gmake2_workspace.lua +++ b/modules/gmake/gmake_workspace.lua @@ -1,11 +1,11 @@ -- --- gmake2_workspace.lua +-- gmake_workspace.lua -- Generate a workspace-level makefile. -- (c) 2016-2017 Jess Perkins, Blizzard Entertainment and the Premake project -- local p = premake - local gmake2 = p.modules.gmake2 + local gmake = p.modules.gmake local tree = p.tree local project = p.project @@ -14,20 +14,20 @@ -- Generate a GNU make "workspace" makefile, with support for the new platforms API. -- - function gmake2.generate_workspace(wks) + function gmake.generate_workspace(wks) p.eol("\n") - gmake2.header(wks) + gmake.header(wks) - gmake2.configmap(wks) - gmake2.projects(wks) + gmake.configmap(wks) + gmake.projects(wks) - gmake2.workspacePhonyRule(wks) - gmake2.groupRules(wks) + gmake.workspacePhonyRule(wks) + gmake.groupRules(wks) - gmake2.projectrules(wks) - gmake2.cleanrules(wks) - gmake2.helprule(wks) + gmake.projectrules(wks) + gmake.cleanrules(wks) + gmake.helprule(wks) end @@ -36,7 +36,7 @@ -- level configurations to the project level equivalents. -- - function gmake2.configmap(wks) + function gmake.configmap(wks) local first = true for cfg in p.workspace.eachconfig(wks) do if first then @@ -49,7 +49,7 @@ for prj in p.workspace.eachproject(wks) do local prjcfg = project.getconfig(prj, cfg.buildcfg, cfg.platform) if prjcfg then - _p(' %s_config = %s', gmake2.tovar(prj.name), prjcfg.shortname) + _p(' %s_config = %s', gmake.tovar(prj.name), prjcfg.shortname) end end @@ -69,10 +69,10 @@ -- Write out the rules for the `make clean` action. -- - function gmake2.cleanrules(wks) + function gmake.cleanrules(wks) _p('clean:') for prj in p.workspace.eachproject(wks) do - local prjpath = p.filename(prj, gmake2.getmakefilename(prj, true)) + local prjpath = p.filename(prj, gmake.getmakefilename(prj, true)) local prjdir = path.getdirectory(path.getrelative(wks.location, prjpath)) local prjname = path.getname(prjpath) _x(1,'@${MAKE} --no-print-directory -C %s -f %s clean', prjdir, prjname) @@ -85,7 +85,7 @@ -- Write out the make file help rule and configurations list. -- - function gmake2.helprule(wks) + function gmake.helprule(wks) _p('help:') _p(1,'@echo "Usage: make [config=name] [target]"') _p(1,'@echo ""') @@ -114,7 +114,7 @@ -- Write out the list of projects that comprise the workspace. -- - function gmake2.projects(wks) + function gmake.projects(wks) _p('PROJECTS := %s', table.concat(p.esc(table.extract(wks.projects, "name")), " ")) _p('') end @@ -123,7 +123,7 @@ -- Write out the workspace PHONY rule -- - function gmake2.workspacePhonyRule(wks) + function gmake.workspacePhonyRule(wks) local groups = {} local tr = p.workspace.grouptree(wks) tree.traverse(tr, { @@ -141,7 +141,7 @@ -- -- Write out the phony rules representing project groups -- - function gmake2.groupRules(wks) + function gmake.groupRules(wks) -- Transform workspace groups into target aggregate local tr = p.workspace.grouptree(wks) tree.traverse(tr, { @@ -179,19 +179,19 @@ -- Write out the rules to build each of the workspace's projects. -- - function gmake2.projectrules(wks) + function gmake.projectrules(wks) for prj in p.workspace.eachproject(wks) do local deps = project.getdependencies(prj) deps = table.extract(deps, "name") - _p('%s:%s', p.esc(prj.name), gmake2.list(p.esc(deps))) + _p('%s:%s', p.esc(prj.name), gmake.list(p.esc(deps))) - local cfgvar = gmake2.tovar(prj.name) + local cfgvar = gmake.tovar(prj.name) _p('ifneq (,$(%s_config))', cfgvar) _p(1,'@echo "==== Building %s ($(%s_config)) ===="', prj.name, cfgvar) - local prjpath = p.filename(prj, gmake2.getmakefilename(prj, true)) + local prjpath = p.filename(prj, gmake.getmakefilename(prj, true)) local prjdir = path.getdirectory(path.getrelative(wks.location, prjpath)) local prjname = path.getname(prjpath) diff --git a/modules/gmake/tests/_tests.lua b/modules/gmake/tests/_tests.lua new file mode 100644 index 0000000000..1be99a23a0 --- /dev/null +++ b/modules/gmake/tests/_tests.lua @@ -0,0 +1,18 @@ +require ("gmake") + +return { + "test_gmake_buildcmds.lua", + "test_gmake_clang.lua", + "test_gmake_file_rules.lua", + "test_gmake_flags.lua", + "test_gmake_includes.lua", + "test_gmake_ldflags.lua", + "test_gmake_linking.lua", + "test_gmake_makefile.lua", + "test_gmake_objects.lua", + "test_gmake_pch.lua", + "test_gmake_perfile_flags.lua", + "test_gmake_target_rules.lua", + "test_gmake_tools.lua", + "test_gmake_wks.lua" +} diff --git a/modules/gmake2/tests/test_gmake2_buildcmds.lua b/modules/gmake/tests/test_gmake_buildcmds.lua similarity index 77% rename from modules/gmake2/tests/test_gmake2_buildcmds.lua rename to modules/gmake/tests/test_gmake_buildcmds.lua index 23ea9aedb9..9134a60d10 100644 --- a/modules/gmake2/tests/test_gmake2_buildcmds.lua +++ b/modules/gmake/tests/test_gmake_buildcmds.lua @@ -1,8 +1,8 @@ -local suite = test.declare("gmake2_buildcommands") -local gmake2 = premake.modules.gmake2 +local suite = test.declare("gmake_buildcommands") +local gmake = premake.modules.gmake local wks, prj, cfg @@ -18,8 +18,8 @@ local function prepare() prj = test.getproject(wks, 1) cfg = test.getconfig(prj, "Debug") - local toolset = gmake2.getToolSet(cfg) - gmake2.postBuildCmds(cfg, toolset) + local toolset = gmake.getToolSet(cfg) + gmake.postBuildCmds(cfg, toolset) end diff --git a/modules/gmake2/tests/test_gmake2_clang.lua b/modules/gmake/tests/test_gmake_clang.lua similarity index 81% rename from modules/gmake2/tests/test_gmake2_clang.lua rename to modules/gmake/tests/test_gmake_clang.lua index c5d27af8d4..f1b6bcce7e 100644 --- a/modules/gmake2/tests/test_gmake2_clang.lua +++ b/modules/gmake/tests/test_gmake_clang.lua @@ -1,13 +1,13 @@ -- --- test_gmake2_clang.lua +-- test_gmake_clang.lua -- Test Clang support in Makefiles. -- (c) 2016-2017 Jess Perkins, Blizzard Entertainment and the Premake project -- - local suite = test.declare("gmake2_clang") + local suite = test.declare("gmake_clang") local p = premake - local gmake2 = p.modules.gmake2 + local gmake = p.modules.gmake -- -- Setup @@ -27,7 +27,7 @@ -- function suite.usesCorrectCompilers() - gmake2.cpp.outputConfigurationSection(prj) + gmake.cpp.outputConfigurationSection(prj) test.capture [[ # Configurations # ############################################# diff --git a/modules/gmake2/tests/test_gmake2_file_rules.lua b/modules/gmake/tests/test_gmake_file_rules.lua similarity index 97% rename from modules/gmake2/tests/test_gmake2_file_rules.lua rename to modules/gmake/tests/test_gmake_file_rules.lua index 79c1a3a3a5..d8f7bc9760 100644 --- a/modules/gmake2/tests/test_gmake2_file_rules.lua +++ b/modules/gmake/tests/test_gmake_file_rules.lua @@ -1,13 +1,13 @@ -- --- test_gmake2_file_rules.lua +-- test_gmake_file_rules.lua -- Validate the makefile source building rules. -- (c) 2016-2017 Jess Perkins, Blizzard Entertainment and the Premake project -- - local suite = test.declare("gmake2_file_rules") + local suite = test.declare("gmake_file_rules") local p = premake - local gmake2 = p.modules.gmake2 + local gmake = p.modules.gmake -- -- Setup @@ -16,8 +16,8 @@ local wks, prj function suite.setup() - p.escaper(gmake2.esc) - gmake2.cpp.initialize() + p.escaper(gmake.esc) + gmake.cpp.initialize() rule "TestRule" display "Test Rule" @@ -75,9 +75,9 @@ prj = p.workspace.getproject(wks, 1) p.oven.bake() - gmake2.cpp.createRuleTable(prj) - gmake2.cpp.createFileTable(prj) - gmake2.cpp.outputFileRuleSection(prj) + gmake.cpp.createRuleTable(prj) + gmake.cpp.createFileTable(prj) + gmake.cpp.outputFileRuleSection(prj) end diff --git a/modules/gmake2/tests/test_gmake2_flags.lua b/modules/gmake/tests/test_gmake_flags.lua similarity index 95% rename from modules/gmake2/tests/test_gmake2_flags.lua rename to modules/gmake/tests/test_gmake_flags.lua index 71f2c51ee1..86da21df25 100644 --- a/modules/gmake2/tests/test_gmake2_flags.lua +++ b/modules/gmake/tests/test_gmake_flags.lua @@ -1,14 +1,14 @@ -- --- test_gmake2_flags.lua +-- test_gmake_flags.lua -- Tests compiler and linker flags for Makefiles. -- (c) 2016-2017 Jess Perkins, Blizzard Entertainment and the Premake project -- - local suite = test.declare("gmake2_flags") + local suite = test.declare("gmake_flags") local p = premake - local gmake2 = p.modules.gmake2 - local cpp = gmake2.cpp + local gmake = p.modules.gmake + local cpp = gmake.cpp local project = p.project diff --git a/modules/gmake2/tests/test_gmake2_includes.lua b/modules/gmake/tests/test_gmake_includes.lua similarity index 79% rename from modules/gmake2/tests/test_gmake2_includes.lua rename to modules/gmake/tests/test_gmake_includes.lua index e038cd17b2..3f6edd8144 100644 --- a/modules/gmake2/tests/test_gmake2_includes.lua +++ b/modules/gmake/tests/test_gmake_includes.lua @@ -1,13 +1,13 @@ -- --- test_gmake2_includes.lua +-- test_gmake_includes.lua -- Validate the link step generation for makefiles. -- (c) 2016-2023 Jess Perkins and the Premake project -- -local suite = test.declare("gmake2_includes") +local suite = test.declare("gmake_includes") local p = premake -local gmake2 = p.modules.gmake2 +local gmake = p.modules.gmake local project = p.project @@ -25,7 +25,7 @@ end local function prepare(calls) local cfg = test.getconfig(prj, "Debug") local toolset = p.tools.gcc - gmake2.cpp.includes(cfg, toolset) + gmake.cpp.includes(cfg, toolset) end diff --git a/modules/gmake2/tests/test_gmake2_ldflags.lua b/modules/gmake/tests/test_gmake_ldflags.lua similarity index 89% rename from modules/gmake2/tests/test_gmake2_ldflags.lua rename to modules/gmake/tests/test_gmake_ldflags.lua index 4e24cb1569..e90e9a891e 100644 --- a/modules/gmake2/tests/test_gmake2_ldflags.lua +++ b/modules/gmake/tests/test_gmake_ldflags.lua @@ -1,13 +1,13 @@ -- --- test_gmake2_ldflags.lua +-- test_gmake_ldflags.lua -- Tests compiler and linker flags for Makefiles. -- (c) 2016-2017 Jess Perkins, Blizzard Entertainment and the Premake project -- - local suite = test.declare("gmake2_ldflags") + local suite = test.declare("gmake_ldflags") local p = premake - local gmake2 = p.modules.gmake2 + local gmake = p.modules.gmake -- @@ -24,7 +24,7 @@ local function prepare(calls) local cfg = test.getconfig(prj, "Debug") local toolset = p.tools.gcc - gmake2.cpp.ldFlags(cfg, toolset) + gmake.cpp.ldFlags(cfg, toolset) end diff --git a/modules/gmake2/tests/test_gmake2_linking.lua b/modules/gmake/tests/test_gmake_linking.lua similarity index 97% rename from modules/gmake2/tests/test_gmake2_linking.lua rename to modules/gmake/tests/test_gmake_linking.lua index 4890b967f9..ad97e902fb 100644 --- a/modules/gmake2/tests/test_gmake2_linking.lua +++ b/modules/gmake/tests/test_gmake_linking.lua @@ -1,14 +1,14 @@ -- --- test_gmake2_linking.lua +-- test_gmake_linking.lua -- Validate the link step generation for makefiles. -- (c) 2016-2017 Jess Perkins, Blizzard Entertainment and the Premake project -- - local suite = test.declare("gmake2_linking") + local suite = test.declare("gmake_linking") local p = premake - local gmake2 = p.modules.gmake2 - local cpp = gmake2.cpp + local gmake = p.modules.gmake + local cpp = gmake.cpp local project = p.project diff --git a/modules/gmake2/tests/test_gmake2_makefile.lua b/modules/gmake/tests/test_gmake_makefile.lua similarity index 91% rename from modules/gmake2/tests/test_gmake2_makefile.lua rename to modules/gmake/tests/test_gmake_makefile.lua index d0c1d209e6..a60857eb57 100644 --- a/modules/gmake2/tests/test_gmake2_makefile.lua +++ b/modules/gmake/tests/test_gmake_makefile.lua @@ -1,14 +1,14 @@ -- --- test_gmake2_makefile.lua +-- test_gmake_makefile.lua -- Validate the makefile projects. -- (c) 2016-2017 Jess Perkins, Blizzard Entertainment and the Premake project -- local p = premake - local suite = test.declare("gmake2_makefile") + local suite = test.declare("gmake_makefile") local p = premake - local gmake2 = p.modules.gmake2 + local gmake = p.modules.gmake local project = p.project @@ -26,7 +26,7 @@ local function prepare() prj = test.getproject(wks, 1) - gmake2.makefile.configs(prj) + gmake.makefile.configs(prj) end diff --git a/modules/gmake2/tests/test_gmake2_objects.lua b/modules/gmake/tests/test_gmake_objects.lua similarity index 97% rename from modules/gmake2/tests/test_gmake2_objects.lua rename to modules/gmake/tests/test_gmake_objects.lua index c16044fbaa..9410e6445a 100644 --- a/modules/gmake2/tests/test_gmake2_objects.lua +++ b/modules/gmake/tests/test_gmake_objects.lua @@ -1,13 +1,13 @@ -- --- test_gmake2_objects.lua +-- test_gmake_objects.lua -- Validate the list of objects for a makefile. -- (c) 2016-2017 Jess Perkins, Blizzard Entertainment and the Premake project -- - local suite = test.declare("gmake2_objects") + local suite = test.declare("gmake_objects") local p = premake - local gmake2 = p.modules.gmake2 + local gmake = p.modules.gmake -- @@ -17,15 +17,15 @@ local wks, prj function suite.setup() - gmake2.cpp.initialize() + gmake.cpp.initialize() wks = test.createWorkspace() end local function prepare() prj = test.getproject(wks, 1) - gmake2.cpp.createRuleTable(prj) - gmake2.cpp.createFileTable(prj) - gmake2.cpp.outputFilesSection(prj) + gmake.cpp.createRuleTable(prj) + gmake.cpp.createFileTable(prj) + gmake.cpp.outputFilesSection(prj) end diff --git a/modules/gmake2/tests/test_gmake2_pch.lua b/modules/gmake/tests/test_gmake_pch.lua similarity index 93% rename from modules/gmake2/tests/test_gmake2_pch.lua rename to modules/gmake/tests/test_gmake_pch.lua index c05c9cf4f1..875ddd7de4 100644 --- a/modules/gmake2/tests/test_gmake2_pch.lua +++ b/modules/gmake/tests/test_gmake_pch.lua @@ -1,14 +1,14 @@ -- --- test_gmake2_pch.lua +-- test_gmake_pch.lua -- Validate the setup for precompiled headers in makefiles. -- (c) 2016-2017 Jess Perkins, Blizzard Entertainment and the Premake project -- local p = premake - local suite = test.declare("gmake2_pch") + local suite = test.declare("gmake_pch") local p = premake - local gmake2 = p.modules.gmake2 + local gmake = p.modules.gmake local project = p.project @@ -20,25 +20,25 @@ local wks, prj function suite.setup() - gmake2.cpp.initialize() + gmake.cpp.initialize() wks, prj = test.createWorkspace() end local function prepareVars() local cfg = test.getconfig(prj, "Debug") - gmake2.cpp.pch(cfg) + gmake.cpp.pch(cfg) end local function prepareRules() local cfg = test.getconfig(prj, "Debug") - gmake2.cpp.pchRules(cfg.project) + gmake.cpp.pchRules(cfg.project) end local function prepareFlags() local project = test.getproject(wks, 1) - gmake2.cpp.createRuleTable(project) - gmake2.cpp.createFileTable(project) - gmake2.cpp.outputFileRuleSection(project) + gmake.cpp.createRuleTable(project) + gmake.cpp.createFileTable(project) + gmake.cpp.outputFileRuleSection(project) end -- diff --git a/modules/gmake2/tests/test_gmake2_perfile_flags.lua b/modules/gmake/tests/test_gmake_perfile_flags.lua similarity index 94% rename from modules/gmake2/tests/test_gmake2_perfile_flags.lua rename to modules/gmake/tests/test_gmake_perfile_flags.lua index 7808d6d0d6..4690ab86b8 100644 --- a/modules/gmake2/tests/test_gmake2_perfile_flags.lua +++ b/modules/gmake/tests/test_gmake_perfile_flags.lua @@ -1,13 +1,13 @@ -- --- gmake2_perfile_flags.lua +-- gmake_perfile_flags.lua -- Tests compiler and linker flags for Makefiles. -- (c) 2016-2017 Jess Perkins, Blizzard Entertainment and the Premake project -- - local suite = test.declare("gmake2_perfile_flags") + local suite = test.declare("gmake_perfile_flags") local p = premake - local gmake2 = p.modules.gmake2 + local gmake = p.modules.gmake local project = p.project @@ -23,7 +23,7 @@ local function prepare() local prj = p.workspace.getproject(wks, 1) - gmake2.cpp.outputPerFileConfigurationSection(prj) + gmake.cpp.outputPerFileConfigurationSection(prj) end diff --git a/modules/gmake2/tests/test_gmake2_target_rules.lua b/modules/gmake/tests/test_gmake_target_rules.lua similarity index 85% rename from modules/gmake2/tests/test_gmake2_target_rules.lua rename to modules/gmake/tests/test_gmake_target_rules.lua index 5575f47df2..ddce39f4e7 100644 --- a/modules/gmake2/tests/test_gmake2_target_rules.lua +++ b/modules/gmake/tests/test_gmake_target_rules.lua @@ -1,14 +1,14 @@ -- --- test_gmake2_target_rules.lua +-- test_gmake_target_rules.lua -- Validate the makefile target building rules. -- (c) 2016-2017 Jess Perkins, Blizzard Entertainment and the Premake project -- local p = premake - local suite = test.declare("gmake2_target_rules") + local suite = test.declare("gmake_target_rules") local p = premake - local gmake2 = p.modules.gmake2 + local gmake = p.modules.gmake local project = p.project @@ -25,7 +25,7 @@ local function prepare() local cfg = test.getconfig(prj, "Debug") - gmake2.cpp.allRules(cfg) + gmake.cpp.allRules(cfg) end diff --git a/modules/gmake2/tests/test_gmake2_tools.lua b/modules/gmake/tests/test_gmake_tools.lua similarity index 82% rename from modules/gmake2/tests/test_gmake2_tools.lua rename to modules/gmake/tests/test_gmake_tools.lua index 7384b695f6..a8453a1c84 100644 --- a/modules/gmake2/tests/test_gmake2_tools.lua +++ b/modules/gmake/tests/test_gmake_tools.lua @@ -1,13 +1,13 @@ -- --- test_gmake2_tools.lua +-- test_gmake_tools.lua -- Tests for tools support in makefiles. -- (c) 2016-2017 Jess Perkins, Blizzard Entertainment and the Premake project -- - local suite = test.declare("gmake2_tools") + local suite = test.declare("gmake_tools") local p = premake - local gmake2 = p.modules.gmake2 + local gmake = p.modules.gmake local project = premake.project @@ -29,7 +29,7 @@ -- function suite.usesCorrectTools_gcc() - gmake2.cpp.tools(cfg, p.tools.gcc) + gmake.cpp.tools(cfg, p.tools.gcc) test.capture [[ ifeq ($(origin CC), default) CC = gcc @@ -45,7 +45,7 @@ RESCOMP = windres end function suite.usesCorrectTools_clang() - gmake2.cpp.tools(cfg, p.tools.clang) + gmake.cpp.tools(cfg, p.tools.clang) test.capture [[ ifeq ($(origin CC), default) CC = clang diff --git a/modules/gmake2/tests/test_gmake2_wks.lua b/modules/gmake/tests/test_gmake_wks.lua similarity index 91% rename from modules/gmake2/tests/test_gmake2_wks.lua rename to modules/gmake/tests/test_gmake_wks.lua index 10994b7752..c1efd5bfc4 100644 --- a/modules/gmake2/tests/test_gmake2_wks.lua +++ b/modules/gmake/tests/test_gmake_wks.lua @@ -1,12 +1,12 @@ -local suite = test.declare("gmake2_wks") +local suite = test.declare("gmake_wks") local p = premake -local gmake2 = premake.modules.gmake2 +local gmake = premake.modules.gmake local wks, prj, cfg function suite.setup() - p.escaper(gmake2.esc) + p.escaper(gmake.esc) wks = workspace("MyWorkspace") configurations { "Debug", "Release" } end @@ -16,7 +16,7 @@ local function prepare() wks = test.getWorkspace(wks) prj = test.getproject(wks, 1) - gmake2.projectrules(wks) + gmake.projectrules(wks) end diff --git a/modules/gmake2/_manifest.lua b/modules/gmake2/_manifest.lua deleted file mode 100644 index b71a00b0b7..0000000000 --- a/modules/gmake2/_manifest.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - "_preload.lua", - "gmake2.lua", - "gmake2_cpp.lua", - "gmake2_csharp.lua", - "gmake2_makefile.lua", - "gmake2_utility.lua", - "gmake2_workspace.lua", -} diff --git a/modules/gmake2/tests/_tests.lua b/modules/gmake2/tests/_tests.lua deleted file mode 100644 index 5b866d1ed1..0000000000 --- a/modules/gmake2/tests/_tests.lua +++ /dev/null @@ -1,18 +0,0 @@ -require ("gmake2") - -return { - "test_gmake2_buildcmds.lua", - "test_gmake2_clang.lua", - "test_gmake2_file_rules.lua", - "test_gmake2_flags.lua", - "test_gmake2_includes.lua", - "test_gmake2_ldflags.lua", - "test_gmake2_linking.lua", - "test_gmake2_makefile.lua", - "test_gmake2_objects.lua", - "test_gmake2_pch.lua", - "test_gmake2_perfile_flags.lua", - "test_gmake2_target_rules.lua", - "test_gmake2_tools.lua", - "test_gmake2_wks.lua" -} diff --git a/scripts/package.lua b/scripts/package.lua index c69bae7409..1891097c61 100644 --- a/scripts/package.lua +++ b/scripts/package.lua @@ -195,7 +195,7 @@ if kind == "source" then } local perOSActions = { - "gmake2", + "gmake", "codelite" } diff --git a/src/_modules.lua b/src/_modules.lua index edbb6fd295..060a00d0ce 100644 --- a/src/_modules.lua +++ b/src/_modules.lua @@ -9,5 +9,5 @@ "vstudio", "xcode", "codelite", - "gmake2", + "gmake", }