fsh: turn on the fsh shell for other platforms
authorAlan Cox <alan@linux.intel.com>
Sun, 7 Oct 2018 12:28:12 +0000 (13:28 +0100)
committerAlan Cox <alan@linux.intel.com>
Sun, 7 Oct 2018 12:28:12 +0000 (13:28 +0100)
Applications/V7/cmd/sh/Makefile.6502
Applications/V7/cmd/sh/Makefile.68000
Applications/V7/cmd/sh/Makefile.6809
Applications/V7/cmd/sh/fuzix-sh.pkg

index 871a91c..8c94a90 100644 (file)
@@ -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
index 6e2d498..9501dd9 100644 (file)
@@ -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
index 53e23f3..0d2ad97 100644 (file)
@@ -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
index 5618aed..9daf1f2 100644 (file)
@@ -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