INCS = brkincr.h ctype.h defs.h mac.h mode.h name.h stak.h sym.h timeout.h
OBJS = $(SRCS:.c=.o)
-FOBJS = $(patsubst %.c,fshbuild/%.o, $(SRCS))
+FOBJS = $(patsubst %.c,fshbuild_%.o, $(SRCS))
LIBS = ../../../../Library/libs/c6502.lib
$(OBJS): %.o : %.c
$(CC) -c $(CFLAGS) $(COPT) $<
-$(FOBJS): fshbuild/%.o: %.c
- $(CC) -c $(CFLAGS) -c -DBUILD_FSH $< -o $@
+$(FOBJS): fshbuild_%.o: %.c
+ # -c and -o is busted if used together in cc65
+ cp $< fshbuild_$<
+ $(CC) -c $(CFLAGS) -c -DBUILD_FSH fshbuild_$<
clean:
- rm -f $(OBJS) fsh sh *~ core
+ rm -f $(OBJS) $(FOBJS) fsh sh *~ core
rmbak:
rm -f *~ core
$(CC) -c $(CFLAGS) $(COPT) -DBUILD_FSH $< -o $@
sh: $(OBJS) $(CRT0)
- $(LINKER) -o $@ $(LINKER_OPT) $^
+ $(LINKER) -o $@ $(LINKER_OPT) $(CRT0) $^
fsh: $(FOBJS)
- $(LINKER) -o $@ $(LINKER_OPT) $^ -lreadline6809
+ $(LINKER) -o $@ $(LINKER_OPT) $(CRT0) $^ -lreadline6809
clean:
- rm -f $(OBJS) fsh sh $(SRCS:.c=) core *~
+ rm -f $(OBJS) $(FOBJS) fsh sh $(SRCS:.c=) core *~
rmbak:
rm -f *~ core
$(FCC) $(Z80_PLATFORM) -c -DBUILD_FSH $< -o $@
clean:
- rm -f $(OBJS) sh $(SRCS:.c=) core *~ *.asm *.lst *.sym *.map *.noi *.lk *.ihx *.tmp *.bin
+ rm -f $(OBJS) fsh sh $(SRCS:.c=) core *~ *.asm *.lst *.sym *.map *.noi *.lk *.ihx *.tmp *.bin
rmbak:
rm -f *~ core
#include <sys/times.h>
#include <errno.h>
+/* Figure out if we have to deal with bigger buffers specially due to cc65
+ limits. Really cc65 needs fixing. */
+#if defined(__CC65__) && defined(BUILD_FSH)
+#define static6502 static
+#else
+#define static6502
+#endif
+
/*
* UNIX shell
*/
void subst(int in, int ot)
{
register char c;
- FILEBLK fb;
+ static6502 FILEBLK fb;
register int count = CPYSIZ;
push(&fb);
static char *inptr;
static char ineof;
-static int line_input(char *prmpt)
+static int line_input(const char *prmpt)
{
int l;
if (!isatty(standin->fdes))
int readvar(char **names)
{
- FILEBLK fb;
+ static6502 FILEBLK fb;
register FILE f = &fb;
register char c;
register int rc = 0;
void execexp(char *s, UFD f)
{
- FILEBLK fb;
+ static6502 FILEBLK fb;
push(&fb);
if (s) {
estabf(s);