From: Will Sowerbutts Date: Wed, 4 Jan 2017 14:54:01 +0000 (+0000) Subject: Applications: levee: Build versions for ansi, vt52 and termcap X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=9c345bdad740ef543b20060a53e2cf305f1e9246;p=FUZIX.git Applications: levee: Build versions for ansi, vt52 and termcap --- diff --git a/Applications/levee/.gitignore b/Applications/levee/.gitignore index c5f95fdd..69764bb8 100644 --- a/Applications/levee/.gitignore +++ b/Applications/levee/.gitignore @@ -1,7 +1,4 @@ levee -levee-l -levee-a -levee-v -*.o-l -*.o-a -*.o-v +levee-termcap +levee-ansi +levee-vt52 diff --git a/Applications/levee/Makefile b/Applications/levee/Makefile index 0d6c0577..853ca2eb 100644 --- a/Applications/levee/Makefile +++ b/Applications/levee/Makefile @@ -1,18 +1,33 @@ -.SUFFIXES: .c .rel +.SUFFIXES: .c -vt52.rel -ansi.rel -termcap.rel CSRCS = beep.c blockio.c display.c doscall.c editcor.c exec.c find.c CSRCS += flexcall.c gemcall.c globals.c insert.c main.c misc.c modify.c CSRCS += move.c rmxcall.c ucsd.c undo.c unixcall.c wildargs.c -OBJS = $(CSRCS:.c=.rel) +HFILES = extern.h grep.h levee.h proto.h +OBJSVT52 = $(CSRCS:.c=-vt52.rel) +OBJSANSI = $(CSRCS:.c=-ansi.rel) +OBJSTERMCAP = $(CSRCS:.c=-termcap.rel) -levee: $(OBJS) - fcc -o levee-vt52 $(OBJS) +all: levee-vt52 levee-ansi levee-termcap -$(OBJS): $(CSRCS) +levee-vt52: $(OBJSVT52) + fcc -o levee-vt52 $(OBJSVT52) -.c.rel: - fcc -O3 -DVT52=1 -DANSI=0 -c $(@:.rel=.c) +levee-ansi: $(OBJSANSI) + fcc -o levee-ansi $(OBJSANSI) + +levee-termcap: $(OBJSTERMCAP) + fcc -o levee-termcap $(OBJSTERMCAP) + +%-ansi.rel: %.c $(HFILES) + fcc -O3 -DVT52=0 -DANSI=1 -DTERMCAP=0 -c $< -o $@ + +%-vt52.rel: %.c $(HFILES) + fcc -O3 -DVT52=1 -DANSI=0 -DTERMCAP=0 -c $< -o $@ + +%-termcap.rel: %.c $(HFILES) + fcc -O3 -DVT52=0 -DANSI=0 -DTERMCAP=1 -c $< -o $@ clean: - rm -rf $(OBJS) *.lst *.sym *.map *.noi *.lk *.ihx *.tmp *~ *.rel *.asm levee levee.bin + rm -rf $(OBJSVT52) $(OBJSANSI) $(OBJSTERMCAP) *.lst *.sym *.map *.noi *.lk *.ihx *.tmp *~ *.rel *.asm levee levee.bin diff --git a/Applications/levee/display.c b/Applications/levee/display.c index 9ae0aef6..26621906 100644 --- a/Applications/levee/display.c +++ b/Applications/levee/display.c @@ -20,6 +20,7 @@ #include "extern.h" #include +#include #include /* do a gotoXY -- allowing -1 for same row/column */ diff --git a/Applications/levee/fuzix-levee.pkg b/Applications/levee/fuzix-levee.pkg index 0e2a96fb..3d9f0079 100644 --- a/Applications/levee/fuzix-levee.pkg +++ b/Applications/levee/fuzix-levee.pkg @@ -13,3 +13,9 @@ package levee-ansi if-file levee-ansi f 0755 /bin/levee-ansi levee-ansi + + +package levee-termcap +if-file levee-termcap + +f 0755 /bin/levee-termcap levee-termcap diff --git a/Applications/levee/levee.h b/Applications/levee/levee.h index af08bdb9..bea51cfd 100644 --- a/Applications/levee/levee.h +++ b/Applications/levee/levee.h @@ -61,8 +61,8 @@ /* use "-DANSI=1 -DVT52=0" etc. on compile line */ /*#define VT52 0*/ /* this must be nonzero for the Atari ST */ /*#define ANSI 0*/ -#define TERMCAP 0 -#define ZTERM 0 +/*#define TERMCAP 0 */ +/*#define ZTERM 0 */ #if ST diff --git a/Applications/levee/termcap.i b/Applications/levee/termcap.i index 312f534d..ac5e7a3a 100644 --- a/Applications/levee/termcap.i +++ b/Applications/levee/termcap.i @@ -122,7 +122,6 @@ void tc_init(void) #if RMX char *p = termcap; #else - char *getenv(); char *p = getenv("TERMCAP"); #endif char *lp, *ptr; @@ -137,7 +136,7 @@ void tc_init(void) exit(1); } #endif - lp = Malloc(strlen(p)+1); + lp = malloc(strlen(p)+1); if (!lp) { puts("lv: out of memory\n"); exit(1);