Split aal arguments properly.
This commit is contained in:
		
							parent
							
								
									01c2342e18
								
							
						
					
					
						commit
						c573b9bce2
					
				
					 1 changed files with 23 additions and 17 deletions
				
			
		| 
						 | 
				
			
			@ -49,25 +49,25 @@ definerule("acklibrary",
 | 
			
		|||
	function (e)
 | 
			
		||||
		local em = (e.vars.plat or ""):find("^em")
 | 
			
		||||
 | 
			
		||||
		local function splitter(srcs, num, cmd)
 | 
			
		||||
			local commands = {
 | 
			
		||||
			"rm -f %{outs[1]}",
 | 
			
		||||
			}
 | 
			
		||||
			local t = {}
 | 
			
		||||
			local function flush()
 | 
			
		||||
			commands[#commands+1] = 
 | 
			
		||||
				"ACKDIR=$(INSDIR) $(INSDIR)/bin/aal qc %{outs[1]} "..
 | 
			
		||||
					asstring(t)
 | 
			
		||||
				commands[#commands+1] = cmd:gsub("%%%%", asstring(t))
 | 
			
		||||
				t = {}
 | 
			
		||||
			end
 | 
			
		||||
		for _, target in ipairs(filenamesof(e.srcs)) do
 | 
			
		||||
			for _, target in ipairs(srcs) do
 | 
			
		||||
				t[#t+1] = target
 | 
			
		||||
			if #t == 100 then
 | 
			
		||||
				if #t == num then
 | 
			
		||||
					flush()
 | 
			
		||||
				end
 | 
			
		||||
			end
 | 
			
		||||
			if #t ~= 0 then
 | 
			
		||||
				flush()
 | 
			
		||||
			end
 | 
			
		||||
			return table.concat(commands, " && ")
 | 
			
		||||
		end
 | 
			
		||||
 | 
			
		||||
		return clibrary {
 | 
			
		||||
			name = e.name,
 | 
			
		||||
| 
						 | 
				
			
			@ -77,9 +77,15 @@ definerule("acklibrary",
 | 
			
		|||
				"util/arch+pkg",
 | 
			
		||||
				e.deps
 | 
			
		||||
			},
 | 
			
		||||
			vars = {
 | 
			
		||||
				splitter = splitter
 | 
			
		||||
			},
 | 
			
		||||
			_cfile = ackfile,
 | 
			
		||||
			suffix = em and ".m" or ".o",
 | 
			
		||||
			commands = commands
 | 
			
		||||
			commands = {
 | 
			
		||||
				"rm -f %{outs[1]}",
 | 
			
		||||
				"%{splitter(ins, 100, 'ACKDIR=$(INSDIR) $(INSDIR)/bin/aal qc '..tostring(outs[1])..' %%')}"
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	end
 | 
			
		||||
)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue