Always use .a for Makefile static libs, even on Windows

This commit is contained in:
starkos 2008-11-21 16:37:24 +00:00
parent f31931cfa5
commit 63a2f3fe60
2 changed files with 21 additions and 3 deletions

View File

@ -24,7 +24,25 @@
end
end
--
-- Get the target dependencies for a particular project configuration.
--
function _MAKE.gettargetdeps(cfg)
local result = { }
local deps = premake.getdependencies(cfg)
for _, prj in ipairs(deps) do
local prjcfg = premake.getconfig(prj, cfg.name)
local target = premake.gettargetfile(prjcfg, "target", prjcfg.kind, iif(prjcfg.kind == "StaticLib", "linux", nil))
table.insert(result, _MAKE.esc(target))
end
return result
end
--
-- Get the makefile file name for a solution or a project. If this object is the
-- only one writing to a location then I can use "Makefile". If more than one object

View File

@ -7,7 +7,7 @@ endif
<% for cfg in premake.eachconfig(this) do %>
ifeq ($(CONFIG),<%= _MAKE.esc(cfg.name)%>)
TARGETDIR = <%= _MAKE.esc(path.getdirectory(cfg.target)) %>
TARGET = $(TARGETDIR)/<%= _MAKE.esc(path.getname(cfg.target)) %>
TARGET = $(TARGETDIR)/<%= _MAKE.esc(path.getname(premake.gettargetfile(cfg, "target", cfg.kind, iif(cfg.kind == "StaticLib", "linux", nil)))) %>
OBJDIR = <%= _MAKE.esc(premake.getobjdir(cfg)) %>
DEFINES += <%= premake.tools[_OPTIONS.cc].make_defines(cfg) %>
INCLUDES += <%= premake.tools[_OPTIONS.cc].make_includes(cfg) %>
@ -16,7 +16,7 @@ ifeq ($(CONFIG),<%= _MAKE.esc(cfg.name)%>)
CXXFLAGS += $(CFLAGS) <%= premake.tools[_OPTIONS.cc].make_cxxflags(cfg) %>
LDFLAGS += <%= premake.tools[_OPTIONS.cc].make_ldflags(cfg) %> <%= table.concat(cfg.linkoptions, " ") %>
RESFLAGS += $(DEFINES) $(INCLUDES) <%= table.concat(cfg.resoptions, " ") %>
LDDEPS += <%= table.concat(premake.getlibraries(cfg, "siblings")) %>
LDDEPS += <%= table.concat(_MAKE.gettargetdeps(cfg), " ") %>
<% if cfg.kind == "StaticLib" then %>
LINKCMD = ar -rcs $(TARGET) $(OBJECTS) $(ARCH)
<% else %>