-
I am using premake to generate gnu makefiles for my project. By default, premake specifies e.g. The makefile generated in the root directory has several entries (one for each project in my workspace) each of the form:
And each corresponding subdirectory has a makefile that handles building that specific project. I would like to remove the Is there an option that I could specify somewhere to remove the Environment: Ubuntu 20.04 using premake5 version 5.0.0-alpha15 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There is not an official way to do that currently, and not a particularly clean way to override the logic either. You could try to override premake.override(premake.make, 'projectiles', function(base, 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), make.list(deps))
local cfgvar = make.tovar(prj.name)
_p('ifneq (,$(%s_config))', cfgvar)
_p(1,'@echo "==== Building %s ($(%s_config)) ===="', prj.name, cfgvar)
local prjpath = p.filename(prj, make.getmakefilename(prj, true))
local prjdir = path.getdirectory(path.getrelative(wks.location, prjpath))
local prjname = path.getname(prjpath)
-- removed `--no-print-directory` here --
_x(1,'@${MAKE} -C %s -f %s config=$(%s_config)', prjdir, prjname, cfgvar)
_p('endif')
_p('')
end
end) This won't be future-proof though; it would be better to submit a PR to add an option to control it. |
Beta Was this translation helpful? Give feedback.
There is not an official way to do that currently, and not a particularly clean way to override the logic either. You could try to override
premake.make.projectrules()
(orpremake.gmake2.projectrules
depending on which action you're using), and just modify the logic to suit. Something like (untested):