aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2016-07-15 19:20:08 +0200
committerAlex Auvolat <alex@adnab.me>2016-07-15 19:20:08 +0200
commit327d62f7d56f79999cac6407bdfdcc0b90510aef (patch)
treea81070cfaabb4f5d53f8d2099dfe9943bf319d52
parent2f13288a23da4dfaf6c40e1e943f83d8fa43145a (diff)
downloadkogata-327d62f7d56f79999cac6407bdfdcc0b90510aef.tar.gz
kogata-327d62f7d56f79999cac6407bdfdcc0b90510aef.zip
cppcheck integration ; not much
-rw-r--r--Makefile6
-rw-r--r--bam.lua2
-rwxr-xr-xmake_cdrom.sh8
-rw-r--r--res/fonts/bam.lua6
-rw-r--r--res/keymaps/bam.lua4
5 files changed, 16 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 9367bbf..f7a291f 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,12 @@ analyze:
reanalyze: clean analyze
+CHKFLAGS=--enable=warning,performance,information,style --suppress=portability -I src/common/include -j4 --platform=unix32
+cppcheck:
+ cppcheck $(CHKFLAGS) src/common 2>&1 >/dev/null | tee build/cppcheck.log
+ cppcheck $(CHKFLAGS) -I src/kernel/include src/kernel 2>&1 >/dev/null | tee -a build/cppcheck.log
+ cppcheck $(CHKFLAGS) -I src/lib/include src/lib src/sysbin 2>&1 >/dev/null | tee -a build/cppcheck.log
+
rebuild: clean all
mrproper: clean
diff --git a/bam.lua b/bam.lua
index be75fe5..1d9399d 100644
--- a/bam.lua
+++ b/bam.lua
@@ -3,7 +3,7 @@
--
function BuildOutput(settings, fname)
- if fname:sub(1, 4) == "src/" then
+ if fname:sub(1, 4) == "src/" or fname:sub(1, 4) == "res/" then
fname = fname:sub(5)
end
local out = PathJoin("build", PathBase(fname) .. settings.config_ext)
diff --git a/make_cdrom.sh b/make_cdrom.sh
index 4e7feb6..9dcc41f 100755
--- a/make_cdrom.sh
+++ b/make_cdrom.sh
@@ -20,12 +20,12 @@ cp build/shell.bin cdrom/sys/bin
for BIN in cdrom/sys/bin/*.bin; do strip $BIN; done
mkdir -p cdrom/sys/fonts
-cp build/res/fonts/*.bf cdrom/sys/fonts
-cp build/res/fonts/pcvga.bf cdrom/sys/fonts/default.bf
+cp build/fonts/*.bf cdrom/sys/fonts
+cp build/fonts/pcvga.bf cdrom/sys/fonts/default.bf
mkdir -p cdrom/sys/keymaps
-cp build/res/keymaps/*.km cdrom/sys/keymaps
-cp build/res/keymaps/fr.km cdrom/sys/keymaps/default.km
+cp build/keymaps/*.km cdrom/sys/keymaps
+cp build/keymaps/fr.km cdrom/sys/keymaps/default.km
cp README.md cdrom
diff --git a/res/fonts/bam.lua b/res/fonts/bam.lua
index 1f99169..04974c4 100644
--- a/res/fonts/bam.lua
+++ b/res/fonts/bam.lua
@@ -1,7 +1,7 @@
fonts = {}
for _, file in pairs(Collect('res/fonts/*.s')) do
- local out = PathJoin('build', PathBase(file) .. '.bf')
+ local out = BuildOutput(host_settings, PathBase(file)) .. '.bf'
AddJob(out, "nasm font " .. out, "nasm -o " .. out .. " " .. file)
AddDependency(out, file)
table.insert(fonts, out)
@@ -9,10 +9,10 @@ end
for _, file in pairs(Collect('res/fonts/*.c')) do
local obj = Compile(host_settings, file)
- local tgt = PathJoin('build', PathBase(file) .. '_tmp')
+ local tgt = BuildOutput(host_settings, PathBase(file) .. '_tmp')
local bin = Link(host_settings, tgt, obj)
- local out = PathJoin('build', PathBase(file) .. '.bf')
+ local out = BuildOutput(host_settings, PathBase(file)) .. '.bf'
AddJob(out, "call font " .. bin, "./" .. bin .. " > " .. out)
AddDependency(out, bin)
table.insert(fonts, out)
diff --git a/res/keymaps/bam.lua b/res/keymaps/bam.lua
index f078dd0..0657abc 100644
--- a/res/keymaps/bam.lua
+++ b/res/keymaps/bam.lua
@@ -2,10 +2,10 @@ keymaps = {}
for _, file in pairs(Collect('res/keymaps/*.c')) do
local obj = Compile(host_settings, file)
- local tgt = PathJoin('build', PathBase(file) .. '_tmp')
+ local tgt = BuildOutput(host_settings, PathBase(file) .. '_tmp')
local bin = Link(host_settings, tgt, obj)
- local out = PathJoin('build', PathBase(file) .. '.km')
+ local out = BuildOutput(host_settings, PathBase(file)) .. '.km'
AddJob(out, "call font " .. bin, "./" .. bin .. " > " .. out)
AddDependency(out, bin)
table.insert(keymaps, out)