diff --git a/build.lua b/build.lua index 1ecf0eb12..629899415 100644 --- a/build.lua +++ b/build.lua @@ -47,7 +47,7 @@ installable { "util/arch+pkg", "util/ass+pkg", "util/ego+pkg", - "util/ass+pkg", + "util/int+pkg", "util/led+pkg", "util/misc+pkg", "util/opt+pkg", diff --git a/util/int/M.trap_msg b/util/int/M.trap_msg index fecec568d..f157c7450 100755 --- a/util/int/M.trap_msg +++ b/util/int/M.trap_msg @@ -1,21 +1,11 @@ #!/bin/sh # $Id$ -( - echo '/* This file is generated from '$1'; do not edit */' +echo '/* This file is generated from '$1'; do not edit */' - cat $1 | - sed ' - s/..// - s/.*/ "&",/ - ' -) >\#trap_msg - -if # the new one unchanged - cmp -s \#trap_msg trap_msg -then # throw it away - rm \#trap_msg -else # overwrite old version - mv \#trap_msg trap_msg -fi +cat $1 | +sed ' + s/..// + s/.*/ "&",/ +' diff --git a/util/int/M.warn_h b/util/int/M.warn_h index 10b6c47b3..10f7be304 100755 --- a/util/int/M.warn_h +++ b/util/int/M.warn_h @@ -1,23 +1,13 @@ #!/bin/sh # $Id$ -( - echo '/* This file is generated from '$1'; do not edit */' +echo '/* This file is generated from '$1'; do not edit */' - cat $1 | - grep '^\.Wn' | - sed ' - s/.*"/#define / - ' +cat $1 | +grep '^\.Wn' | +sed ' + s/.*"/#define / +' - echo '#define warning(n) do_warn((n), __LINE__, __FILE__)' -) >\#warn.h - -if # the new one unchanged - cmp -s \#warn.h warn.h -then # throw it away - rm \#warn.h -else # overwrite old version - mv \#warn.h warn.h -fi +echo '#define warning(n) do_warn((n), __LINE__, __FILE__)' diff --git a/util/int/M.warn_msg b/util/int/M.warn_msg index 4d6b806d6..5b1e9671f 100755 --- a/util/int/M.warn_msg +++ b/util/int/M.warn_msg @@ -1,24 +1,14 @@ #!/bin/sh # $Id$ -( - echo '/* This file is generated from '$1'; do not edit */' +echo '/* This file is generated from '$1'; do not edit */' - cat $1 | - grep '^\.Wn' | - sed ' - s/^\.Wn[ ]*/ {/ - s/[ ]*[0-9][0-9]*$/},/ - s/"[ ][ ]*W/", W/ - s/\\-/-/g - ' -) >\#warn_msg - -if # the new one unchanged - cmp -s \#warn_msg warn_msg -then # throw it away - rm \#warn_msg -else # overwrite old version - mv \#warn_msg warn_msg -fi +cat $1 | +grep '^\.Wn' | +sed ' + s/^\.Wn[ ]*/ {/ + s/[ ]*[0-9][0-9]*$/},/ + s/"[ ][ ]*W/", W/ + s/\\-/-/g +' diff --git a/util/int/alloc.c b/util/int/alloc.c index b7c785b2a..db3933262 100644 --- a/util/int/alloc.c +++ b/util/int/alloc.c @@ -4,9 +4,6 @@ #include "global.h" #include "alloc.h" -extern char *malloc(); -extern char *realloc(); - char *Malloc(sz, descr) size sz; char *descr; diff --git a/util/int/build.lua b/util/int/build.lua new file mode 100644 index 000000000..9c603cf1d --- /dev/null +++ b/util/int/build.lua @@ -0,0 +1,110 @@ +normalrule { + name = "trap_msg", + ins = { + "./M.trap_msg", + "etc/traps" + }, + outleaves = {"trap_msg"}, + commands = { + "%{ins} > %{outs}" + } +} + +normalrule { + name = "warn_msg", + ins = { + "./M.warn_msg", + "etc/traps" + }, + outleaves = {"warn_msg"}, + commands = { + "%{ins} > %{outs}" + } +} + +normalrule { + name = "warn_h", + ins = { + "./M.warn_h", + "doc/int/appA" -- there's a 1991 comment saying this needs to be moved + }, + outleaves = {"warn.h"}, + commands = { + "%{ins} > %{outs}" + } +} + +cprogram { + name = "mkiswitch", + srcs = {"./switch/mkiswitch.c"}, + deps = { + "h+emheaders", + "modules/src/em_data+lib", + } +} + +normalrule { + name = "docases", + ins = { + "+mkiswitch", + "etc/ip_spec.t" + }, + outleaves = {"DoCases"}, + commands = { + "%{ins[1]} Do %{ins[2]} %{outs}" + } +} + +cprogram { + name = "mkswitch", + srcs = {"./switch/mkswitch.c"} +} + +normalrule { + name = "prcases", + ins = { + "+mkswitch", + "etc/ip_spec.t" + }, + outleaves = {"PrCases"}, + commands = { + "%{ins[1]} Pr %{ins[2]} %{outs}" + } +} + +clibrary { + name = "generated", + srcs = {}, + hdrs = { + "+warn_msg", + "+trap_msg", + "+warn_h", + "+docases", + "+prcases", + } +} + +cprogram { + name = "int", + srcs = { + "./*.c", + }, + deps = { + "h+emheaders", + "+generated", + "modules/src/em_data+lib", + }, + vars = { + ["+cflags"] = {"-Wno-implicit-int"} + } +} + +installable { + name = "pkg", + map = { + ["$(PLATDEP)/int"] = "+int", + ["$(INSDIR)/share/man/man1/int.1"] = "./int.1", + } +} + + diff --git a/util/int/disassemble.c b/util/int/disassemble.c index 8d53c9ff9..c5bf99613 100644 --- a/util/int/disassemble.c +++ b/util/int/disassemble.c @@ -1758,7 +1758,7 @@ PRIVATE do_pr_instr(opcode) unsigned int opcode; { switch (opcode) { -#include "switch/PrCases" /* for the muscle */ +#include "PrCases" /* for the muscle */ case SECONDARY: do_pr_instr(SEC_BASE + nextTCbyte()); break; diff --git a/util/int/global.h b/util/int/global.h index 6d0474acb..d90f09b7a 100644 --- a/util/int/global.h +++ b/util/int/global.h @@ -4,6 +4,9 @@ /* $Id$ */ +#include +#include +#include /********* PRIVATE/static *********/ diff --git a/util/int/switch.c b/util/int/switch.c index 9668b4f58..a3c704f6a 100644 --- a/util/int/switch.c +++ b/util/int/switch.c @@ -15,7 +15,7 @@ do_instr(opcode) unsigned int opcode; { switch (opcode) { -#include "switch/DoCases" /* for the muscle */ +#include "DoCases" /* for the muscle */ case SECONDARY: do_instr(SEC_BASE + nextPCbyte()); break;