From 5c5f711cbb2ee162d94fe2d97e7e8325c81b8431 Mon Sep 17 00:00:00 2001 From: dtrg Date: Tue, 20 Feb 2007 00:46:10 +0000 Subject: [PATCH] Done a major overhaul of the way target include files are installed and how platform libraries are built. The ARCH pm variable has now been renamed PLATFORM (which is more accurate) and a different ARCH variable added, which represents the CPU family rather than the hardware platform. --- first/ack.pm | 2 +- include/_tail_mon/sys/types.h | 79 ------------------- lang/basic/lib/pmfile | 5 +- lang/cem/libcc.ansi/pmfile | 46 +++++------ lang/cem/libcc/gen/pmfile | 18 ++++- .../cem/libcc/headers}/.distr | 0 .../cem/libcc/headers}/assert.h | 0 .../cem/libcc/headers}/ctype.h | 0 .../cem/libcc/headers}/errno.h | 0 .../cem/libcc/headers}/fcntl.h | 0 .../_tail_cc => lang/cem/libcc/headers}/grp.h | 0 .../cem/libcc/headers}/math.h | 0 .../_tail_cc => lang/cem/libcc/headers}/pwd.h | 0 .../cem/libcc/headers}/setjmp.h | 0 .../cem/libcc/headers}/sgtty.h | 2 +- .../cem/libcc/headers}/signal.h | 0 .../cem/libcc/headers}/stdio.h | 0 .../cem/libcc/headers}/sys/.distr | 0 .../cem/libcc/headers}/sys/dir.h | 0 .../cem/libcc/headers}/sys/errno.h | 0 .../cem/libcc/headers}/sys/stat.h | 0 .../cem/libcc/headers}/sys/stdtypes.h | 0 .../cem/libcc/headers}/sys/types.h | 0 .../cem/libcc/headers}/time.h | 0 .../cem/libcc/headers}/varargs.h | 0 lang/cem/libcc/math/pmfile | 4 +- lang/cem/libcc/mon/pmfile | 5 +- lang/cem/libcc/pmfile | 24 ++++++ lang/cem/libcc/stdio/pmfile | 4 +- lang/m2/libm2/pmfile | 48 ++++++++++- {include/occam => lang/occam/headers}/.distr | 0 {include/occam => lang/occam/headers}/dec.ocm | 0 .../occam => lang/occam/headers}/printd.ocm | 0 .../occam => lang/occam/headers}/prints.ocm | 0 lang/occam/lib/pmfile | 6 +- lang/occam/pmfile | 13 +++ lang/pc/libpc/pmfile | 18 ++++- lib/descr/fe | 19 +++-- mach/i86/libem/pmfile | 71 +++++++++++++++++ mach/i86/libend/pmfile | 16 ++++ mach/i86/pmfile | 22 +++--- mach/proto/as/pmfile | 16 +++- mach/proto/cg/pmfile | 21 +++-- mach/proto/ncg/pmfile | 6 +- mach/proto/top/pmfile | 17 ++-- pmfile | 30 +++++-- 46 files changed, 322 insertions(+), 170 deletions(-) delete mode 100644 include/_tail_mon/sys/types.h rename {include/_tail_cc => lang/cem/libcc/headers}/.distr (100%) rename {include/_tail_cc => lang/cem/libcc/headers}/assert.h (100%) rename {include/_tail_cc => lang/cem/libcc/headers}/ctype.h (100%) rename {include/_tail_cc => lang/cem/libcc/headers}/errno.h (100%) rename {include/_tail_cc => lang/cem/libcc/headers}/fcntl.h (100%) rename {include/_tail_cc => lang/cem/libcc/headers}/grp.h (100%) rename {include/_tail_cc => lang/cem/libcc/headers}/math.h (100%) rename {include/_tail_cc => lang/cem/libcc/headers}/pwd.h (100%) rename {include/_tail_cc => lang/cem/libcc/headers}/setjmp.h (100%) rename {include/_tail_cc => lang/cem/libcc/headers}/sgtty.h (98%) rename {include/_tail_cc => lang/cem/libcc/headers}/signal.h (100%) rename {include/_tail_cc => lang/cem/libcc/headers}/stdio.h (100%) rename {include/_tail_cc => lang/cem/libcc/headers}/sys/.distr (100%) rename {include/_tail_cc => lang/cem/libcc/headers}/sys/dir.h (100%) rename {include/_tail_cc => lang/cem/libcc/headers}/sys/errno.h (100%) rename {include/_tail_cc => lang/cem/libcc/headers}/sys/stat.h (100%) rename {include/_tail_cc => lang/cem/libcc/headers}/sys/stdtypes.h (100%) rename {include/_tail_cc => lang/cem/libcc/headers}/sys/types.h (100%) rename {include/_tail_cc => lang/cem/libcc/headers}/time.h (100%) rename {include/_tail_cc => lang/cem/libcc/headers}/varargs.h (100%) rename {include/occam => lang/occam/headers}/.distr (100%) rename {include/occam => lang/occam/headers}/dec.ocm (100%) rename {include/occam => lang/occam/headers}/printd.ocm (100%) rename {include/occam => lang/occam/headers}/prints.ocm (100%) create mode 100644 mach/i86/libem/pmfile create mode 100644 mach/i86/libend/pmfile diff --git a/first/ack.pm b/first/ack.pm index 65ace9ebd..6f3ac56ab 100644 --- a/first/ack.pm +++ b/first/ack.pm @@ -3,7 +3,7 @@ -- Provides rules for building things with the half-built ACK itself. -ACKBUILDFLAGS = {"-m%ARCH%", "%OPTIMISATION%"} +ACKBUILDFLAGS = {"-m%PLATFORM%", "%OPTIMISATION%"} ACKDEFINES = EMPTY ACKINCLUDES = EMPTY diff --git a/include/_tail_mon/sys/types.h b/include/_tail_mon/sys/types.h deleted file mode 100644 index fc8ac0992..000000000 --- a/include/_tail_mon/sys/types.h +++ /dev/null @@ -1,79 +0,0 @@ -/* $Id$ */ -/* - * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands. - * See the copyright notice in the ACK home directory, in the file "Copyright". - */ - -/* - * Basic system types and major/minor device constructing/busting macros. - */ - -#if !defined(_SYS_TYPES_H) -#define _SYS_TYPES_H - -#ifdef __STDC__ -#if !defined(_SIZE_T) -#define _SIZE_T -typedef unsigned int size_t; /* type returned by sizeof */ -#endif /* _SIZE_T */ - -#if !defined(_TIME_T) -#define _TIME_T -typedef unsigned long time_t; -#endif /* TIME_T */ -#endif - -#if !defined(_POSIX_SOURCE) - -/* major part of a device */ -#define major(x) ((int)(((unsigned)(x)>>8)&0377)) - -/* minor part of a device */ -#define minor(x) ((int)((x)&0377)) - -/* make a device number */ -#define makedev(x,y) ((dev_t)(((x)<<8) | (y))) - -typedef unsigned char u_char; -typedef unsigned short u_short; -typedef unsigned int u_int; -typedef unsigned long u_long; - -typedef struct _physadr { int r[1]; } *physadr; -typedef long daddr_t; -typedef char * caddr_t; -#if defined(__BSD4_2) -typedef u_long ino_t; -#else -typedef u_short ino_t; -#endif -typedef long swblk_t; - -#include - -typedef long label_t[14]; -typedef short dev_t; -typedef long off_t; - -/* system V compatibility: */ -typedef unsigned int uint; -typedef unsigned short ushort; -typedef unsigned char uchar_t; -typedef short cnt_t; -typedef long paddr_t; -typedef long key_t; - -#else /* _POSIX_SOURCE */ -#if defined(_MINIX) -typedef unsigned short dev_t; /* hold (major|minor) device pair */ -typedef unsigned char gid_t; /* group id */ -typedef unsigned short ino_t; /* i-node number */ -typedef unsigned short mode_t; /* mode number within an i-node */ -typedef unsigned char nlink_t; /* number-of-links field within an i-node */ -typedef long off_t; /* offsets within a file */ -typedef int pid_t; /* type for pids (must be signed) */ -typedef unsigned short uid_t; /* user id */ -#endif /* _MINIX */ -#endif /* _POSIX_SOURCE */ - -#endif /* _SYS_TYPES_H */ diff --git a/lang/basic/lib/pmfile b/lang/basic/lib/pmfile index fa27ecfe5..01d3d8fde 100644 --- a/lang/basic/lib/pmfile +++ b/lang/basic/lib/pmfile @@ -1,10 +1,11 @@ -- $Source$ -- $State$ +-- $Revision$ local d = ROOTDIR.."lang/basic/lib/" lang_basic_runtime = acklibrary { - ACKINCLUDES = {PARENT, "%ROOTDIR%h", "%ROOTDIR%include/_tail_cc"}, + ACKINCLUDES = {PARENT, "%ROOTDIR%h"}, ackfile (d.."fif.e"), ackfile (d.."fef.e"), @@ -40,5 +41,5 @@ lang_basic_runtime = acklibrary { ackfile (d.."trap.c"), ackfile (d.."write.c"), - install = pm.install("%BINDIR%%PLATIND%/%ARCH%/tail_bc") + install = pm.install("%BINDIR%%PLATIND%/%PLATFORM%/tail_bc") } diff --git a/lang/cem/libcc.ansi/pmfile b/lang/cem/libcc.ansi/pmfile index 3f3e3bd74..aef503ce3 100644 --- a/lang/cem/libcc.ansi/pmfile +++ b/lang/cem/libcc.ansi/pmfile @@ -6,12 +6,12 @@ local d = ROOTDIR.."lang/cem/libcc.ansi/" local crt = ackfile { ACKINCLUDES = {PARENT, "%ROOTDIR%h"}, file (d.."head_ac.e"), - install = pm.install("%BINDIR%%PLATIND%/%ARCH%/head_ac") + install = pm.install("%BINDIR%%PLATIND%/%PLATFORM%/head_ac") } local libc = acklibrary { ACKBUILDFLAGS = {PARENT, "-ansi"}, - ACKINCLUDES = {PARENT, "%ROOTDIR%h", d.."headers", "%ROOTDIR%include/_tail_cc"}, + ACKINCLUDES = {PARENT, "%ROOTDIR%h", d.."headers"}, outputs = {"%U%/tail_ac.a"}, -- assert @@ -260,32 +260,32 @@ local libc = acklibrary { ackfile (d.."time/misc.c"), install = { - pm.install("%BINDIR%%PLATIND%/%ARCH%/tail_ac") + pm.install("%BINDIR%%PLATIND%/%PLATFORM%/tail_ac") } } local headers = group { install = { - pm.install(d.."headers/assert.h", "%BINDIR%include/assert.h"), - pm.install(d.."headers/ctype.h", "%BINDIR%include/ctype.h"), - pm.install(d.."headers/dirent.h", "%BINDIR%include/dirent.h"), - pm.install(d.."headers/errno.h", "%BINDIR%include/errno.h"), - pm.install(d.."headers/float.h", "%BINDIR%include/float.h"), - pm.install(d.."headers/grp.h", "%BINDIR%include/grp.h"), - pm.install(d.."headers/limits.h", "%BINDIR%include/limits.h"), - pm.install(d.."headers/locale.h", "%BINDIR%include/locale.h"), - pm.install(d.."headers/math.h", "%BINDIR%include/math.h"), - pm.install(d.."headers/mathconst.h", "%BINDIR%include/mathconst.h"), - pm.install(d.."headers/setjmp.h", "%BINDIR%include/setjmp.h"), - pm.install(d.."headers/signal.h", "%BINDIR%include/signal.h"), - pm.install(d.."headers/stdarg.h", "%BINDIR%include/stdarg.h"), - pm.install(d.."headers/stddef.h", "%BINDIR%include/stddef.h"), - pm.install(d.."headers/stdio.h", "%BINDIR%include/stdio.h"), - pm.install(d.."headers/stdlib.h", "%BINDIR%include/stdlib.h"), - pm.install(d.."headers/string.h", "%BINDIR%include/string.h"), - pm.install(d.."headers/time.h", "%BINDIR%include/time.h"), - pm.install(d.."headers/sys/dirent.h", "%BINDIR%include/sys/dirent.h"), - pm.install(d.."headers/sys/errno.h", "%BINDIR%include/sys/errno.h"), + pm.install(d.."headers/assert.h", "%BINDIR%include/ansi/assert.h"), + pm.install(d.."headers/ctype.h", "%BINDIR%include/ansi/ctype.h"), + pm.install(d.."headers/dirent.h", "%BINDIR%include/ansi/dirent.h"), + pm.install(d.."headers/errno.h", "%BINDIR%include/ansi/errno.h"), + pm.install(d.."headers/float.h", "%BINDIR%include/ansi/float.h"), + pm.install(d.."headers/grp.h", "%BINDIR%include/ansi/grp.h"), + pm.install(d.."headers/limits.h", "%BINDIR%include/ansi/limits.h"), + pm.install(d.."headers/locale.h", "%BINDIR%include/ansi/locale.h"), + pm.install(d.."headers/math.h", "%BINDIR%include/ansi/math.h"), + pm.install(d.."headers/mathconst.h", "%BINDIR%include/ansi/mathconst.h"), + pm.install(d.."headers/setjmp.h", "%BINDIR%include/ansi/setjmp.h"), + pm.install(d.."headers/signal.h", "%BINDIR%include/ansi/signal.h"), + pm.install(d.."headers/stdarg.h", "%BINDIR%include/ansi/stdarg.h"), + pm.install(d.."headers/stddef.h", "%BINDIR%include/ansi/stddef.h"), + pm.install(d.."headers/stdio.h", "%BINDIR%include/ansi/stdio.h"), + pm.install(d.."headers/stdlib.h", "%BINDIR%include/ansi/stdlib.h"), + pm.install(d.."headers/string.h", "%BINDIR%include/ansi/string.h"), + pm.install(d.."headers/time.h", "%BINDIR%include/ansi/time.h"), + pm.install(d.."headers/sys/dirent.h", "%BINDIR%include/ansi/sys/dirent.h"), + pm.install(d.."headers/sys/errno.h", "%BINDIR%include/ansi/sys/errno.h"), } } diff --git a/lang/cem/libcc/gen/pmfile b/lang/cem/libcc/gen/pmfile index 4a6995f8c..ca72d8506 100644 --- a/lang/cem/libcc/gen/pmfile +++ b/lang/cem/libcc/gen/pmfile @@ -3,9 +3,12 @@ local d = ROOTDIR.."lang/cem/libcc/gen/" -lang_cem_gen_runtime = acklibrary { - ACKINCLUDES = {PARENT, "%ROOTDIR%h", "%ROOTDIR%include/_tail_cc"}, - +local head = acklibrary { + ackfile (d.."head_cc.e"), + install = pm.install("%BINDIR%%PLATIND%/%PLATFORM%/head_cc") +} + +local tail = acklibrary { ackfile (d.."abs.c"), ackfile (d.."atof.c"), ackfile (d.."strtod.c"), @@ -80,5 +83,12 @@ lang_cem_gen_runtime = acklibrary { ackfile (d.."modf.e"), ackfile (d.."setjmp.e"), - install = pm.install("%BINDIR%%PLATIND%/%ARCH%/tail_cc.2g") + install = pm.install("%BINDIR%%PLATIND%/%PLATFORM%/tail_cc.2g") +} + +lang_cem_gen_runtime = group { + ACKINCLUDES = {PARENT, "%ROOTDIR%h"}, + + head, + tail } diff --git a/include/_tail_cc/.distr b/lang/cem/libcc/headers/.distr similarity index 100% rename from include/_tail_cc/.distr rename to lang/cem/libcc/headers/.distr diff --git a/include/_tail_cc/assert.h b/lang/cem/libcc/headers/assert.h similarity index 100% rename from include/_tail_cc/assert.h rename to lang/cem/libcc/headers/assert.h diff --git a/include/_tail_cc/ctype.h b/lang/cem/libcc/headers/ctype.h similarity index 100% rename from include/_tail_cc/ctype.h rename to lang/cem/libcc/headers/ctype.h diff --git a/include/_tail_cc/errno.h b/lang/cem/libcc/headers/errno.h similarity index 100% rename from include/_tail_cc/errno.h rename to lang/cem/libcc/headers/errno.h diff --git a/include/_tail_cc/fcntl.h b/lang/cem/libcc/headers/fcntl.h similarity index 100% rename from include/_tail_cc/fcntl.h rename to lang/cem/libcc/headers/fcntl.h diff --git a/include/_tail_cc/grp.h b/lang/cem/libcc/headers/grp.h similarity index 100% rename from include/_tail_cc/grp.h rename to lang/cem/libcc/headers/grp.h diff --git a/include/_tail_cc/math.h b/lang/cem/libcc/headers/math.h similarity index 100% rename from include/_tail_cc/math.h rename to lang/cem/libcc/headers/math.h diff --git a/include/_tail_cc/pwd.h b/lang/cem/libcc/headers/pwd.h similarity index 100% rename from include/_tail_cc/pwd.h rename to lang/cem/libcc/headers/pwd.h diff --git a/include/_tail_cc/setjmp.h b/lang/cem/libcc/headers/setjmp.h similarity index 100% rename from include/_tail_cc/setjmp.h rename to lang/cem/libcc/headers/setjmp.h diff --git a/include/_tail_cc/sgtty.h b/lang/cem/libcc/headers/sgtty.h similarity index 98% rename from include/_tail_cc/sgtty.h rename to lang/cem/libcc/headers/sgtty.h index 405f4f83d..547a4ee6d 100644 --- a/include/_tail_cc/sgtty.h +++ b/lang/cem/libcc/headers/sgtty.h @@ -77,7 +77,7 @@ struct tchars { #else #define HUPCL 0000001 /* unused ??? */ #endif -/*#define COOKED 0000000 /* neither CBREAK nor RAW */ +/*#define COOKED 0000000 */ /* neither CBREAK nor RAW */ #ifdef __BDS4_2 #define TIOCGETP (('t'<<8) | 8 | (6 << 16) | 0x40000000) diff --git a/include/_tail_cc/signal.h b/lang/cem/libcc/headers/signal.h similarity index 100% rename from include/_tail_cc/signal.h rename to lang/cem/libcc/headers/signal.h diff --git a/include/_tail_cc/stdio.h b/lang/cem/libcc/headers/stdio.h similarity index 100% rename from include/_tail_cc/stdio.h rename to lang/cem/libcc/headers/stdio.h diff --git a/include/_tail_cc/sys/.distr b/lang/cem/libcc/headers/sys/.distr similarity index 100% rename from include/_tail_cc/sys/.distr rename to lang/cem/libcc/headers/sys/.distr diff --git a/include/_tail_cc/sys/dir.h b/lang/cem/libcc/headers/sys/dir.h similarity index 100% rename from include/_tail_cc/sys/dir.h rename to lang/cem/libcc/headers/sys/dir.h diff --git a/include/_tail_cc/sys/errno.h b/lang/cem/libcc/headers/sys/errno.h similarity index 100% rename from include/_tail_cc/sys/errno.h rename to lang/cem/libcc/headers/sys/errno.h diff --git a/include/_tail_cc/sys/stat.h b/lang/cem/libcc/headers/sys/stat.h similarity index 100% rename from include/_tail_cc/sys/stat.h rename to lang/cem/libcc/headers/sys/stat.h diff --git a/include/_tail_cc/sys/stdtypes.h b/lang/cem/libcc/headers/sys/stdtypes.h similarity index 100% rename from include/_tail_cc/sys/stdtypes.h rename to lang/cem/libcc/headers/sys/stdtypes.h diff --git a/include/_tail_cc/sys/types.h b/lang/cem/libcc/headers/sys/types.h similarity index 100% rename from include/_tail_cc/sys/types.h rename to lang/cem/libcc/headers/sys/types.h diff --git a/include/_tail_cc/time.h b/lang/cem/libcc/headers/time.h similarity index 100% rename from include/_tail_cc/time.h rename to lang/cem/libcc/headers/time.h diff --git a/include/_tail_cc/varargs.h b/lang/cem/libcc/headers/varargs.h similarity index 100% rename from include/_tail_cc/varargs.h rename to lang/cem/libcc/headers/varargs.h diff --git a/lang/cem/libcc/math/pmfile b/lang/cem/libcc/math/pmfile index 90c5da148..46c4e2a53 100644 --- a/lang/cem/libcc/math/pmfile +++ b/lang/cem/libcc/math/pmfile @@ -4,7 +4,7 @@ local d = ROOTDIR.."lang/cem/libcc/math/" lang_cem_math_runtime = acklibrary { - ACKINCLUDES = {PARENT, "%ROOTDIR%h", "%ROOTDIR%include/_tail_cc"}, + ACKINCLUDES = {PARENT, "%ROOTDIR%h"}, ackfile (d.."asin.c"), ackfile (d.."atan2.c"), @@ -27,5 +27,5 @@ lang_cem_math_runtime = acklibrary { ackfile (d.."exp.c"), ackfile (d.."floor.c"), - install = pm.install("%BINDIR%%PLATIND%/%ARCH%/tail_m") + install = pm.install("%BINDIR%%PLATIND%/%PLATFORM%/tail_m") } diff --git a/lang/cem/libcc/mon/pmfile b/lang/cem/libcc/mon/pmfile index f7c6c6017..45ad605d8 100644 --- a/lang/cem/libcc/mon/pmfile +++ b/lang/cem/libcc/mon/pmfile @@ -4,8 +4,7 @@ local d = ROOTDIR.."lang/cem/libcc/mon/" lang_cem_mon_runtime = acklibrary { - ACKINCLUDES = {PARENT, "%ROOTDIR%h", "%ROOTDIR%include/_tail_cc", - "%ROOTDIR%include/_tail_mon"}, + ACKINCLUDES = {PARENT, "%ROOTDIR%h", "%ROOTDIR%include/_tail_mon"}, ackfile (d.."exit.c"), ackfile (d.."gtty.c"), @@ -98,5 +97,5 @@ lang_cem_mon_runtime = acklibrary { ackfile (d.."_wait.e"), ackfile (d.."_write.e"), - install = pm.install("%BINDIR%%PLATIND%/%ARCH%/tail_mon") + install = pm.install("%BINDIR%%PLATIND%/%PLATFORM%/tail_mon") } diff --git a/lang/cem/libcc/pmfile b/lang/cem/libcc/pmfile index 18b3e3c3e..bb3307798 100644 --- a/lang/cem/libcc/pmfile +++ b/lang/cem/libcc/pmfile @@ -8,7 +8,31 @@ include (d.."math/pmfile") include (d.."mon/pmfile") include (d.."stdio/pmfile") +local headers = group { + install = { + pm.install(d.."headers/assert.h", "%BINDIR%include/knr/assert.h"), + pm.install(d.."headers/ctype.h", "%BINDIR%include/knr/ctype.h"), + pm.install(d.."headers/errno.h", "%BINDIR%include/knr/errno.h"), + pm.install(d.."headers/fcntl.h", "%BINDIR%include/knr/fcntl.h"), + pm.install(d.."headers/grp.h", "%BINDIR%include/knr/grp.h"), + pm.install(d.."headers/math.h", "%BINDIR%include/knr/math.h"), + pm.install(d.."headers/pwd.h", "%BINDIR%include/knr/pwd.h"), + pm.install(d.."headers/setjmp.h", "%BINDIR%include/knr/setjmp.h"), + pm.install(d.."headers/sgtty.h", "%BINDIR%include/knr/sgtty.h"), + pm.install(d.."headers/signal.h", "%BINDIR%include/knr/signal.h"), + pm.install(d.."headers/stdio.h", "%BINDIR%include/knr/stdio.h"), + pm.install(d.."headers/time.h", "%BINDIR%include/knr/time.h"), + pm.install(d.."headers/varargs.h", "%BINDIR%include/knr/varargs.h"), + pm.install(d.."headers/sys/dir.h", "%BINDIR%include/knr/sys/dir.h"), + pm.install(d.."headers/sys/errno.h", "%BINDIR%include/knr/sys/errno.h"), + pm.install(d.."headers/sys/stat.h", "%BINDIR%include/knr/sys/stat.h"), + pm.install(d.."headers/sys/stdtypes.h", "%BINDIR%include/knr/sys/stdtypes.h"), + pm.install(d.."headers/sys/types.h", "%BINDIR%include/knr/sys/types.h"), + } +} + lang_cem_runtime = group { + headers, lang_cem_gen_runtime, lang_cem_math_runtime, lang_cem_mon_runtime, diff --git a/lang/cem/libcc/stdio/pmfile b/lang/cem/libcc/stdio/pmfile index 21cb247c6..b7fd96134 100644 --- a/lang/cem/libcc/stdio/pmfile +++ b/lang/cem/libcc/stdio/pmfile @@ -4,7 +4,7 @@ local d = ROOTDIR.."lang/cem/libcc/stdio/" lang_cem_stdio_runtime = acklibrary { - ACKINCLUDES = {PARENT, "%ROOTDIR%h", "%ROOTDIR%include/_tail_cc"}, + ACKINCLUDES = {PARENT, "%ROOTDIR%h"}, ackfile (d.."vsprintf.c"), ackfile (d.."vfprintf.c"), @@ -54,5 +54,5 @@ lang_cem_stdio_runtime = acklibrary { ackfile (d.."timezone.c"), ackfile (d.."ungetc.c"), - install = pm.install("%BINDIR%%PLATIND%/%ARCH%/tail_cc.1s") + install = pm.install("%BINDIR%%PLATIND%/%PLATFORM%/tail_cc.1s") } diff --git a/lang/m2/libm2/pmfile b/lang/m2/libm2/pmfile index 71a62c546..10b987e6e 100644 --- a/lang/m2/libm2/pmfile +++ b/lang/m2/libm2/pmfile @@ -3,9 +3,43 @@ local d = ROOTDIR.."lang/m2/libm2/" -lang_m2_runtime = acklibrary { - ACKINCLUDES = {PARENT, "%ROOTDIR%h", "%ROOTDIR%include/_tail_cc"}, +local headers = group { + install = { + pm.install(d.."Arguments.def", "%BINDIR%include/m2/Arguments.def"), + pm.install(d.."ArraySort.def", "%BINDIR%include/m2/ArraySort.def"), + pm.install(d.."ASCII.def", "%BINDIR%include/m2/ASCII.def"), + pm.install(d.."Conversion.def", "%BINDIR%include/m2/Conversion.def"), + pm.install(d.."CSP.def", "%BINDIR%include/m2/CSP.def"), + pm.install(d.."EM.def", "%BINDIR%include/m2/EM.def"), + pm.install(d.."Epilogue.def", "%BINDIR%include/m2/Epilogue.def"), + pm.install(d.."InOut.def", "%BINDIR%include/m2/InOut.def"), + pm.install(d.."MathLib0.def", "%BINDIR%include/m2/MathLib0.def"), + pm.install(d.."Mathlib.def", "%BINDIR%include/m2/Mathlib.def"), + pm.install(d.."PascalIO.def", "%BINDIR%include/m2/PascalIO.def"), + pm.install(d.."Processes.def", "%BINDIR%include/m2/Processes.def"), + pm.install(d.."random.def", "%BINDIR%include/m2/random.def"), + pm.install(d.."RealConver.def", "%BINDIR%include/m2/RealConver.def"), + pm.install(d.."RealInOut.def", "%BINDIR%include/m2/RealInOut.def"), + pm.install(d.."Semaphores.def", "%BINDIR%include/m2/Semaphores.def"), + pm.install(d.."Storage.def", "%BINDIR%include/m2/Storage.def"), + pm.install(d.."Streams.def", "%BINDIR%include/m2/Streams.def"), + pm.install(d.."Strings.def", "%BINDIR%include/m2/Strings.def"), + pm.install(d.."StripUnix.def", "%BINDIR%include/m2/StripUnix.def"), + pm.install(d.."Termcap.def", "%BINDIR%include/m2/Termcap.def"), + pm.install(d.."Terminal.def", "%BINDIR%include/m2/Terminal.def"), + pm.install(d.."Traps.def", "%BINDIR%include/m2/Traps.def"), + pm.install(d.."Unix.def", "%BINDIR%include/m2/Unix.def"), + pm.install(d.."XXTermcap.def", "%BINDIR%include/m2/XXTermcap.def"), + } +} + +local head = ackfile { + file (d.."head_m2.e"), + install = pm.install("%BINDIR%%PLATIND%/%PLATFORM%/head_m2") +} + +local tail = acklibrary { ackfile (d.."Termcap.mod"), ackfile (d.."CSP.mod"), ackfile (d.."PascalIO.mod"), @@ -53,5 +87,13 @@ lang_m2_runtime = acklibrary { ackfile (d.."rckil.c"), ackfile (d.."EM.e"), - install = pm.install("%BINDIR%%PLATIND%/%ARCH%/tail_m2") + install = pm.install("%BINDIR%%PLATIND%/%PLATFORM%/tail_m2") +} + +lang_m2_runtime = acklibrary { + ACKINCLUDES = {PARENT, "%ROOTDIR%h"}, + + headers, + head, + tail } diff --git a/include/occam/.distr b/lang/occam/headers/.distr similarity index 100% rename from include/occam/.distr rename to lang/occam/headers/.distr diff --git a/include/occam/dec.ocm b/lang/occam/headers/dec.ocm similarity index 100% rename from include/occam/dec.ocm rename to lang/occam/headers/dec.ocm diff --git a/include/occam/printd.ocm b/lang/occam/headers/printd.ocm similarity index 100% rename from include/occam/printd.ocm rename to lang/occam/headers/printd.ocm diff --git a/include/occam/prints.ocm b/lang/occam/headers/prints.ocm similarity index 100% rename from include/occam/prints.ocm rename to lang/occam/headers/prints.ocm diff --git a/lang/occam/lib/pmfile b/lang/occam/lib/pmfile index cef68e11a..2970a29be 100644 --- a/lang/occam/lib/pmfile +++ b/lang/occam/lib/pmfile @@ -3,8 +3,8 @@ local d = ROOTDIR.."lang/occam/lib/" -lang_occam_runtime = acklibrary { - ACKINCLUDES = {PARENT, "%ROOTDIR%h", "%ROOTDIR%include/_tail_cc"}, +lang_occam_lib_runtime = acklibrary { + ACKINCLUDES = {PARENT, "%ROOTDIR%h"}, ackfile (d.."builtin.c"), ackfile (d.."chan_strct.c"), @@ -17,5 +17,5 @@ lang_occam_runtime = acklibrary { ackfile (d.."par_misc.e"), ackfile (d.."parco.c"), - install = pm.install("%BINDIR%%PLATIND%/%ARCH%/tail_ocm") + install = pm.install("%BINDIR%%PLATIND%/%PLATFORM%/tail_ocm") } diff --git a/lang/occam/pmfile b/lang/occam/pmfile index 5ab78f51e..7c46574af 100644 --- a/lang/occam/pmfile +++ b/lang/occam/pmfile @@ -5,3 +5,16 @@ local d = ROOTDIR.."lang/occam/" include (d.."comp/pmfile") include (d.."lib/pmfile") + +local headers = group { + install = { + pm.install(d.."headers/dec.ocm", "%BINDIR%include/occam/dec.ocm"), + pm.install(d.."headers/printd.ocm", "%BINDIR%include/occam/printd.ocm"), + pm.install(d.."headers/prints.ocm", "%BINDIR%include/occam/prints.ocm"), + } +} + +lang_occam_runtime = group { + headers, + lang_occam_lib_runtime +} diff --git a/lang/pc/libpc/pmfile b/lang/pc/libpc/pmfile index b493f533e..1d84e39eb 100644 --- a/lang/pc/libpc/pmfile +++ b/lang/pc/libpc/pmfile @@ -3,9 +3,13 @@ local d = ROOTDIR.."lang/pc/libpc/" -lang_pc_runtime = acklibrary { - ACKINCLUDES = {PARENT, "%ROOTDIR%h", "%ROOTDIR%include/_tail_cc"}, +head = ackfile { + file (d.."head_pc.e"), + install = pm.install("%BINDIR%%PLATIND%/%PLATFORM%/head_pc") +} + +tail = acklibrary { ackfile (d.."abi.c"), ackfile (d.."abl.c"), ackfile (d.."abr.c"), @@ -79,5 +83,13 @@ lang_pc_runtime = acklibrary { ackfile (d.."rcka.c"), ackfile (d.."trp.e"), - install = pm.install("%BINDIR%%PLATIND%/%ARCH%/tail_pc") + install = pm.install("%BINDIR%%PLATIND%/%PLATFORM%/tail_pc") } + +lang_pc_runtime = group { + ACKINCLUDES = {PARENT, "%ROOTDIR%h"}, + + head, + tail +} + diff --git a/lib/descr/fe b/lib/descr/fe index cb978f8b0..794d11758 100644 --- a/lib/descr/fe +++ b/lib/descr/fe @@ -4,8 +4,10 @@ # Don't generate line updating code by default (i.e.: -L flag provided to cem). # To put it on again: use -NL var LFLAG=-L -var C_INCLUDES=-I{EM}/include/_tail_cc -var ANSI_C_INCLUDES=-I{EM}/include/tail_ac +var MODULA2_INCLUDES=-I{EM}/include/m2 +var OCCAM_INCLUDES=-I{EM}/include/occam +var C_INCLUDES=-I{EM}/include/knr +var ANSI_C_INCLUDES=-I{EM}/include/ansi callname ack name cpp @@ -19,14 +21,15 @@ name cpp mapflag -C CPP_F={CPP_F?} -C mapflag -wo CPP_F={CPP_F?} -o mapflag -ansi ANSI_C=.ansi - args {CPP_F?} ({SUFFIX?}:.ocm=-I{EM}/include/occam) \ - -D__{NAME} \ + args {CPP_F?} \ + ({SUFFIX?}:.ocm={OCCAM_INCLUDES}) \ + -D__{ARCH} -D__{PLATFORM} \ -D__ACK \ {SYSINCLUDES?} \ ({ANSI_C?}:.ansi={ANSI_C_INCLUDES}) \ {C_INCLUDES} \ {INCLUDES?} \ - ({ANSI_C?.xx}:.xx=-D{NAME} \ + ({ANSI_C?.xx}:.xx=-D{ARCH} \ -DEM_WSIZE={w} -DEM_PSIZE={p} \ -DEM_SSIZE={s} -DEM_LSIZE={l} -DEM_FSIZE={f} -DEM_DSIZE={d}) \ -D_EM_WSIZE={w} -D_EM_PSIZE={p} \ @@ -75,13 +78,13 @@ name cem need .c args \ {CPP_F?} \ - -D__{NAME} \ + -D__{ARCH} -D__{PLATFORM} \ -D__ACK \ {SYSINCLUDES?} \ ({ANSI_C?}:.ansi={ANSI_C_INCLUDES}) \ {C_INCLUDES} \ {INCLUDES?} \ - ({ANSI_C?.xx}:.xx=-D{NAME} \ + ({ANSI_C?.xx}:.xx=-D{ARCH} \ -DEM_WSIZE={w} -DEM_PSIZE={p} \ -DEM_SSIZE={s} -DEM_LSIZE={l} -DEM_FSIZE={f} -DEM_DSIZE={d}) \ -D_EM_WSIZE={w} -D_EM_PSIZE={p} \ @@ -133,7 +136,7 @@ name m2 mapflag -V* M2_F={M2_F?} -V* mapflag --* M2_F={M2_F?} -* args \ - {M2_INCL?} -I{EM}/lib/m2 {M2SYSLIB?} \ + {M2_INCL?} {MODULA2_INCLUDES} {M2SYSLIB?} \ -Vw{w}.{w}i{w}.{w}p{p}.{w}l{l}.{w}f{f}.{w}d{d}.{w} \ {M2_ALIGN?} {M2_F?} < > prep cond diff --git a/mach/i86/libem/pmfile b/mach/i86/libem/pmfile new file mode 100644 index 000000000..b0baa9ede --- /dev/null +++ b/mach/i86/libem/pmfile @@ -0,0 +1,71 @@ +-- $Source$ +-- $State$ +-- $Revision$ + +local d = ROOTDIR.."mach/i86/libem/" + +libem_i86 = acklibrary { + outputs = {"%U%/libem-%PLATFORM%.a"}, + + ackfile (d.."adi.s"), + ackfile (d.."and.s"), + ackfile (d.."cii.s"), + ackfile (d.."cms.s"), + ackfile (d.."cmi4.s"), + ackfile (d.."cmu4.s"), + ackfile (d.."com.s"), + ackfile (d.."csa2.s"), + ackfile (d.."csb2.s"), + ackfile (d.."csa4.s"), + ackfile (d.."csb4.s"), + ackfile (d.."cuu.s"), + ackfile (d.."dup.s"), + ackfile (d.."dvi.s"), + ackfile (d.."dvi4.s"), + ackfile (d.."dvu.s"), + ackfile (d.."dvu4.s"), + ackfile (d.."exg.s"), + ackfile (d.."fp8087.s"), + ackfile (d.."gto.s"), + ackfile (d.."iaar.s"), + ackfile (d.."ilar.s"), + ackfile (d.."inn.s"), + ackfile (d.."ior.s"), + ackfile (d.."isar.s"), + ackfile (d.."lar2.s"), + ackfile (d.."loi.s"), + ackfile (d.."mli.s"), + ackfile (d.."mli4.s"), + ackfile (d.."mon.s"), + ackfile (d.."ngi.s"), + ackfile (d.."nop.s"), + ackfile (d.."rck.s"), + ackfile (d.."rmi.s"), + ackfile (d.."rmi4.s"), + ackfile (d.."rmu.s"), + ackfile (d.."rmu4.s"), + ackfile (d.."rol.s"), + ackfile (d.."ror.s"), + ackfile (d.."sar2.s"), + ackfile (d.."sbi.s"), + ackfile (d.."set.s"), + ackfile (d.."sli.s"), + ackfile (d.."sri.s"), + ackfile (d.."sti.s"), + ackfile (d.."strhp.s"), + ackfile (d.."xor.s"), + ackfile (d.."error.s"), + ackfile (d.."unknown.s"), + ackfile (d.."fat.s"), + ackfile (d.."trp.s"), + ackfile (d.."print.s"), + ackfile (d.."ret6.s"), + ackfile (d.."ret8.s"), + ackfile (d.."lfr6.s"), + ackfile (d.."lfr8.s"), + ackfile (d.."retarea.s"), + ackfile (d.."blm.s"), + ackfile (d.."return.s"), + + install = pm.install("%BINDIR%lib/%PLATFORM%/libem.a"), +} diff --git a/mach/i86/libend/pmfile b/mach/i86/libend/pmfile new file mode 100644 index 000000000..4b6843bd0 --- /dev/null +++ b/mach/i86/libend/pmfile @@ -0,0 +1,16 @@ +-- $Source$ +-- $State$ +-- $Revision$ + +local d = ROOTDIR.."mach/i86/libend/" + +libend_i86 = acklibrary { + outputs = {"%U%/libend-%PLATFORM%.a"}, + + ackfile (d.."edata.s"), + ackfile (d.."em_end.s"), + ackfile (d.."end.s"), + ackfile (d.."etext.s"), + + install = pm.install("%BINDIR%lib/%PLATFORM%/libend.a"), +} diff --git a/mach/i86/pmfile b/mach/i86/pmfile index c089fd934..5f1546c47 100644 --- a/mach/i86/pmfile +++ b/mach/i86/pmfile @@ -3,21 +3,19 @@ local d = ROOTDIR.."mach/i86/" +include (d.."libem/pmfile") +include (d.."libend/pmfile") + mach_i86 = group { - ARCH = "i86", - proto_as, proto_ncg { ARCHDIR = "i86" }, ego_descr, - - install = pm.install("%ROOTDIR%/lib/%ARCH%/descr", "%BINDIR%%PLATIND%/%ARCH%/descr") } --- Revision history --- $Log$ --- Revision 1.2 2006-07-22 00:52:01 dtrg --- Added support for the ego global optimisation suite. --- --- Revision 1.1 2006/07/20 23:18:18 dtrg --- First version in CVS. --- +support_i86 = group { + OPTIMISATION = "-O", + + libem_i86, + libend_i86, +} + diff --git a/mach/proto/as/pmfile b/mach/proto/as/pmfile index da82a1cef..c6a33d502 100644 --- a/mach/proto/as/pmfile +++ b/mach/proto/as/pmfile @@ -17,9 +17,10 @@ local parser = yacc { local cfile_with_tables = cfile { class = "cfile_with_tables", + CINCLUDES = {PARENT, "%ROOTDIR%mach/%ARCH%/as"}, + dynamicheaders = { parser, - file (ROOTDIR.."mach/%ARCH%/as/") } } @@ -39,13 +40,20 @@ proto_as = cprogram { lib_object, - outputs = {"%U%/%ARCH%-as"}, - install = pm.install(BINDIR.."%PLATDEP%/%ARCH%/as") + outputs = {"%U%/%PLATFORM%-as"}, + install = pm.install(BINDIR.."%PLATDEP%/%PLATFORM%/as") } -- Revision history -- $Log$ --- Revision 1.3 2006-10-15 00:28:12 dtrg +-- Revision 1.4 2007-02-20 00:45:19 dtrg +-- Done a major overhaul of the way target include files are installed and +-- how platform libraries are built. The ARCH pm variable has now been +-- renamed PLATFORM (which is more accurate) and a different ARCH +-- variable added, which represents the CPU family rather than the +-- hardware platform. +-- +-- Revision 1.3 2006/10/15 00:28:12 dtrg -- Updated to the version 0.1 of Prime Mover (which involves some syntax changes). -- -- Revision 1.2 2006/07/30 23:41:16 dtrg diff --git a/mach/proto/cg/pmfile b/mach/proto/cg/pmfile index aa0caab80..d74c4ecbc 100644 --- a/mach/proto/cg/pmfile +++ b/mach/proto/cg/pmfile @@ -4,15 +4,15 @@ local d = ROOTDIR.."mach/proto/cg/" local make_tables = cgg { - CGGINCLUDEDIR = (ROOTDIR.."mach/%ARCH%/cg/"), - file (ROOTDIR.."mach/%ARCH%/cg/table") + CGGINCLUDEDIR = (ROOTDIR.."mach/%PLATFORM%/cg/"), + file (ROOTDIR.."mach/%PLATFORM%/cg/table") } local cfile_with_tables = cfile { class = "cfile_with_tables", dynamicheaders = { make_tables, - file (ROOTDIR.."mach/%ARCH%/cg/"), + file (ROOTDIR.."mach/%PLATFORM%/cg/"), file (ROOTDIR.."mach/") } } @@ -39,7 +39,7 @@ proto_cg = cprogram { cfile { ith { make_tables, i = 1 }, dynamicheaders = { - file (ROOTDIR.."mach/%ARCH%/cg/"), + file (ROOTDIR.."mach/%PLATFORM%/cg/"), file (d) } }, @@ -47,13 +47,20 @@ proto_cg = cprogram { lib_em_data, lib_flt_arith, - outputs = {"%U%/%ARCH%-cg"}, - install = pm.install("%BINDIR%%PLATDEP%/%ARCH%/cg") + outputs = {"%U%/%PLATFORM%-cg"}, + install = pm.install("%BINDIR%%PLATDEP%/%PLATFORM%/cg") } -- Revision history -- $Log$ --- Revision 1.2 2006-10-15 00:28:12 dtrg +-- Revision 1.3 2007-02-20 00:45:19 dtrg +-- Done a major overhaul of the way target include files are installed and +-- how platform libraries are built. The ARCH pm variable has now been +-- renamed PLATFORM (which is more accurate) and a different ARCH +-- variable added, which represents the CPU family rather than the +-- hardware platform. +-- +-- Revision 1.2 2006/10/15 00:28:12 dtrg -- Updated to the version 0.1 of Prime Mover (which involves some syntax changes). -- -- Revision 1.1 2006/07/20 23:18:19 dtrg diff --git a/mach/proto/ncg/pmfile b/mach/proto/ncg/pmfile index 0f9126ee1..1a047b669 100644 --- a/mach/proto/ncg/pmfile +++ b/mach/proto/ncg/pmfile @@ -20,7 +20,7 @@ proto_ncg = cprogram { CINCLUDES = { PARENT, - "mach/%ARCH%/ncg", + "mach/%PLATFORM%/ncg", "mach/%ARCHDIR%/ncg", "mach" }, @@ -50,6 +50,6 @@ proto_ncg = cprogram { lib_em_data, lib_flt_arith, - outputs = {"%U%/%ARCH%-ncg"}, - install = pm.install("%BINDIR%%PLATDEP%/%ARCH%/ncg") + outputs = {"%U%/%PLATFORM%-ncg"}, + install = pm.install("%BINDIR%%PLATDEP%/%PLATFORM%/ncg") } diff --git a/mach/proto/top/pmfile b/mach/proto/top/pmfile index 7434d8deb..acca4c36b 100644 --- a/mach/proto/top/pmfile +++ b/mach/proto/top/pmfile @@ -4,7 +4,7 @@ local d = ROOTDIR.."mach/proto/top/" local make_tables = topgen { - file (ROOTDIR.."mach/%ARCH%/top/table") + file (ROOTDIR.."mach/%PLATFORM%/top/table") } local cfile_with_tables = cfile { @@ -17,7 +17,7 @@ local cfile_with_tables = cfile { proto_top = cprogram { CINCLUDES = { PARENT, - "mach/%ARCH%/ncg", + "mach/%PLATFORM%/ncg", "mach", d }, @@ -27,13 +27,20 @@ proto_top = cprogram { lib_string, - outputs = {"%U%/%ARCH%-top"}, - install = pm.install("%BINDIR%%PLATDEP%/%ARCH%/top") + outputs = {"%U%/%PLATFORM%-top"}, + install = pm.install("%BINDIR%%PLATDEP%/%PLATFORM%/top") } -- Revision history -- $Log$ --- Revision 1.2 2006-10-15 00:28:12 dtrg +-- Revision 1.3 2007-02-20 00:45:19 dtrg +-- Done a major overhaul of the way target include files are installed and +-- how platform libraries are built. The ARCH pm variable has now been +-- renamed PLATFORM (which is more accurate) and a different ARCH +-- variable added, which represents the CPU family rather than the +-- hardware platform. +-- +-- Revision 1.2 2006/10/15 00:28:12 dtrg -- Updated to the version 0.1 of Prime Mover (which involves some syntax changes). -- -- Revision 1.1 2006/07/22 12:31:19 dtrg diff --git a/pmfile b/pmfile index fbc8c0bce..ba46d90a3 100644 --- a/pmfile +++ b/pmfile @@ -7,6 +7,7 @@ include "first/yacc.pm" include "first/llgen.pm" include "config.pm" include "first/ack.pm" +include "first/ack-custom.pm" CINCLUDES = { ROOTDIR.."h", @@ -18,6 +19,8 @@ CINCLUDES = { include "util/data/pmfile" +include "util/LLgen/pmfile-ack" + include "modules/src/alloc/pmfile" include "modules/src/assert/pmfile" include "modules/src/system/pmfile" @@ -55,14 +58,15 @@ include "lang/occam/pmfile" include "lang/basic/pmfile" include "mach/proto/pmfile" + +include "mach/i386/pmfile" +--[[ include "mach/6500/pmfile" include "mach/6800/pmfile" include "mach/6805/pmfile" include "mach/6809/pmfile" include "mach/arm/pmfile" -include "mach/i386/pmfile" include "mach/i80/pmfile" -include "mach/i86/pmfile" include "mach/m68020/pmfile" include "mach/m68k2/pmfile" include "mach/m68k4/pmfile" @@ -72,6 +76,7 @@ include "mach/s2650/pmfile" include "mach/vax4/pmfile" include "mach/z80/pmfile" include "mach/z8000/pmfile" +--]] -- This is the list of language runtimes that is built for each architecture. @@ -84,7 +89,16 @@ lang_runtimes = group { lang_basic_runtime, } +-- Include the platform descriptions. + +include "mach/i86/pmfile" -- generic i86 +include "plat/pc86/pmfile" -- PC standalone + default = group { + -- Lots of things use LLgen, so we need to build it first. + + tool_LLgen, + -- Some of the dependency management across modules isn't entirely -- complete, for simplicity; as a result, the order here is important. -- In particular, referencing a library does not cause the library to @@ -134,6 +148,10 @@ default = group { lang_occam_compiler, lang_basic_compiler, + -- Build the code generators and the architecture-independent + -- libraries. + +--[[ mach_6500, lang_runtimes { ARCH="6500", OPTIMISATION="-O" }, @@ -144,9 +162,6 @@ default = group { mach_i386, lang_runtimes { ARCH="i386", OPTIMISATION="-O" }, mach_i80, lang_runtimes { ARCH="i80", OPTIMISATION="-O" }, - mach_i86, support_i86, - lang_runtimes { ARCH="i86", OPTIMISATION="-O" }, - mach_m68020, lang_runtimes { ARCH="m68020", OPTIMISATION="-O" }, -- mach_m68k2, lang_runtimes { ARCH="m68k2", OPTIMISATION="-O" }, -- mach_m68k4, lang_runtimes { ARCH="m68k4", OPTIMISATION="-O" }, @@ -156,6 +171,11 @@ default = group { -- mach_vax4, lang_runtimes { ARCH="vax4", OPTIMISATION="-O" }, mach_z80, lang_runtimes { ARCH="z80", OPTIMISATION="-O" }, mach_z8000, lang_runtimes { ARCH="z8000", OPTIMISATION="-O" }, +--]] + + -- Build the platform-specific libraries. + + platform_pc86 } -- Ensure that the work directories exist.