# makefile for cc
#
-CFLAGS=-DCROSSDIR="\"${CROSSDIR}\"" -DSTAGEDIR="\"${STAGEDIR}\""
+CFLAGS=-DCROSSDIR="${CROSSDIR}" -DSTAGEDIR="${STAGEDIR}"
SEPFLAG=-i
all: cc
ROOT="`pwd |sed -e 's/\/bin\/cc$//'`"
CC="cc -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
mkdir --parents "$ROOT/cross/bin"
-make CC="$CC" CROSSDIR="$ROOT/cross" STAGEDIR="$ROOT/stage" SEPFLAG= && \
+make CC="$CC" CROSSDIR="\\\"$ROOT/cross\\\"" STAGEDIR="\\\"$ROOT/stage\\\"" SEPFLAG= && \
make DESTDIR="$ROOT/cross" install
MAN=ld.0
MANSRC=ld.1
-CFLAGS=-O -I../ar -DSTAGEDIR="\"${STAGEDIR}\"" -DNUM_VM_PAGES=20
+CFLAGS=-O -I../ar -DSTAGEDIR="${STAGEDIR}" -DNUM_VM_PAGES=20
SEPFLAG=-i
all: ld ld.0
CC="cc -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
mkdir --parents "$ROOT/cross/bin"
mkdir --parents "$ROOT/cross/usr/man/cat1"
-make CC="$CC" STAGEDIR="$ROOT/stage" SEPFLAG= LDFLAGS="-L$ROOT/cross/usr/lib" && \
+make CC="$CC" STAGEDIR="\\\"$ROOT/stage\\\"" SEPFLAG= LDFLAGS="-L$ROOT/cross/usr/lib" && \
make DESTDIR="$ROOT/cross" install
# DO NOT DELETE THIS LINE -- make depend uses it
-arithmetic: arithmetic.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-arithmetic: /home/nick/src/211bsd.git/stage/usr/include/signal.h
-banner: banner.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-bcd: bcd.c
-cfscores: cfscores.c /home/nick/src/211bsd.git/stage/usr/include/pwd.h
-factor: factor.c
-fish: fish.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-morse: morse.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-morse: /home/nick/src/211bsd.git/stage/usr/include/ctype.h
-number: number.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-ppt: ppt.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-wump: wump.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-wump: /home/nick/src/211bsd.git/stage/usr/include/sgtty.h
-wump: /home/nick/src/211bsd.git/stage/usr/include/sys/ioctl.h
-wump: /home/nick/src/211bsd.git/stage/usr/include/sys/ttychars.h
-wump: /home/nick/src/211bsd.git/stage/usr/include/sys/ttydev.h
-canfield: canfield.c /home/nick/src/211bsd.git/stage/usr/include/curses.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/sgtty.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/sys/ioctl.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/sys/ttychars.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/sys/ttydev.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/ctype.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/signal.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/sys/select.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
-primes: primes.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-primes: /home/nick/src/211bsd.git/stage/usr/include/math.h
-rain: rain.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-rain: /home/nick/src/211bsd.git/stage/usr/include/sgtty.h
-rain: /home/nick/src/211bsd.git/stage/usr/include/sys/ioctl.h
-rain: /home/nick/src/211bsd.git/stage/usr/include/sys/ttychars.h
-rain: /home/nick/src/211bsd.git/stage/usr/include/sys/ttydev.h
-rain: /home/nick/src/211bsd.git/stage/usr/include/signal.h
-worm: worm.c /home/nick/src/211bsd.git/stage/usr/include/ctype.h
-worm: /home/nick/src/211bsd.git/stage/usr/include/curses.h
-worm: /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-worm: /home/nick/src/211bsd.git/stage/usr/include/sgtty.h
-worm: /home/nick/src/211bsd.git/stage/usr/include/sys/ioctl.h
-worm: /home/nick/src/211bsd.git/stage/usr/include/sys/ttychars.h
-worm: /home/nick/src/211bsd.git/stage/usr/include/sys/ttydev.h
-worm: /home/nick/src/211bsd.git/stage/usr/include/signal.h
-worms: worms.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-worms: /home/nick/src/211bsd.git/stage/usr/include/sgtty.h
-worms: /home/nick/src/211bsd.git/stage/usr/include/sys/ioctl.h
-worms: /home/nick/src/211bsd.git/stage/usr/include/sys/ttychars.h
-worms: /home/nick/src/211bsd.git/stage/usr/include/sys/ttydev.h
-worms: /home/nick/src/211bsd.git/stage/usr/include/signal.h
-arithmetic: arithmetic.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-arithmetic: /home/nick/src/211bsd.git/stage/usr/include/signal.h
-banner: banner.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-bcd: bcd.c
-cfscores: cfscores.c /home/nick/src/211bsd.git/stage/usr/include/pwd.h
-factor: factor.c
-fish: fish.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-morse: morse.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-morse: /home/nick/src/211bsd.git/stage/usr/include/ctype.h
-number: number.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-ppt: ppt.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-wump: wump.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-wump: /home/nick/src/211bsd.git/stage/usr/include/sgtty.h
-wump: /home/nick/src/211bsd.git/stage/usr/include/sys/ioctl.h
-wump: /home/nick/src/211bsd.git/stage/usr/include/sys/ttychars.h
-wump: /home/nick/src/211bsd.git/stage/usr/include/sys/ttydev.h
-canfield: canfield.c /home/nick/src/211bsd.git/stage/usr/include/curses.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/sgtty.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/sys/ioctl.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/sys/ttychars.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/sys/ttydev.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/ctype.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/signal.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/sys/select.h
-canfield: /home/nick/src/211bsd.git/stage/usr/include/sys/types.h
-primes: primes.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-primes: /home/nick/src/211bsd.git/stage/usr/include/math.h
-rain: rain.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-rain: /home/nick/src/211bsd.git/stage/usr/include/sgtty.h
-rain: /home/nick/src/211bsd.git/stage/usr/include/sys/ioctl.h
-rain: /home/nick/src/211bsd.git/stage/usr/include/sys/ttychars.h
-rain: /home/nick/src/211bsd.git/stage/usr/include/sys/ttydev.h
-rain: /home/nick/src/211bsd.git/stage/usr/include/signal.h
-worm: worm.c /home/nick/src/211bsd.git/stage/usr/include/ctype.h
-worm: /home/nick/src/211bsd.git/stage/usr/include/curses.h
-worm: /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-worm: /home/nick/src/211bsd.git/stage/usr/include/sgtty.h
-worm: /home/nick/src/211bsd.git/stage/usr/include/sys/ioctl.h
-worm: /home/nick/src/211bsd.git/stage/usr/include/sys/ttychars.h
-worm: /home/nick/src/211bsd.git/stage/usr/include/sys/ttydev.h
-worm: /home/nick/src/211bsd.git/stage/usr/include/signal.h
-worms: worms.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
-worms: /home/nick/src/211bsd.git/stage/usr/include/sgtty.h
-worms: /home/nick/src/211bsd.git/stage/usr/include/sys/ioctl.h
-worms: /home/nick/src/211bsd.git/stage/usr/include/sys/ttychars.h
-worms: /home/nick/src/211bsd.git/stage/usr/include/sys/ttydev.h
-worms: /home/nick/src/211bsd.git/stage/usr/include/signal.h
arithmetic: arithmetic.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
arithmetic: /home/nick/src/211bsd.git/stage/usr/include/signal.h
banner: banner.c /home/nick/src/211bsd.git/stage/usr/include/stdio.h
LIB= /lib
c2: c20.o c21.o
- cc ${CFLAGS} ${SEPFLAG} -o c2 c20.o c21.o
+ ${CC} ${CFLAGS} ${SEPFLAG} -o c2 c20.o c21.o
c20.o c21.o: c2.h
LDC0FLAGS= -i
LDC1FLAGS= -n
# this is used for cvopt:
-PURFLAG=-n
+#PURFLAG=-n
DESTDIR =
LIB=/lib
./cvopt < optable > junk.c
${CC} -S junk.c
sed 's/\.data/\.text/' < junk.s > junk.i
- as -o table.o junk.i
+ ${AS} -o table.o junk.i
rm -f junk.i junk.c junk.s
+# for cross compiling, to access the host compiler we use cc not ${CC}
cvopt: cvopt.c
- ${CC} ${PURFLAG} -s -O -o cvopt cvopt.c
+ cc ${PURFLAG} -s -O -o cvopt cvopt.c
install: c0 c1
-mv ${DESTDIR}${LIB}/c0 ${DESTDIR}${LIB}/oc0
-mv ${DESTDIR}${LIB}/c1 ${DESTDIR}${LIB}/oc1
install -s c0 ${DESTDIR}${LIB}/c0
- install -s c1 ${DESTDIR}${LIB}/c1
+# install -s c1 ${DESTDIR}${LIB}/c1
+ install c1 ${DESTDIR}${LIB}/c1
restore:
mv ${DESTDIR}${LIB}/oc0 ${DESTDIR}${LIB}/c0
#ifndef _C0_H
#define _C0_H 1
-#include <stdint.h>
#include <stdio.h>
#include "krcompat.h"
+#ifdef pdp11
+#define _INT int
+#define _LONG long
+#define _UNSIGNED_INT unsigned int
+#define _UNSIGNED_LONG unsigned long
+#else
+#include <stdint.h>
+#define _INT int16_t
+#define _LONG int32_t
+#define _UNSIGNED_INT uint16_t
+#define _UNSIGNED_LONG uint32_t
+#endif
+
/*
* This parameter is the _only_ one which affects the recognized length
* of symbols. Symbol names are dynamically allocated and null terminated
#define MAXCPS 32 /* # chars per symbol */
-#define LTYPE long /* change to int if no long consts */
#define MAXINT 077777 /* Largest positive short integer */
#define MAXUINT 0177777 /* largest unsigned integer */
#define HSHSIZ 300 /* # entries in hash table for names */
#define MAXPATHLEN 1024
#endif
+
/*
* # bytes in primitive types
*/
extern int proflg;
extern struct nmlist *csym;
extern int cval;
-extern LTYPE lcval;
+extern _LONG lcval;
extern int nchstr;
extern int nerror;
extern struct nmlist *paraml;
register union tree *p;
/*fprintf(stderr, "block(%d, %d, {%d, %d}, {%d, %d})\n", op, t,
- (op == NAME) ? -2 : (p1 ? (int)(int16_t)p1->t.op : -1),
- (op == NAME) ? -2 : (p1 ? (int)(int16_t)p1->t.type : -1),
- (op == FSEL) ? -3 : (p2 ? (int)(int16_t)p2->t.op : -1),
- (op == FSEL) ? -3 : (p2 ? (int)(int16_t)p2->t.type : -1));*/
+ (op == NAME) ? -2 : (p1 ? (int)(_INT)p1->t.op : -1),
+ (op == NAME) ? -2 : (p1 ? (int)(_INT)p1->t.type : -1),
+ (op == FSEL) ? -3 : (p2 ? (int)(_INT)p2->t.op : -1),
+ (op == FSEL) ? -3 : (p2 ? (int)(_INT)p2->t.type : -1));*/
p = (union tree *)Tblock(sizeof(struct tnode));
p->t.op = op;
p->t.type = t;
if (v2==1)
break;
if (v2<0) {
- v1 = (uint16_t)v1 >= (uint16_t)v2;
+ v1 = (_UNSIGNED_INT)v1 >= (_UNSIGNED_INT)v2;
break;
}
- v1 = (uint16_t)v1 / v2;
+ v1 = (_UNSIGNED_INT)v1 / v2;
break;
}
v1 /= v2;
break;
}
if (v2<0) {
- if ((uint16_t)v1 >= (uint16_t)v2)
+ if ((_UNSIGNED_INT)v1 >= (_UNSIGNED_INT)v2)
v1 -= v2;
break;
}
- v1 = (uint16_t)v1 % v2;
+ v1 = (_UNSIGNED_INT)v1 % v2;
break;
}
v1 %= v2;
case RSHIFT:
if (unsignf) {
- v1 = (uint16_t)v1 >> v2;
+ v1 = (_UNSIGNED_INT)v1 >> v2;
break;
}
v1 >>= v2;
break;
case LESSP:
- v1 = (uint16_t)v1<v2;
+ v1 = (_UNSIGNED_INT)v1<v2;
break;
case GREATP:
- v1 = (uint16_t)v1>v2;
+ v1 = (_UNSIGNED_INT)v1>v2;
break;
case LESSEQP:
- v1 = (uint16_t)v1<=v2;
+ v1 = (_UNSIGNED_INT)v1<=v2;
break;
case GREATQP:
- v1 = (uint16_t)v1>=v2;
+ v1 = (_UNSIGNED_INT)v1>=v2;
break;
divchk:
break;
case LCON:
- outcode("BNNN", tp->l.op, tp->l.type, (uint16_t)(tp->l.lvalue>>16),
- (uint16_t)tp->l.lvalue);
+ outcode("BNNN", tp->l.op, tp->l.type, (_UNSIGNED_INT)(tp->l.lvalue>>16),
+ (_UNSIGNED_INT)tp->l.lvalue);
break;
case CON:
return(0);
}
n *= elsz;
- if (n >= (uint16_t)50000)
+ if (n >= (_UNSIGNED_INT)50000)
werror("very large data structure");
return(n);
}
int proflg;
struct nmlist *csym;
int cval;
-LTYPE lcval;
+_LONG lcval;
int nchstr;
int nerror;
struct nmlist *paraml;
#ifndef _C1_H
#define _C1_H 1
-#include <stdint.h>
#include <stdio.h>
#include <setjmp.h>
#include "krcompat.h"
-#define LTYPE long /* change to int for no long consts */
+#ifdef pdp11
+#define _INT int
+#define _LONG long
+#define _UNSIGNED_INT unsigned int
+#define _UNSIGNED_LONG unsigned long
+#else
+#include <stdint.h>
+#define _INT int16_t
+#define _LONG int32_t
+#define _UNSIGNED_INT uint16_t
+#define _UNSIGNED_LONG uint32_t
+#endif
+
#ifndef NULL
#define NULL 0
#endif
struct tconst {
int op;
int type;
- int16_t value;
+ _INT value;
};
/*
struct lconst {
int op;
int type;
-#if pdp11
- LTYPE lvalue;
-#else
- uint16_t lvalue[2];
-#endif
+ _LONG lvalue;
};
/*
int sideeffects PARAMS((register union tree *tp));
void distrib PARAMS((struct acl *list));
void squash PARAMS((union tree **p, union tree **maxp));
-void _const PARAMS((int op, register int16_t *vp, int v, int type));
+void _const PARAMS((int op, register _INT *vp, _INT v, int type));
union tree *lconst PARAMS((int op, register union tree *lp, register union tree *rp));
void insert PARAMS((int op, register union tree *tree, register struct acl *list));
union tree *tnode PARAMS((int op, int type, union tree *tr1, union tree *tr2));
union tree *isconstant PARAMS((register union tree *t));
union tree *hardlongs PARAMS((register union tree *t));
int uns PARAMS((union tree *tp));
-/* c13.c */
+#ifndef pdp11
/* pdp11_atof.c */
void pdp11_atof PARAMS((char *p));
/* pdp11_fp.c */
int32_t fpnotrap PARAMS((int32_t code));
/* pdp11_ldexp.c */
void pdp11_ldexp PARAMS((uint16_t *value, int exp));
+#endif
#endif
setbuf(stdin,buf1); /* sbrk problems */
getree();
}
- if (totspace >= (uint16_t)56000)
+ if (totspace >= (_UNSIGNED_INT)56000)
werror("possibly too much data");
exit(nerror!=0);
}
string = opt->tabstring;
p1 = tree->t.tr1;
if (p1->t.op==FCON && p1->f.value>0) {
-#if 1
+#ifdef pdp11
+/* nonportable */
printf(".data\nL%d:%o;%o;%o;%o\n.text\n", p1->f.value,
- p1->f.fvalue[0], p1->f.fvalue[1],
- p1->f.fvalue[2], p1->f.fvalue[3]);
- p1->f.value = -p1->f.value;
+ ((_UNSIGNED_INT *)&(p1->f.fvalue))[0],
+ ((_UNSIGNED_INT *)&(p1->f.fvalue))[1],
+ ((_UNSIGNED_INT *)&(p1->f.fvalue))[2],
+ ((_UNSIGNED_INT *)&(p1->f.fvalue))[3] );
#else
-/* nonportable */
printf(".data\nL%d:%o;%o;%o;%o\n.text\n", p1->f.value,
- ((uint16_t *)&(p1->f.fvalue))[0],
- ((uint16_t *)&(p1->f.fvalue))[1],
- ((uint16_t *)&(p1->f.fvalue))[2],
- ((uint16_t *)&(p1->f.fvalue))[3]);
-/* this did not cause problems because c.value is overlaid on f.value */
- p1->c.value = -p1->c.value;
+ p1->f.fvalue[0],
+ p1->f.fvalue[1],
+ p1->f.fvalue[2],
+ p1->f.fvalue[3] );
#endif
+ p1->f/*c*/.value = -p1->f/*c*/.value;
}
p2 = 0;
if (opdope[tree->t.op]&BINARY) {
p2 = tree->t.tr2;
if (p2->t.op==FCON && p2->f.value>0) {
-#if 1
+#ifdef pdp11
+/* nonportable */
printf(".data\nL%d:%o;%o;%o;%o\n.text\n", p2->f.value,
- p2->f.fvalue[0], p2->f.fvalue[1],
- p2->f.fvalue[2], p2->f.fvalue[3]);
+ ((_UNSIGNED_INT *)&(p2->f.fvalue))[0],
+ ((_UNSIGNED_INT *)&(p2->f.fvalue))[1],
+ ((_UNSIGNED_INT *)&(p2->f.fvalue))[2],
+ ((_UNSIGNED_INT *)&(p2->f.fvalue))[3] );
#else
-/* nonportable */
printf(".data\nL%d:%o;%o;%o;%o\n.text\n", p2->f.value,
- ((uint16_t *)&(p2->f.fvalue))[0],
- ((uint16_t *)&(p2->f.fvalue))[1],
- ((uint16_t *)&(p2->f.fvalue))[2],
- ((uint16_t *)&(p2->f.fvalue))[3]);
+ p2->f.fvalue[0],
+ p2->f.fvalue[1],
+ p2->f.fvalue[2],
+ p2->f.fvalue[3] );
#endif
p2->f.value = -p2->f.value;
}
size = tree->F.mask;
tree = tree->t.tr1;
tree = strfunc(tree);
- if (size <= sizeof(int16_t)) {
+ if (size <= sizeof(_INT)) {
paint(tree, INT);
goto normal;
}
- if (size <= sizeof(int32_t)) {
+ if (size <= sizeof(_LONG)) {
paint(tree, LONG);
goto normal;
}
* Compile an initializing expression
*/
void doinit(type, tree) register int type; register union tree *tree; {
-#if 1
- uint16_t sfval[2];
- uint16_t fval[4];
- uint16_t lval[2];
- int16_t sign;
-#else
+#ifdef pdp11
float sfval;
double fval;
- int32_t lval;
+#else
+ uint16_t temp[2];
+ uint16_t sfval[2];
+ uint16_t fval[4];
#endif
+ _LONG lval;
if (type==CHAR || type==UNCHAR) {
printf(".byte ");
if (tree->t.tr1->t.op!=FCON && tree->t.tr1->t.op!=SFCON)
goto illinit;
tree = tree->t.tr1;
-#if 1
#ifdef pdp11
- tree->c.value = *(double *)tree->f.fvalue;
+ tree->c.value = tree->f.fvalue;
#else
/* movf 6(r3),r0 */
pdp11_ldf(0, tree->f.fvalue, 063);
/* movfi r0, 4(r3) */
- pdp11_movfi(0, (uint16_t *)&tree->c.value, 063);
-#endif
-#else
- tree->c.value = tree->f.fvalue;
+ pdp11_movfi(0, temp, 063);
+ tree->c.value = (int16_t)temp[0];
#endif
tree->t.op = CON;
} else if (tree->t.op==LTOI) {
if (tree->t.tr1->t.op!=LCON)
goto illinit;
tree = tree->t.tr1;
-#if 1
-#ifdef pdp11
- *(int32_t *)lval = *(int32_t *)tree->l.lvalue;
-#else
- lval[0] = tree->l.lvalue[0];
- lval[1] = tree->l.lvalue[1];
-#endif
-#else
lval = tree->l.lvalue;
-#endif
tree->t.op = CON;
-#if 1
- tree->c.value = lval[1];
-#else
tree->c.value = lval;
-#endif
}
if (tree->t.op == CON)
printf("%o\n", UNS(tree->c.value));
case FLOAT:
if (tree->t.op==ITOF) {
if (tree->t.tr1->t.op==CON) {
-#if 1 /* note: this should be changed to respect the signedness of the int */
+/* note: this should be changed to respect the signedness of the int */
#ifdef pdp11
- *(double *)fval = tree->t.tr1->c.value;
+ fval = tree->t.tr1->c.value;
#else
/* movif 4(r0),r0 */
- pdp11_movif(0, (uint16_t *)&tree->t.tr1->c.value,
- 060);
-#endif
-#else
- fval = tree->t.tr1->c.value;
+ temp[0] = (uint16_t)tree->t.tr1->c.value;
+ pdp11_movif(0, temp, 060);
+ /* movf r0,-24(r5) */
+ pdp11_stf(0, fval, 065);
#endif
} else
goto illinit;
} else if (tree->t.op==FCON || tree->t.op==SFCON) {
-#if 1
#ifdef pdp11
- *(double *)fval = *(double *)tree->f.fvalue;
+ fval = tree->f.fvalue;
#else
/* movf 6(r3),r0 */
pdp11_ldf(0, tree->f.fvalue, 063);
-#endif
-#else
- fval = tree->f.fvalue;
+ /* movf r0,-24(r5) */
+ pdp11_stf(0, fval, 065);
#endif
} else if (tree->t.op==LTOF) {
if (tree->t.tr1->t.op!=LCON)
goto illinit;
-#if 1 /* note: this should be changed to respect the signedness of the long */
+/* note: this should be changed to respect the signedness of the long */
#ifdef pdp11
- *(double *)fval = *(long *)tree->t.tr1->l.lvalue;
+ fval = tree->t.tr1->l.lvalue;
#else
/* setl */
pdp11_setl();
/* movif 4(r0),r0 */
- pdp11_movif(0, tree->t.tr1->l.lvalue, 060);
+ temp[0] = (uint16_t)((tree->t.tr1->l.lvalue >> 16) & 0xffff);
+ temp[1] = (uint16_t)(tree->t.tr1->l.lvalue & 0xffff);
+ pdp11_movif(0, temp, 060);
/* seti */
pdp11_seti();
-#endif
-#else
- fval = tree->t.tr1->l.lvalue;
+ /* movf r0,-24(r5) */
+ pdp11_stf(0, fval, 065);
#endif
} else
goto illinit;
-#if 1
-#ifndef PDP11
- /* movf r0,-24(r5) */
- pdp11_stf(0, fval, 065);
-#endif
-#endif
+ /* note: value is still in emulated r0 and used again below */
if (type==FLOAT) {
-#if 1
#ifdef pdp11
- *(float *)sfval = *(double *)fval;
+ sfval = fval;
+/*nonportable*/
+ printf("%o; %o\n",
+ ((_UNSIGNED_INT *)&sfval)[0],
+ ((_UNSIGNED_INT *)&sfval)[1]);
#else
/* movfo r0,-14(r5) */
pdp11_stcfo(0, sfval, 065);
-#endif
- printf("%o; %o\n", sfval[0], sfval[1]);
-#else
- sfval = fval;
-/*nonportable*/
printf("%o; %o\n",
- ((uint16_t *)&sfval)[0],
- ((uint16_t *)&sfval)[1]);
+ sfval[0],
+ sfval[1]);
#endif
} else {
-#if 1
+#ifdef pdp11
+/* nonportable */
printf("%o; %o; %o; %o\n",
- fval[0], fval[1], fval[2], fval[3]);
+ ((_UNSIGNED_INT *)&fval)[0],
+ ((_UNSIGNED_INT *)&fval)[1],
+ ((_UNSIGNED_INT *)&fval)[2],
+ ((_UNSIGNED_INT *)&fval)[3]);
#else
-/* nonportable */
printf("%o; %o; %o; %o\n",
- ((uint16_t *)&fval)[0],
- ((uint16_t *)&fval)[1],
- ((uint16_t *)&fval)[2],
- ((uint16_t *)&fval)[3]);
+ fval[0],
+ fval[1],
+ fval[2],
+ fval[3]);
#endif
}
return;
tree->t.op = FCON;
if (tree->t.op!= FCON)
goto illinit;
-#if 1
#ifdef pdp11
- *(int32_t *)lval = *(double *)tree->f.fvalue;
+ lval = tree->f.fvalue;
#else
/* movf 6(r3),r0 */
pdp11_ldf(0, tree->f.fvalue, 063);
/* setl */
pdp11_setl();
/* movfi r0,-30(r5) */
- pdp11_movfi(0, lval, 065);
+ pdp11_movfi(0, temp, 065);
+ lval = ((temp[0] & 0xffffL) << 16) | (temp[1] & 0xffffL);
/* seti */
pdp11_seti();
-#endif
-#else
- lval = tree->f.fvalue;
#endif
} else if (tree->t.op==ITOL) {
if (tree->t.tr1->t.op != CON)
goto illinit;
-#if 1
-#ifdef pdp11
- if (uns(tree->t.tr1))
- *(int32_t *)lval = (uint16_t)
- tree->t.tr1->c.value;
- else
- *(int32_t *)lval = tree->t.tr1->c.value;
-#else
- sign = uns(tree->t.tr1) ?
- 0 : (tree->t.tr1->c.value < 0);
- lval[1] = tree->t.tr1->c.value;
- lval[0] = -sign;
-#endif
-#else
if (uns(tree->t.tr1))
- lval = (uint16_t)tree->t.tr1->c.value;
+ lval = (_UNSIGNED_INT)tree->t.tr1->c.value;
else
lval = tree->t.tr1->c.value;
-#endif
} else if (tree->t.op==LCON) {
-#if 1
-#ifdef pdp11
- *(int32_t *)lval = *(int32_t *)tree->l.lvalue;
-#else
- lval[0] = tree->l.lvalue[0];
- lval[1] = tree->l.lvalue[1];
-#endif
-#else
lval = tree->l.lvalue;
-#endif
} else
goto illinit;
/* nonportable */
-#if 1
- printf("%o; %o\n", lval[0], lval[1]);
-#else
printf("%o; %o\n", UNS((lval>>16)), UNS(lval));
-#endif
return;
}
illinit:
switch(p->t.op) {
case LCON:
-#if 1
- printf("$%o", p->l.lvalue[(flag<=10) ? 0 : 1]);
-#else
printf("$%o", flag<=10? UNS(p->l.lvalue>>16):
UNS(p->l.lvalue));
-#endif
return;
case SFCON:
poctab[j] = 0;
for (swp=fp; swp<=lp; swp++)
/* lrem(0, swp->swval, i) */
- poctab[(uint16_t)swp->swval%i]++;
+ poctab[(_UNSIGNED_INT)swp->swval%i]++;
worst = 0;
for (j=0; j<i; j++)
if (poctab[j]>worst)
printf("L%d:", isn++);
for (swp=fp; swp<=lp; swp++) {
/* lrem(0, swp->swval, tabs) */
- if ((uint16_t)swp->swval%tabs == i) {
+ if ((_UNSIGNED_INT)swp->swval%tabs == i) {
/* ldiv(0, swp->swval, tabs) */
- breq((int)((uint16_t)swp->swval/tabs), swp->swlab);
+ breq((int)((_UNSIGNED_INT)swp->swval/tabs), swp->swlab);
}
}
printf("jbr L%d\n", deflab);
case SSPACE:
printf(".=.+%o\n", UNS(t=geti()));
- totspace += (uint16_t)t;
+ totspace += (_UNSIGNED_INT)t;
break;
case EVEN:
tp = getblk(sizeof(struct lconst));
tp->t.op = LCON;
tp->t.type = LONG;
-#if 1
- tp->l.lvalue[0] = t;
- tp->l.lvalue[1] = op;
-#else
- tp->l.lvalue = ((int32_t)t<<16) + UNS(op); /* nonportable */
-#endif
+ tp->l.lvalue = ((_LONG)t<<16) + UNS(op); /* nonportable */
*sp++ = tp;
break;
tp->t.type = t;
tp->f.value = isn++;
#ifdef pdp11
- *(long *)tp->f.fvalue = atof(s);
+ tp->f.fvalue = atof(s);
#else
pdp11_atof(s);
/* movf r0,6(r4) */
}
int geti() {
- register int16_t i;
+ register int i;
i = getchar() & 0xff;
i |= (getchar() & 0xff) << 8;
register union tree *tp;
register int nwords, i;
- nwords = atp->F.mask/sizeof(int16_t);
+ nwords = atp->F.mask/sizeof(_INT);
tp = atp->t.tr1;
while (tp->t.op == SEQNC) {
rcexpr(tp->t.tr1, efftab, 0);
if (sfuncr.nloc==0) {
sfuncr.nloc = isn++;
printf(".bss\nL%d:.=.+%o\n.text\n", sfuncr.nloc,
- UNS(nwords*sizeof(int16_t)));
+ UNS(nwords*sizeof(_INT)));
}
atp->t.tr1 = tnode(ASSIGN, STRUCT, (union tree *)&sfuncr, tp->t.tr1);
strasg(atp);
tp->t.tr2 = strfunc(tp->t.tr2);
if (nwords==1)
paint(tp, INT);
- else if (nwords==sizeof(int16_t))
+ else if (nwords==sizeof(_INT))
paint(tp, LONG);
else {
if (tp->t.tr1->t.op!=NAME && tp->t.tr1->t.op!=STAR
error("Illegal indirection");
return(t);
}
- return(((uint16_t)t>>TYLEN) & ~TYPE | t&TYPE);
+ return(((_UNSIGNED_INT)t>>TYLEN) & ~TYPE | t&TYPE);
}
/*
register int op, dope;
int d1, d2;
union tree *t;
-#if 0
-/* nonportable */
- union { double dv; int16_t iv[4];} fp11;
+#ifdef pdp11
+ union { double dv; _INT iv[4];} fp11;
#endif
if (tree==NULL)
dope = opdope[op];
if ((dope&LEAF) != 0) {
if (op==FCON) {
-#if 1
- if (tree->f.fvalue[1]==0
- && tree->f.fvalue[2]==0
- && tree->f.fvalue[3]==0) {
- tree->t.op = SFCON;
- tree->f.value = tree->f.fvalue[0];
- }
-#else
-/* nonportable */
+#ifdef pdp11
fp11.dv = tree->f.fvalue;
if (fp11.iv[1]==0
&& fp11.iv[2]==0
tree->t.op = SFCON;
tree->f.value = fp11.iv[0];
}
+#else
+ if (tree->f.fvalue[1]==0
+ && tree->f.fvalue[2]==0
+ && tree->f.fvalue[3]==0) {
+ tree->t.op = SFCON;
+ /* I am 99% sure this is wrong (can only affect label numbering): */
+ tree->f.value = tree->f.fvalue[0];
+ }
#endif
}
return(tree);
case MINUS:
if ((t = isconstant(tree->t.tr2)) && (!uns(t) || tree->t.type!=LONG)
- && (t->t.type!=INT || t->c.value!=(int16_t)0100000)) {
+ && (t->t.type!=INT || t->c.value!=(_INT)0100000)) {
tree->t.op = PLUS;
if (t->t.type==DOUBLE) {
-#if 1
- if (t->f.value)
- t->f.value ^= 0100000;
-#else
-/* this did not cause problems because f.value is overlaid on c.value */
-/* this should have been checking for f.value == 0 to preserve clean zeros */
/* PDP-11 FP representation */
- t->c.value ^= 0100000;
-#endif
+ abort(); /* I am 99% sure this is wrong: t->c.value ^= 0100000; */
} else
t->c.value = -t->c.value;
}
union tree *unoptim(tree) register union tree *tree; {
register union tree *subtre, *p;
-#if 1
-#ifndef PDP11
- int16_t sign;
+#ifndef pdp11
+ _LONG temp_long;
uint16_t temp[2];
-#endif
#endif
if (tree==NULL)
subtre = getblk(sizeof(struct lconst));
subtre->t.op = LCON;
subtre->t.type = LONG;
-#if 1
-#ifdef pdp11
- *(int32_t *)subtre->l.lvalue = tree->t.tr1->c.value;
-#else
- sign = (tree->t.tr1->c.value < 0);
- subtre->l.lvalue[1] = tree->t.tr1->c.value;
- subtre->l.lvalue[0] = -sign;
-#endif
-#else
subtre->l.lvalue = tree->t.tr1->c.value;
-#endif
return(subtre);
}
break;
tree = getblk(sizeof(struct ftconst));
tree->t.op = FCON;
tree->t.type = DOUBLE;
- tree->c.value = isn++;
-#if 1
+ tree->f/*c*/.value = isn++;
#ifdef pdp11
- *(double *)tree->f.fvalue =
- *(int32_t *)subtre->l.lvalue;
+ tree->f.fvalue = subtre->l.lvalue;
#else
/* setl */
pdp11_setl();
/* movif 4(r3),r0 */
- pdp11_movif(0, subtre->l.lvalue, 063);
+ temp[0] = (uint16_t)((subtre->l.lvalue >> 16) & 0xffff);
+ temp[1] = (uint16_t)(subtre->l.lvalue & 0xffff);
+ pdp11_movif(0, temp, 063);
/* seti */
pdp11_seti();
/* movf r0,6(r4) */
pdp11_stf(0, tree->f.fvalue, 064);
-#endif
-#else
- tree->f.fvalue = subtre->l.lvalue;
#endif
return(optim(tree));
}
tree->t.op = FCON;
tree->t.type = DOUBLE;
tree->f.value = isn++;
-#if 1
#ifdef pdp11
if (uns(subtre))
- *(double *)tree->f.fvalue =
- (uint16_t)subtre->c.value;
+ tree->f.fvalue = (_UNSIGNED_INT)subtre->c.value;
else
- *(double *)tree->f.fvalue = subtre->c.value;
+ tree->f.fvalue = subtre->c.value;
#else
- sign = uns(subtre) ? 0 : (subtre->c.value < 0);
- temp[1] = subtre->c.value;
- temp[0] = -sign;
+ if (uns(subtre))
+ temp_long = (_UNSIGNED_INT)subtre->c.value;
+ else
+ temp_long = subtre->c.value;
+ temp[0] = (uint16_t)((temp_long >> 16) & 0xffff);
+ temp[1] = (uint16_t)(temp_long & 0xffff);
/* setl */
pdp11_setl();
/* movif (sp)+,r0 */
pdp11_seti();
/* movf r0,6(r4) */
pdp11_stf(0, tree->f.fvalue, 064);
-#endif
-#else
- if (uns(subtre))
- tree->f.fvalue = (uint16_t)subtre->c.value;
- else
- tree->f.fvalue = subtre->c.value;
#endif
return(optim(tree));
}
case LCON:
subtre->t.op = CON;
subtre->t.type = tree->t.type;
-#if 1
-#ifdef pdp11
- subtre->c.value = *(int32_t *)subtre->l.lvalue;
-#else
- subtre->c.value = subtre->l.lvalue[1];
-#endif
-#else
subtre->c.value = subtre->l.lvalue;
-#endif
return(subtre);
case NAME:
return(paint(subtre, tree->t.type));
}
if (subtre->t.op==LCON) {
-#if 1
-#ifdef pdp11
- *(int32_t *)subtre->l.lvalue =
- ~*(int32_t *)subtre->l.lvalue;
-#else
- subtre->l.lvalue[0] = ~subtre->l.lvalue[0];
- subtre->l.lvalue[1] = ~subtre->l.lvalue[1];
-#endif
-#else
subtre->l.lvalue = ~subtre->l.lvalue;
-#endif
return(subtre);
}
if (subtre->t.op==ITOL) {
tree = getblk(sizeof(struct lconst));
tree->t.op = LCON;
tree->t.type = LONG;
-#if 1
-#ifdef pdp11
- if (uns(subtre->t.tr1)) {
- *(int32_t *)tree->l.lvalue =
- ~(int32_t)(uint16_t)
- subtre->t.tr1->c.value;
- } else {
- *(int32_t *)tree->l.lvalue =
- ~subtre->t.tr1->c.value;
- }
-#else
- sign = uns(subtre->t.tr1) ?
- 0 : (subtre->t.tr1->c.value < 0);
- tree->l.lvalue[1] = ~subtre->t.tr1->c.value;
- tree->l.lvalue[0] = ~-sign;
-#endif
-#else
if (uns(subtre->t.tr1))
- tree->l.lvalue = ~(int32_t)(uint16_t)
+ tree->l.lvalue = ~(_LONG)(_UNSIGNED_INT)
subtre->t.tr1->c.value;
else
tree->l.lvalue =
~subtre->t.tr1->c.value;
-#endif
return(tree);
}
if (uns(subtre->t.tr1))
return(paint(subtre, tree->t.type));
}
if (subtre->t.op==LCON) {
-#if 1
-#ifdef pdp11
- *(int32_t *)subtre->l.lvalue =
- -*(int32_t *)subtre->l.lvalue;
-#else
- subtre->l.lvalue[1] = -subtre->l.lvalue[1];
- subtre->l.lvalue[0] = ~subtre->l.lvalue[0];
- if (subtre->l.lvalue[1] == 0)
- subtre->l.lvalue[0]++;
-#endif
-#else
subtre->l.lvalue = -subtre->l.lvalue;
-#endif
return(subtre);
}
if (subtre->t.op==ITOL && subtre->t.tr1->t.op==CON) {
tree = getblk(sizeof(struct lconst));
tree->t.op = LCON;
tree->t.type = LONG;
-#if 1
-#ifdef pdp11
- if (uns(subtre->t.tr1)) {
- *(int32_t *)tree->l.lvalue =
- -(int32_t)(uint16_t)
- subtre->t.tr1->c.value;
- } else {
- *(int32_t *)tree->l.lvalue =
- -subtre->t.tr1->c.value;
- }
-#else
- sign = uns(subtre->t.tr1) ?
- 0 : (subtre->t.tr1->c.value < 0);
- tree->l.lvalue[1] = -subtre->t.tr1->c.value;
- tree->l.lvalue[0] = ~-sign;
- if (tree->l.lvalue[1] == 0)
- tree->l.lvalue[0]++;
-#endif
-#else
if (uns(subtre->t.tr1))
- tree->l.lvalue = -(int32_t)(uint16_t)
+ tree->l.lvalue = -(_LONG)(_UNSIGNED_INT)
subtre->t.tr1->c.value;
else
tree->l.lvalue = -subtre->t.tr1->c.value;
-#endif
return(tree);
}
/*
* PDP-11 FP negation
*/
if (subtre->t.op==SFCON) {
-#if 1
- if (subtre->f.value)
- subtre->f.value ^= 0100000;
+ abort(); /* I am 99% sure this is wrong: subtre->c.value ^= 0100000; */
#ifdef pdp11
- *(double *)subtre->f.fvalue =
- -*(double *)subtre->f.fvalue;
+ subtre->f.fvalue = -subtre->f.fvalue;
#else
pdp11_negf(subtre->f.fvalue, 065);
-#endif
-#else
-/* this did not cause problems because f.value is overlaid on c.value */
-/* this should have been checking for f.value == 0 to preserve clean zeros */
- subtre->c.value ^= 0100000;
- subtre->f.fvalue = -subtre->f.fvalue;
#endif
return(subtre);
}
if (subtre->t.op==FCON) {
-#if 1
#ifdef pdp11
- *(double *)subtre->f.fvalue =
- -*(double *)subtre->f.fvalue;
+ subtre->f.fvalue = -subtre->f.fvalue;
#else
pdp11_negf(subtre->f.fvalue, 065);
-#endif
-#else
- subtre->f.fvalue = -subtre->f.fvalue;
#endif
return(subtre);
}
if (op==PLUS || op==OR) {
/* toss out "+0" */
if (acl.nextl>0 && ((t1 = isconstant(*t2)) && t1->c.value==0
-#if 1
- || (*t2)->t.op==LCON
- && ((*t2)->l.lvalue[0]==0 && (*t2)->l.lvalue[1]==0))) {
-#else
|| (*t2)->t.op==LCON && (*t2)->l.lvalue==0)) {
-#endif
acl.nextl--;
t2--;
}
*np = *(np+1);
}
-void _const(op, vp, v, type) int op; register int16_t *vp; register int16_t v; int type; {
+void _const(op, vp, v, type) int op; register _INT *vp; register _INT v; int type; {
switch (op) {
case PTOI:
- (*vp) /= (uint16_t)v;
+ (*vp) /= (_UNSIGNED_INT)v;
return;
case PLUS:
if (op==UDIV || op==DIVIDE) {
if (v==1)
return;
- *vp = *(uint16_t *)vp >= (uint16_t)v;
+ *vp = *(_UNSIGNED_INT *)vp >= (_UNSIGNED_INT)v;
return;
} else {
if (v==1) {
*vp = 0;
return;
}
- if (*(uint16_t *)vp >= (uint16_t)v)
+ if (*(_UNSIGNED_INT *)vp >= (_UNSIGNED_INT)v)
*vp -= v;
return;
}
*vp %= v;
else
if (op==DIVIDE || op==UDIV)
- *(uint16_t *)vp /= (uint16_t)v;
+ *(_UNSIGNED_INT *)vp /= (_UNSIGNED_INT)v;
else
- *(uint16_t *)vp %= (uint16_t)v;
+ *(_UNSIGNED_INT *)vp %= (_UNSIGNED_INT)v;
return;
case RSHIFT:
if (type==INT)
*vp >>= v;
else
- *(uint16_t *)vp >>= (uint16_t)v;
+ *(_UNSIGNED_INT *)vp >>= (_UNSIGNED_INT)v;
return;
case ULSH:
if (type==INT)
*vp <<= v;
else
- *(uint16_t *)vp <<= (uint16_t)v;
+ *(_UNSIGNED_INT *)vp <<= (_UNSIGNED_INT)v;
return;
case ANDN:
}
union tree *lconst(op, lp, rp) int op; register union tree *lp; register union tree *rp; {
- uint32_t l, r;
+ _UNSIGNED_LONG l, r;
if (lp->t.op==LCON)
-#if 1
-#ifdef pdp11
- l = *(int32_t *)lp->l.lvalue;
-#else
- l = ((int32_t)lp->l.lvalue[0] << 16) |
- (int32_t)lp->l.lvalue[1];
-#endif
-#else
l = lp->l.lvalue;
-#endif
else if (lp->t.op==ITOL && lp->t.tr1->t.op==CON) {
if (lp->t.tr1->t.type==INT)
l = lp->t.tr1->c.value;
else
- l = (uint16_t)lp->t.tr1->c.value;
+ l = (_UNSIGNED_INT)lp->t.tr1->c.value;
} else
return(0);
if (rp->t.op==LCON)
-#if 1
-#ifdef pdp11
- r = *(int32_t *)rp->l.lvalue;
-#else
- r = ((int32_t)rp->l.lvalue[0] << 16) |
- (int32_t)rp->l.lvalue[1];
-#endif
-#else
r = rp->l.lvalue;
-#endif
else if (rp->t.op==ITOL && rp->t.tr1->t.op==CON) {
if (rp->t.tr1->t.type==INT)
r = rp->t.tr1->c.value;
else
- r = (uint16_t)rp->t.tr1->c.value;
+ r = (_UNSIGNED_INT)rp->t.tr1->c.value;
} else
return(0);
switch (op) {
default:
return(0);
}
-#if 1
- if (lp->t.op!=LCON) {
- lp = getblk(sizeof(struct lconst));
- lp->t.op = LCON;
- lp->t.type = LONG;
- }
-#ifdef pdp11
- *(int32_t *)lp->l.lvalue = l;
-#else
- lp->l.lvalue[0] = (uint16_t)((l >> 16) & 0177777);
- lp->l.lvalue[1] = (uint16_t)(l & 0177777);
-#endif
-#else
if (lp->t.op==LCON) {
lp->l.lvalue = l;
return(lp);
lp->t.op = LCON;
lp->t.type = LONG;
lp->l.lvalue = l;
-#endif
return(lp);
}
#!/bin/sh
ROOT="`pwd |sed -e 's/\/lib\/ccom$//'`"
-CC="cc -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
+CC="cc -g -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
mkdir --parents "$ROOT/cross/lib"
make CC="$CC" LDC0FLAGS= LDC1FLAGS= PURFLAG= && \
make DESTDIR="$ROOT/cross" install
# Makefile 1.3 (2.11BSD) 96/7/11
#
-CFLAGS=-O -DSTAGEDIR="\"${STAGEDIR}\"" -DFLEXNAMES -DTARGET_unix -DTARGET_pdp11 -DTARGET_BSD2_11
+CFLAGS=-O -DSTAGEDIR="${STAGEDIR}" -DFLEXNAMES -DTARGET_unix -DTARGET_pdp11 -DTARGET_BSD2_11
SEPFLAG=-i
cpp: cpp.o y.tab.o
ROOT="`pwd |sed -e 's/\/lib\/cpp$//'`"
CC="cc -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
mkdir --parents "$ROOT/cross/lib"
-make CC="$CC" STAGEDIR="$ROOT/stage" SEPFLAG= && \
+make CC="$CC" STAGEDIR="\\\"$ROOT/stage\\\"" SEPFLAG= && \
make DESTDIR="$ROOT/cross" install
make -C bin CC="$CC" SEPFLAG= size
make -C bin/ar CC="$CC" SEPFLAG=
make -C bin/as CC="$CC" SEPFLAG=
-make -C bin/cc CC="$CC" CROSSDIR="$ROOT/cross" STAGEDIR="$ROOT/stage" SEPFLAG=
-make -C bin/ld CC="$CC" STAGEDIR="$ROOT/stage" SEPFLAG= LDFLAGS="-L$ROOT/cross/usr/lib"
+make -C bin/cc CC="$CC" CROSSDIR="\\\"$ROOT/cross\\\"" STAGEDIR="\\\"$ROOT/stage\\\"" SEPFLAG=
+make -C bin/ld CC="$CC" STAGEDIR="\\\"$ROOT/stage\\\"" SEPFLAG= LDFLAGS="-L$ROOT/cross/usr/lib"
make -C bin/nm CC="$CC" SEPFLAG=
make -C lib/c2 CC="$CC" SEPFLAG=
make -C lib/ccom CC="$CC" LDC0FLAGS= LDC1FLAGS= PURFLAG=
-make -C lib/cpp CC="$CC" STAGEDIR="$ROOT/stage" SEPFLAG=
-make -C ucb/strcompact CC="$CC" SEPFLAG= CROSSDIR="$ROOT/cross" LOCALE="LC_ALL=C "
+make -C lib/cpp CC="$CC" STAGEDIR="\\\"$ROOT/stage\\\"" SEPFLAG=
+make -C ucb/strcompact CC="$CC" SEPFLAG= CROSSDIR="\\\"$ROOT/cross\\\"" LOCALESTR="\\\"LC_ALL=C \\\""
make -C ucb/symcompact CC="$CC" SEPFLAG=
make -C ucb/symdump CC="$CC" SEPFLAG=
make -C ucb/symorder CC="$CC" SEPFLAG=
SRCS=strcompact.c ../../lib/libc/pdp/gen/nsym.c
OBJS=strcompact.o ../../lib/libc/pdp/gen/nsym.o
-CFLAGS=-O -DCROSSDIR="\"${CROSSDIR}\"" -DLOCALE="\"${LOCALE}\""
+CFLAGS=-O -DCROSSDIR="${CROSSDIR}" -DLOCALESTR="${LOCALESTR}"
SEPFLAG=-i
all: strcompact
ROOT="`pwd |sed -e 's/\/ucb\/strcompact$//'`"
CC="cc -Iinclude -Wall -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format -Wno-maybe-uninitialized -Wno-parentheses -Wno-unused-result"
mkdir --parents "$ROOT/cross/usr/ucb"
-make CC="$CC" SEPFLAG= CROSSDIR="$ROOT/cross" LOCALE="LC_ALL=C " && \
+make CC="$CC" SEPFLAG= CROSSDIR="\\\"$ROOT/cross\\\"" LOCALESTR="\\\"LC_ALL=C \\\"" && \
make DESTDIR="$ROOT/cross" install
#endif
char *Pgm;
- char *Sort = LOCALE "/usr/bin/sort";
+ char *Sort = LOCALESTR "/usr/bin/sort";
char *Symdump = CROSSDIR "/usr/ucb/symdump";
static char strfn[32], symfn[32];