diff options
| author | ruki <[email protected]> | 2015-06-12 15:51:18 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-06-12 15:51:18 +0800 |
| commit | 7693b33a4e39c66fa52af65c57c6f0ddaaf56bca (patch) | |
| tree | c47556bf502843f4b9bcb72e4eae3eb3bc17f058 /xmake/scripts/base/makefile.lua | |
| parent | eb0e6fe79d8e49d82bb600529028fcf28767a2d8 (diff) | |
output headers
Diffstat (limited to 'xmake/scripts/base/makefile.lua')
| -rw-r--r-- | xmake/scripts/base/makefile.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/xmake/scripts/base/makefile.lua b/xmake/scripts/base/makefile.lua index 4a91c0b3d..12eb23765 100644 --- a/xmake/scripts/base/makefile.lua +++ b/xmake/scripts/base/makefile.lua @@ -119,6 +119,9 @@ function makefile._make_target(file, name, target) local objfiles = rule.objectfiles(name, target, srcfiles) assert(srcfiles and objfiles) + -- get source and destinate header files + local srcheaders, dstheaders = rule.headerfiles(target) + -- get target file local targetfile = rule.targetfile(name, target) assert(targetfile) @@ -159,6 +162,16 @@ function makefile._make_target(file, name, target) file:write(string.format("\t@xmake l $(VERBOSE) verbose \"%s\"\n", cmd:gsub("[%s=\"]", function (w) return string.format("%%%x", w:byte()) end))) file:write(string.format("\t@xmake l mkdir %s\n", path.directory(targetfile))) file:write(string.format("\t@%s > %s 2>&1\n", cmd, makefile._LOGFILE)) + if srcheaders then + local i = 1 + for _, srcheader in ipairs(srcheaders) do + local dstheader = dstheaders[i] + if dstheader then + file:write(string.format("\t@xmake l cp %s %s\n", srcheader, dstheader)) + end + i = i + 1 + end + end -- make tail file:write("\n") |
