From e8f333ab0d48a2347969337d578af1f04fe47b5c Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 7 Oct 2018 13:28:12 +0100 Subject: [PATCH] fsh: turn on the fsh shell for other platforms --- Applications/V7/cmd/sh/Makefile.6502 | 10 ++++++++-- Applications/V7/cmd/sh/Makefile.68000 | 14 ++++++++++++-- Applications/V7/cmd/sh/Makefile.6809 | 11 +++++++++-- Applications/V7/cmd/sh/fuzix-sh.pkg | 6 ++++++ 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/Applications/V7/cmd/sh/Makefile.6502 b/Applications/V7/cmd/sh/Makefile.6502 index 871a91c3..8c94a903 100644 --- a/Applications/V7/cmd/sh/Makefile.6502 +++ b/Applications/V7/cmd/sh/Makefile.6502 @@ -17,18 +17,24 @@ SRCS = args.c blok.c builtin.c cmd.c ctype.c error.c expand.c fault.c io.c \ 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)) LIBS = ../../../../Library/libs/c6502.lib -all: sh +all: sh fsh sh: $(OBJS) $(LINKER) -o $@ $(LINKER_OPT) $(CRT0) $^ c6502.lib -m $@.map +fsh: $(FOBJS) + $(LINKER) -o $@ $(LINKER_OPT) $(CRT0) $^ readline.lib c6502.lib -m $@.map + $(OBJS): $(INCS) +$(FOBJS): $(INCS) + clean: - rm -f $(OBJS) sh *~ core + rm -f $(OBJS) fsh sh *~ core rmbak: rm -f *~ core diff --git a/Applications/V7/cmd/sh/Makefile.68000 b/Applications/V7/cmd/sh/Makefile.68000 index 6e2d4987..9501dd9e 100644 --- a/Applications/V7/cmd/sh/Makefile.68000 +++ b/Applications/V7/cmd/sh/Makefile.68000 @@ -22,24 +22,34 @@ INCS = brkincr.h ctype.h defs.h mac.h mode.h name.h stak.h sym.h timeout.h OBJS = $(SRCS:.c=.o) -all: sh +all: fsh sh $(OBJS): $(INCS) +FOBJS = $(patsubst %.c,fshbuild/%.o, $(SRCS)) OBJS = $(SRCS:.c=.o) +$(FOBJS): $(INCS) + $(OBJS): %.o : %.c $(CC) -c $(CFLAGS) $(COPT) $< +$(FOBJS): fshbuild/%.o: %.c + $(CC) -c $(CFLAGS) $(COPT) $< -o $@ + sh: $(CRT0) $(OBJS) $(LINKER) $^ -o $@.bin $(LINKER_OPT) $(ELF2FUZIX) -o $@ $@.bin +fsh: $(CRT0) $(FOBJS) + $(LINKER) $^ -o $@.bin $(LINKER_OPT) -lreadline68000 + $(ELF2FUZIX) -o $@ $@.bin + size.report: $(APPS) ls -l $^ > $@ clean: - rm -f $(OBJS) $(APPS) $(SRCS:.c=) core *~ *.asm *.lst *.sym *.map *.noi *.lk *.ihx *.tmp *.bin size.report *.o + rm -f $(FOBJS) $(OBJS) sh fsh $(SRCS:.c=) core *~ *.asm *.lst *.sym *.map *.noi *.lk *.ihx *.tmp *.bin size.report *.o rmbak: rm -f *~ core diff --git a/Applications/V7/cmd/sh/Makefile.6809 b/Applications/V7/cmd/sh/Makefile.6809 index 53e23f31..0d2ad979 100644 --- a/Applications/V7/cmd/sh/Makefile.6809 +++ b/Applications/V7/cmd/sh/Makefile.6809 @@ -24,19 +24,26 @@ SRCS = args.c blok.c builtin.c cmd.c ctype.c error.c expand.c fault.c io.c \ 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)) -all: sh +all: fsh sh $(OBJS): $(INCS) $(OBJS): %.o : %.c $(CC) -c $(CFLAGS) $(COPT) $< +$(FOBJS): fshbuild/%.rel: %.c + $(FCC) $(Z80_PLATFORM) -c -DBUILD_FSH $< -o $@ + sh: $(OBJS) $(CRT0) $(LINKER) -o $@ $(LINKER_OPT) $^ +fsh: $(FOBJS) + $(LINKER) -o $@ $(LINKER_OPT) $^ -lreadline6809 + clean: - rm -f $(OBJS) sh $(SRCS:.c=) core *~ + rm -f $(OBJS) fsh sh $(SRCS:.c=) core *~ rmbak: rm -f *~ core diff --git a/Applications/V7/cmd/sh/fuzix-sh.pkg b/Applications/V7/cmd/sh/fuzix-sh.pkg index 5618aed2..9daf1f28 100644 --- a/Applications/V7/cmd/sh/fuzix-sh.pkg +++ b/Applications/V7/cmd/sh/fuzix-sh.pkg @@ -2,6 +2,10 @@ package V7-sh f 0755 /bin/sh sh +package V7-fsh + +f 0755 /bin/fsh fsh + # Man page - in a separate package so that storage-limited targets can # disable it. @@ -9,3 +13,5 @@ f 0755 /bin/sh sh package V7-sh-man f 0644 /usr/man/man1/sh.1 sh.1 +# For now it is both +f 0644 /usr/man/man1/sh.1 fsh.1 -- 2.34.1