#
#        Makefile for VShell
#
# Macros
#
DEFINES=
#
PRECOMP=ram:vsh.pre
CFLAGS_PRE=-a -ms -pcs -so -wdelopqw
CFLAGS=-ms -pcs -so -wdelopqw
LFLAGS=-m +q
SEGMENT_OBJECTS=crt0.o main_segment.o vars.o config.o display1.o\
 display2.o action1.o action2.o subs.o dos1.o dos2.o view.o tree.o\
 history.o asmsupp1.o asmsupp2.o asmsupp3.o compile_date.o
VSH_OBJECTS=crt0.o main_vsh.o
#
LIBRARIES=-larp16 -lc16
#
# Dependancy entries
#
all: $(PRECOMP) vsh vshsegment
#
.c.o: $(PRECOMP)
   cc $(DEFINES) $(CFLAGS) -hi $(PRECOMP) -o $@ $*.c
#
.asm.o:
   as -o $@ $*.asm
#
$(PRECOMP): vsh.pre
   copy vsh.pre $@ clone
#
vsh.pre: includes.h defines.h
   cc $(DEFINES) $(CFLAGS_PRE) -ho $(PRECOMP) -o nil: includes.h
   copy ram:$@ $@ clone
#
compile_date.c:
   printdate >compile_date.c format "char **compile_date = \q\d \t\q;"
#
vsh: $(VSH_OBJECTS)
   ln $(LFLAGS) -o $@ $(VSH_OBJECTS) $(LIBRARIES)
#
vshsegment: $(SEGMENT_OBJECTS)
   ln $(LFLAGS) -o $@ $(SEGMENT_OBJECTS) $(LIBRARIES)
   delete compile_date.c compile_date.o quiet
#
cleanup:
   delete (#?.o|vsh.pre) quiet
   delete ram:vsh.pre
#
new:
   delete #?.o quiet
   make
#
