poole@forty2.UUCP (Simon Poole) (01/26/89)
The following shar file contains two cdiffs that fix some small problems with the PC 1.3 make, besides working better than the one distributed with ST-Minix 1.1 the PC version is a couple of kB's smaller. ---------------------------------------------------------------------- echo x - README gres '^X' '' > README << '/' XDiffs for PC Minix 1.3 make to ST-Minix 1.1 X=========================================== X(S.Poole 25.01.89) X XAdd -O and -DATARI_ST to the CFLAGS macro in the makefile amd apply Xthe diffs to main.c and rule.c. X XProblems fixed: X - various calls of functions with incorrect arguments (0 instead of X instead of NULL pointers) X X - passing of a NULL pointer to strcmp, which didn't like it at all :-) / echo x - main.cdiff gres '^X' '' > main.cdiff << '/' X*** Omain.c Thu Jan 26 00:03:38 1989 X--- main.c Thu Jan 25 23:20:36 1989 X*************** X*** 123,150 **** X fatal("Cannot initalloc memory"); X #endif X X! if (strcmp(makefile, "-") == 0) /* Can use stdin as makefile */ X! ifd = stdin; X! else X! if (!makefile) /* If no file, then use default */ X! { X! if ((ifd = fopen(DEFN1, "r")) == (FILE *)0) X! #ifdef eon X! if (errno != ER_NOTF) X! fatal("Can't open %s; error %02x", DEFN1, errno); X! #endif X! #ifdef unix X! if (errno != ENOENT) X! fatal("Can't open %s; error %02x", DEFN1, errno); X! #endif X! #ifndef os9 X! if ((ifd == (FILE *)0) X! && ((ifd = fopen(DEFN2, "r")) == (FILE *)0)) X! fatal("Can't open %s", DEFN2); X! #else X! fatal("Can't open %s", DEFN1); X! #endif X! } X else X if ((ifd = fopen(makefile, "r")) == (FILE *)0) X fatal("Can't open %s", makefile); X--- 123,150 ---- X fatal("Cannot initalloc memory"); X #endif X X! if (!makefile) /* If no file, then use default */ X! { X! if ((ifd = fopen(DEFN1, "r")) == (FILE *)0) X! #ifdef eon X! if (errno != ER_NOTF) X! fatal("Can't open %s; error %02x", DEFN1, errno); X! #endif X! #ifdef unix X! if (errno != ENOENT) X! fatal("Can't open %s; error %02x", DEFN1, errno); X! #endif X! #ifndef os9 X! if ((ifd == (FILE *)0) X! && ((ifd = fopen(DEFN2, "r")) == (FILE *)0)) X! fatal("Can't open %s", DEFN2); X! #else X! fatal("Can't open %s", DEFN1); X! #endif X! } X! else X! if (strcmp(makefile, "-") == 0) /* Can use stdin as makefile */ X! ifd = stdin; X else X if ((ifd = fopen(makefile, "r")) == (FILE *)0) X fatal("Can't open %s", makefile); / echo x - rules.cdiff gres '^X' '' > rules.cdiff << '/' X*** Orules.c Thu Jan 25 23:36:47 1989 X--- rules.c Thu Jan 25 23:46:21 1989 X*************** X*** 83,89 **** X modtime(op); X if (op->n_time) X { X! dp = newdep(op, 0); X newline(np, dp, sp->n_line->l_cmd, 0); X setmacro("<", op->n_name); X return TRUE; X--- 83,89 ---- X modtime(op); X if (op->n_time) X { X! dp = newdep(op, (struct depend *)0); X newline(np, dp, sp->n_line->l_cmd, 0); X setmacro("<", op->n_name); X return TRUE; X*************** X*** 108,137 **** X #ifdef eon X setmacro("BDSCC", "asm"); X /* setmacro("BDSCFLAGS", ""); */ X! cp = newcmd("$(BDSCC) $(BDSCFLAGS) -n $<", 0); X! np = newname(".c.o"); X! newline(np, 0, cp, 0); X X setmacro("CC", "c"); X setmacro("CFLAGS", "-O"); X! cp = newcmd("$(CC) $(CFLAGS) -c $<", 0); X! np = newname(".c.obj"); X! newline(np, 0, cp, 0); X X setmacro("M80", "asm -n"); X /* setmacro("M80FLAGS", ""); */ X! cp = newcmd("$(M80) $(M80FLAGS) $<", 0); X! np = newname(".mac.o"); X! newline(np, 0, cp, 0); X X setmacro("AS", "zas"); X /* setmacro("ASFLAGS", ""); */ X! cp = newcmd("$(ZAS) $(ASFLAGS) -o $@ $<", 0); X! np = newname(".as.obj"); X! newline(np, 0, cp, 0); X! X! np = newname(".as"); X! dp = newdep(np, 0); X np = newname(".obj"); X dp = newdep(np, dp); X np = newname(".c"); X--- 108,137 ---- X #ifdef eon X setmacro("BDSCC", "asm"); X /* setmacro("BDSCFLAGS", ""); */ X! cp = newcmd("$(BDSCC) $(BDSCFLAGS) -n $<", (struct cmd *)0); X! np = newname(".c.o"); X! newline(np, (struct depend *)0, cp, 0); X X setmacro("CC", "c"); X setmacro("CFLAGS", "-O"); X! cp = newcmd("$(CC) $(CFLAGS) -c $<", (struct cmd *)0); X! np = newname(".c.obj"); X! newline(np, (struct depend *)0, cp, 0); X X setmacro("M80", "asm -n"); X /* setmacro("M80FLAGS", ""); */ X! cp = newcmd("$(M80) $(M80FLAGS) $<", (struct cmd *)0); X! np = newname(".mac.o"); X! newline(np, (struct depend *)0, cp, 0); X X setmacro("AS", "zas"); X /* setmacro("ASFLAGS", ""); */ X! cp = newcmd("$(ZAS) $(ASFLAGS) -o $@ $<", (struct cmd *)0); X! np = newname(".as.obj"); X! newline(np, (struct depend *)0, cp, 0); X! X! np = newname(".as"); X! dp = newdep(np, (struct depend *)0); X np = newname(".obj"); X dp = newdep(np, dp); X np = newname(".c"); X*************** X*** 141,147 **** X np = newname(".mac"); X dp = newdep(np, dp); X np = newname(".SUFFIXES"); X! newline(np, dp, 0, 0); X #endif X X /* X--- 141,147 ---- X np = newname(".mac"); X dp = newdep(np, dp); X np = newname(".SUFFIXES"); X! newline(np, dp, (struct cmd *)0, 0); X #endif X X /* X*************** X*** 150,185 **** X #ifdef unix X setmacro("CC", "cc"); X setmacro("CFLAGS", "-O"); X! #ifdef MINIX X! cp = newcmd("$(CC) $(CFLAGS) -S $<", 0); X! np = newname(".c.s"); X! #else X! cp = newcmd("$(CC) $(CFLAGS) -c $<", 0); X! np = newname(".c.o"); X! #endif MINIX X! newline(np, 0, cp, 0); X! X! setmacro("AS", "as"); X! cp = newcmd("$(AS) -o $@ $<", 0); X! np = newname(".s.o"); X! newline(np, 0, cp, 0); X X setmacro("YACC", "yacc"); X /* setmacro("YFLAGS", ""); */ X! cp = newcmd("$(YACC) $(YFLAGS) $<", 0); X! cp = newcmd("mv y.tab.c $@", cp); X! np = newname(".y.c"); X! newline(np, 0, cp, 0); X! X! cp = newcmd("$(YACC) $(YFLAGS) $<", 0); X cp = newcmd("$(CC) $(CFLAGS) -c y.tab.c", cp); X cp = newcmd("rm y.tab.c", cp); X cp = newcmd("mv y.tab.o $@", cp); X np = newname(".y.o"); X! newline(np, 0, cp, 0); X! X! np = newname(".s"); X! dp = newdep(np, 0); X np = newname(".o"); X dp = newdep(np, dp); X np = newname(".c"); X--- 150,185 ---- X #ifdef unix X setmacro("CC", "cc"); X setmacro("CFLAGS", "-O"); X! #if MINIX && !ATARI_ST X! cp = newcmd("$(CC) $(CFLAGS) -S $<", (struct cmd *)0); X! np = newname(".c.s"); X! #else X! cp = newcmd("$(CC) $(CFLAGS) -c $<", (struct cmd *)0); X! np = newname(".c.o"); X! #endif MINIX X! newline(np, (struct depend *)0, cp, 0); X! X! setmacro("AS", "as"); X! cp = newcmd("$(AS) -o $@ $<", (struct cmd *)0); X! np = newname(".s.o"); X! newline(np, (struct depend *)0, cp, 0); X X setmacro("YACC", "yacc"); X /* setmacro("YFLAGS", ""); */ X! cp = newcmd("$(YACC) $(YFLAGS) $<", (struct cmd *)0); X! cp = newcmd("mv y.tab.c $@", cp); X! np = newname(".y.c"); X! newline(np, (struct depend *)0, cp, 0); X! X! cp = newcmd("$(YACC) $(YFLAGS) $<", (struct cmd *)0); X cp = newcmd("$(CC) $(CFLAGS) -c y.tab.c", cp); X cp = newcmd("rm y.tab.c", cp); X cp = newcmd("mv y.tab.o $@", cp); X np = newname(".y.o"); X! newline(np, (struct depend *)0, cp, 0); X! X! np = newname(".s"); X! dp = newdep(np, (struct depend *)0); X np = newname(".o"); X dp = newdep(np, dp); X np = newname(".c"); X*************** X*** 187,193 **** X np = newname(".y"); X dp = newdep(np, dp); X np = newname(".SUFFIXES"); X! newline(np, dp, 0, 0); X #endif X #ifdef os9 X /* X--- 187,193 ---- X np = newname(".y"); X dp = newdep(np, dp); X np = newname(".SUFFIXES"); X! newline(np, dp, (struct cmd *)0, 0); X #endif X #ifdef os9 X /* X*************** X*** 196,222 **** X */ X setmacro("CC", "cc"); X setmacro("CFLAGS", "-z"); X! cp = newcmd("$(CC) $(CFLAGS) -r $<", 0); X! X! np = newname(".c.r"); X! newline(np, 0, cp, 0); X! np = newname(".ca.r"); X! newline(np, 0, cp, 0); X! np = newname(".a.r"); X! newline(np, 0, cp, 0); X! np = newname(".o.r"); X! newline(np, 0, cp, 0); X! np = newname(".mc.r"); X! newline(np, 0, cp, 0); X! np = newname(".mca.r"); X! newline(np, 0, cp, 0); X! np = newname(".ma.r"); X! newline(np, 0, cp, 0); X! np = newname(".mo.r"); X! newline(np, 0, cp, 0); X! X! np = newname(".r"); X! dp = newdep(np, 0); X np = newname(".mc"); X dp = newdep(np, dp); X np = newname(".mca"); X--- 196,222 ---- X */ X setmacro("CC", "cc"); X setmacro("CFLAGS", "-z"); X! cp = newcmd("$(CC) $(CFLAGS) -r $<", (struct cmd *)0); X! X! np = newname(".c.r"); X! newline(np, (struct depend *)0, cp, 0); X! np = newname(".ca.r"); X! newline(np, (struct depend *)0, cp, 0); X! np = newname(".a.r"); X! newline(np, (struct depend *)0, cp, 0); X! np = newname(".o.r"); X! newline(np, (struct depend *)0, cp, 0); X! np = newname(".mc.r"); X! newline(np, (struct depend *)0, cp, 0); X! np = newname(".mca.r"); X! newline(np, (struct depend *)0, cp, 0); X! np = newname(".ma.r"); X! newline(np, (struct depend *)0, cp, 0); X! np = newname(".mo.r"); X! newline(np, (struct depend *)0, cp, 0); X! X! np = newname(".r"); X! dp = newdep(np, (struct depend *)0); X np = newname(".mc"); X dp = newdep(np, dp); X np = newname(".mca"); X*************** X*** 234,239 **** X np = newname(".a"); X dp = newdep(np, dp); X np = newname(".SUFFIXES"); X! newline(np, dp, 0, 0); X! #endif X! } X--- 234,239 ---- X np = newname(".a"); X dp = newdep(np, dp); X np = newname(".SUFFIXES"); X! newline(np, dp, (struct cmd *)0, 0); X! #endif X! } / -- ---------------------------------------------------------------------------- UUCP: ...mcvax!cernvax!forty2!poole Simon Poole BITNET: K538915@CZHRZU1A ----------------------------------------------------------------------------