Feature 2919629: Add help target for makefiles
This commit is contained in:
parent
f4cfa2f82a
commit
f8cd380d11
@ -8,6 +8,7 @@
|
||||
- Feature 2839002: Add gcc switch to improve header dependency generation (Johannes Spohr)
|
||||
- Feature 2832906: Global variable (_SCRIPT) for current script path
|
||||
- Feature 2905303: Enable better folder matching in file lists
|
||||
- Feature 2919629: Add help target for makefiles
|
||||
- Bug 2909463: Fix Xcode handling of Obj-C++ .mm files
|
||||
- Bug 2903430: Using relative instead of absolute paths with $() macro
|
||||
- Bug 2910691: Duplicate build options
|
||||
|
@ -12,15 +12,8 @@
|
||||
local platforms = premake.filterplatforms(sln, cc.platforms, "Native")
|
||||
|
||||
-- write a header showing the build options
|
||||
local cfgpairs = { }
|
||||
for _, platform in ipairs(platforms) do
|
||||
for _, cfgname in ipairs(sln.configurations) do
|
||||
table.insert(cfgpairs, premake.getconfigname(cfgname, platform, true))
|
||||
end
|
||||
end
|
||||
_p('# %s solution makefile autogenerated by Premake', premake.action.current().shortname)
|
||||
_p('# Usage: make [ config=config_name ]')
|
||||
_p('# Where {config_name} is one of: %s.', table.implode(cfgpairs, '"', '"', ', '))
|
||||
_p('# Type "make help" for usage help')
|
||||
_p('')
|
||||
|
||||
-- set a default configuration
|
||||
@ -33,7 +26,7 @@
|
||||
-- list the projects included in the solution
|
||||
_p('PROJECTS := %s', table.concat(_MAKE.esc(table.extract(sln.projects, "name")), " "))
|
||||
_p('')
|
||||
_p('.PHONY: all clean $(PROJECTS)')
|
||||
_p('.PHONY: all clean help $(PROJECTS)')
|
||||
_p('')
|
||||
_p('all: $(PROJECTS)')
|
||||
_p('')
|
||||
@ -53,4 +46,29 @@
|
||||
end
|
||||
_p('')
|
||||
|
||||
-- help rule
|
||||
_p('help:')
|
||||
_p(1,'@echo "Usage: make [config=name] [target]"')
|
||||
_p(1,'@echo ""')
|
||||
_p(1,'@echo "CONFIGURATIONS:"')
|
||||
|
||||
local cfgpairs = { }
|
||||
for _, platform in ipairs(platforms) do
|
||||
for _, cfgname in ipairs(sln.configurations) do
|
||||
_p(1,'@echo " %s"', premake.getconfigname(cfgname, platform, true))
|
||||
end
|
||||
end
|
||||
|
||||
_p(1,'@echo ""')
|
||||
_p(1,'@echo "TARGETS:"')
|
||||
_p(1,'@echo " all (default)"')
|
||||
_p(1,'@echo " clean"')
|
||||
|
||||
for _, prj in ipairs(sln.projects) do
|
||||
_p(1,'@echo " %s"', prj.name)
|
||||
end
|
||||
|
||||
_p(1,'@echo ""')
|
||||
_p(1,'@echo "For more information, see http://industriousone.com/premake/quick-start"')
|
||||
|
||||
end
|
||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user