Skip to content

Commit

Permalink
Make tup compilation more similar to make in regard to selected files
Browse files Browse the repository at this point in the history
If ASSOURCES, CSOURCES or CXXSOURCES is defined, then use these as the
list of files to compile. Otherwise search for all files with proper
extension.

Note that these variables should be tables, not strings.
  • Loading branch information
KamilSzczygiel committed Apr 20, 2016
1 parent 9a9c55f commit e3250a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compile.lua
@@ -1,20 +1,20 @@
--
-- file: compile.lua
--
-- author: Copyright (C) 2014-2015 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
-- author: Copyright (C) 2014-2016 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
--
-- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
-- distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
--

for index, filename in ipairs(tup.glob("*.S")) do
for index, filename in ipairs(ASSOURCES or tup.glob("*.S")) do
as(filename)
end

for index, filename in ipairs(tup.glob("*.c")) do
for index, filename in ipairs(CSOURCES or tup.glob("*.c")) do
cc(filename)
end

for index, filename in ipairs(tup.glob("*.cpp")) do
for index, filename in ipairs(CXXSOURCES or tup.glob("*.cpp")) do
cxx(filename)
end

0 comments on commit e3250a6

Please sign in to comment.