divert(-1) dnl ************************************************** dnl Makefile generator for T800 ifelse(` dnl Example command line: m4 T800make input dnl Example input: comment{SynDEx v4.0 1996/06/25 application ega2t : real equalizer on 2 Transputers}comment application_(ega2t) processor_(root) processor_(p) connect_(root,0, p,3) end_() ') dnl comment{comments with balanced curly braces}comment define(`comment_', `changequote({,})patsubst({$1 }, {^}, {# })changequote') define(`comment', `pushdef(`comment', ` changequote)`'popdef(`comment')dnl')changequote({,})comment_(') dnl -------------------------------------------------- dnl Macros to be used in $1.m4x: dnl m4includes_ compile_ rootObjects_ userObjects_ dnl arglist replaces a comma-separated list with a space-separated list: define(`arglist', `$1 ifelse($#,1,,`arglist(shift($@))')') dnl cdefile generates concatenation commands to generate a linker file dnl containing all object files (to overcome MSDOS command line length limit) define(`cdefile', ` echo $1 >>file_`'ifelse($#,1,,`cdefile(shift($@))')') dnl m4includes_(m4sourceFilenames) dnl files defining user macros, to be included during executive translation: define(`m4includes_',`define(`m4includes', arglist($@))') define(`m4includes',`') dnl rootObjects_(objectFilenames) dnl files providing user functions, to be linked only to the root processor: define(`rootObjects_',`define(`rootObjects', `$*')') dnl userObjects_(objectFilenames) dnl files providing user functions, to be linked to all processors: define(`userObjects_',`define(`userObjects', `$*')') dnl compile_(oneSourceFilename, optionalIncludeFiles) dnl files defining user functions, to be separately compiled: define(`compile_', `pushdef(`ext',substr($1,regexp($1,`\.')))dnl ifelse(ext,`.c', ` patsubst($1,`\.c',`.tco') : arglist($@) icc /t8 /wd /wn /wv $1 ', `errprint($1 unknown extension: ext)')') dnl compile_(finelame, optionalIncludes) ; for user functions dnl -------------------------------------------------- define(`application_', `define(`appli_', $1)define(`proc_no', 1)dnl define(`execs_',`')dnl to accumulate executables for configuration # Makefile for IMS ANSI C for Transputer # The path/ (slash-terminated) of the Cexec, T800exec and T800conf files: H= # load and run $1: $1.run : $1.btl iserver /sb $1.btl sinclude($1.m4x)dnl includes $1.m4x only if it exists ifdef(`rootObjects', `define(`file_',root.lnk) file_ : arglist(rootObjects) del file_ cdefile(rootObjects)define(`rootObjects',file_) ', `define(`rootObjects',`')')dnl ifdef(`userObjects', `define(`file_',user.lnk) file_ : arglist(userObjects) del file_ cdefile(userObjects)define(`userObjects',file_) ', `define(`userObjects',`')')dnl ') define(`processor_', `define(`procr_', appli_`'proc_no)dnl # processor $1: procr_.c : procr_.m4 $(H)T800exec $(H)Cexec m4includes gm4 $(H)Cexec $(H)T800exec m4includes procr_.m4 >procr_.c procr_.tco : procr_.c icc /t8 /wd /wn /wv procr_.c procr_.lku : procr_.tco userObjects ifelse($1,root,rootObjects) ilink /t8 procr_.obj userObjects dnl ifelse($1,root,`rootObjects /f startup.lnk',`/f startrd.lnk') define(`execs_', execs_ procr_.lku)define(`proc_no', incr(proc_no))') define(`bus_', `errprint(`macro `bus_' not supported')')dnl define(`connect_', `')dnl nothing to do. define(`end_', `dnl appli_ and execs_ are defined above # configure network: appli_.cfs : appli_.m4 $(H)T800conf gm4 $(H)T800conf appli_.m4 >appli_.cfs appli_.cfb : appli_.cfs execs_ icconf appli_.cfs appli_.btl : appli_.cfb icollect appli_.cfb ') dnl ************************************************** divert`'dnl