# combined Makefile for ELVIS - a clone of `vi` # # After editing this Makefile as described below, you should... # # Use `make` to compile all programs # Use `make install` to copy the programs to the BIN directory # Use `make clean` to remove all object files # Use `make clobber` to remove everything except source & documentation # Use `make tags` to build new "tags" and "refs" files # Use `make uue` to produce uuencoded compressed tar archives of the source # Use `make sh` to produce shar archives of the source # Use `make print` to print the Elvis documentation # # Several groups of Makefile settings are included below. Choose *ONE* group # of settings for your particular system, and leave the others commented out. # The meanings of these settings are: # O the filename extension for unlinked object files -- usually .o # E the filename extension for executable files -- usually null # EXTRA version-specific object files used in elvis # EXTRA2 version-specific object files used in elvis, virec, & refont # LIBS any special libraries, such as "-ltermcap" # BIN directory where executables should be installed # CC the C compiler command, possibly with "memory model" flags # CFLAGS compiler flags used to select compile-time options # OF link flag to control the output file's name -- usually -o # RF flag used to denote "compile but don't link" -- usually -c # DATE a "cc" flag that defines "DATE". e.g. DATE=-DDATE=\"7/4/76\" # EVAL the word "eval", if DATE requires it # PROGS the list of all programs # CHMEM any extra commands to be run after ELVIS is linked # SORT if the "tags" file must be sorted, then SORT=-DSORT # INST installation method: inst.dos, inst.tos, inst.os9, or inst.unix # RM the name of a program that deletes files # PR1 used to print documentation -- typically "refont -c" # PR2 used to send text to printer -- typically "| lpr" # DUMMY usually nothing, but OS9 needs "dummy" # DOC name of "doc" directory, with a trailing slash #---- These settings are recommended for System-V UNIX and SCO XENIX-386 ---- #O= .o #E= #EXTRA= #EXTRA2= #LIBS= -ltermcap #BIN= /usr/local/bin #CFLAGS= -DM_SYSV -O #OF= -o #RF= -c #DATE= -DDATE=\'\"`date`\"\' #EVAL= eval #PROGS= elvis$E ctags$E ref$E virec$E refont$E #CHMEM= #SORT= -DSORT #INST= inst.unix #RM= rm -f #PR1= refont -c #PR2= | lp #DUMMY= #DOC= doc/ #---- These settings are recommended for SCO XENIX-286 ---- #O= .o #E= #EXTRA= #EXTRA2= #LIBS= -ltermcap #BIN= /usr/local/bin #CC= cc -M2s -i #CFLAGS= -DM_SYSV -Ox -DCS_IBMPC #OF= -o #RF= -c #DATE= -DDATE=\'\"`date`\"\' #EVAL= eval #PROGS= elvis$E ctags$E ref$E virec$E refont$E #CHMEM= #SORT= -DSORT #INST= inst.unix #RM= rm -f #PR1= refont -c #PR2= | lp #DUMMY= #DOC= doc/ #---- These settings are recommended for BSD 4.3 UNIX ---- #O= .o #E= #EXTRA= #EXTRA2= #LIBS= -ltermcap #BIN= /usr/local/bin #CFLAGS= -Dbsd -O #OF= -o #RF= -c #DATE= -DDATE=\'\"`date`\"\' #EVAL= eval #PROGS= elvis$E ctags$E ref$E virec$E refont$E #CHMEM= #SORT= -DSORT #INST= inst.unix #RM= rm -f #PR1= refont -c #PR2= | lpr #DUMMY= #DOC= doc/ #---- These settings are recommended for Coherent ---- #O=.o #E= #EXTRA= #EXTRA2= #LIBS= -lterm #BIN= /usr/bin #CC= cc #CFLAGS= -O -DCOHERENT -DCRUNCH -DNO_CHARATTR -DNO_CURSORSHAPE \ # -DNO_DIGRAPH -DNO_MKEXRC -VSUVAR #OF= -o #RF= -c #DATE= -DDATE=\'\"`date`\"\' #EVAL= eval #PROGS= elvis$E ctags$E ref$E virec$E refont$E #CHMEM= fixstack 2000 elvis$E #SORT= #INST= inst.unix #RM= rm -f #PR1= refont -b #PR2= | lpr #DUMMY= #DOC= doc/ #---- These settings are recommended for Minix-ST ---- #O= .o #E= #EXTRA= #EXTRA2= #LIBS= #BIN= /usr/bin #CC= cc #CFLAGS= #OF= -o #RF= -c #DATE= -DDATE=\'\"`date`\"\' #EVAL= eval #PROGS= elvis$E ctags$E ref$E virec$E refont$E #CHMEM= chmem =18000 elvis #SORT= #INST= inst.unix #RM= rm -f #PR1= lpr #PR2= #DUMMY= #DOC= doc/ #---- These settings are recommended for Minix-PC ---- #O= .s #E= #EXTRA= tinytcap$O #EXTRA2= #LIBS= #BIN= /usr/bin #CC= cc -i #CFLAGS= -O -DCRUNCH -DNO_MKEXRC -DNO_CURSORSHAPE -DNO_CHARATTR \ # -DNO_SHOWMODE -DNO_MODELINE -DNO_OPTCOLS -DNO_DIGRAPH -DNO_ABBR \ # -DNO_AT -DNO_SENTENCE -DNO_ERRLIST #### (all but -DNO_EXTENSIONS, -DNO_RECYCLE, -DNO_MAGIC, and -DNO_CHARSEARCH) #OF= -o #RF= -c #DATE= -DDATE=\'\"`date`\"\' #EVAL= eval #PROGS= elvis$E ctags$E ref$E virec$E refont$E #CHMEM= #SORT= #INST= inst.unix #RM= rm -f #PR1= lpr #PR2= #DUMMY= #DOC= doc/ #---- These settings are recommended for MS-DOS + MS-C + NDMAKE ---- #O= .obj #E= .exe #EXTRA= pc$O sysdos$O tinytcap$O #EXTRA2= #LIBS= #BIN= c:\dos #CC= cl /AM #CFLAGS= -O -DCS_IBMPC -DCS_SPECIAL #OF= -o #RF= -c #DATE= #EVAL= #PROGS= elvis$E ex$E ctags$E ref$E virec$E wildcard$E refont$E #CHMEM= #SORT= #INST= inst.dos #RM= del #PR1= refont -c #PR2= >PRN #DUMMY= #DOC= doc\ #---- These settings are recommended for Atari TOS + Mark Williams C ---- #O=.o #E=.ttp #EXTRA= sysdos$O tinytcap$O #EXTRA2= atari$O #LIBS= #BIN= c:\ #CC= cc -VPEEP #CFLAGS= -O -DCS_IBMPC -DCS_SPECIAL #OF= -o #RF= -c #DATE= #EVAL= #PROGS= elvis$E ctags$E ref$E virec$E wildcard$E shell$E refont$E #CHMEM= #SORT= #INST= inst.tos #RM= rm -f #PR1= refont -e #PR2= >PRT: #DUMMY= #DOC= 'doc\' #---- These settings are recommended for OS-9/68K V2.3 ---- #O= .r #E= #EXTRA= date$O #EXTRA2= osk$O #LIBS= -l=/dd/lib/termlib.l #BIN= /dd/usr/cmds #CC= cc #ODIR= /dd/usr/src/elvis #CFLAGS= -gq -m=2 #OF= -f=$(ODIR)/ #RF= -r #DATE= #EVAL= #PROGS= elvis$E vi$E view$E input$E ctags$E ref$E virec$E refont$E #CHMEM= touch date.r #SORT= #INST= inst.os9 #RM= del *.stb *.dbg #PR1= refont -b #PR2= >/p #DUMMY= dummy #DOC= doc/ ########################################################################### ########################################################################### ### ### ### The rest of this Makefile contains no user-servicable parts ### ### ### ########################################################################### ########################################################################### OBJS= blk$O cmd1$O cmd2$O curses$O cut$O ex$O input$O main$O misc$O \ modify$O move1$O move2$O move3$O move4$O move5$O opts$O recycle$O \ redraw$O regexp$O regsub$O system$O tio$O tmp$O vars$O vcmd$O vi$O ALIAS= alias$O DOCS= $(DOC)index.doc $(DOC)intro.doc $(DOC)visual.doc $(DOC)ex.doc \ $(DOC)regexp.doc $(DOC)options.doc $(DOC)cutbufs.doc $(DOC)differ.doc \ $(DOC)internal.doc $(DOC)cflags.doc $(DOC)termcap.doc \ $(DOC)environ.doc $(DOC)versions.doc SRC1= README KNOWN.BUGS $(DOC)intro.doc $(DOC)visual.doc $(DOC)ex.doc \ $(DOC)versions.doc $(DOC)cflags.doc $(DOC)differ.doc SRC2= $(DOC)cutbufs.doc $(DOC)options.doc $(DOC)environ.doc $(DOC)regexp.doc \ $(DOC)internal.doc $(DOC)termcap.doc $(DOC)index.doc $(DOC)ctags.man \ $(DOC)elvis.man $(DOC)ref.man $(DOC)refont.man $(DOC)virec.man SRC3= Elvis.lnk Elvis.mak Elvis.prj Makefile.mix alias.c atari.c \ ctags.c pc.c ref.c shell.c sysdos.c virec.c wildcard.c \ profile.sh osk.c osk.h date.c SRC4= blk.c cmd1.c cmd2.c config.h curses.c SRC5= curses.h cut.c ex.c input.c main.c misc.c SRC6= modify.c move1.c move2.c move3.c move4.c move5.c opts.c recycle.c \ redraw.c SRC7= regexp.c regexp.h regsub.c system.c tinytcap.c tio.c tmp.c SRC8= vars.c vcmd.c vi.c vi.h refont.c ########################################################################### all: $(PROGS) @echo done. elvis$E: $(OBJS) $(EXTRA) $(EXTRA2) $(CC) $(CFLAGS) $(OF)elvis$E $(OBJS) $(EXTRA) $(EXTRA2) $(LIBS) $(CHMEM) ctags$E: ctags.c $(CC) $(CFLAGS) $(SORT) $(OF)ctags$E ctags.c ref$E: ref.c $(CC) $(CFLAGS) $(OF)ref$E ref.c virec$E: virec.c $(CC) $(CFLAGS) $(OF)virec$E virec.c $(EXTRA2) view$E: $(ALIAS) $(CC) $(CFLAGS) $(OF)view$E $(ALIAS) ex$E: $(ALIAS) $(CC) $(CFLAGS) $(OF)ex$E $(ALIAS) vi$E: $(ALIAS) $(CC) $(CFLAGS) $(OF)vi$E $(ALIAS) input$E: $(ALIAS) $(CC) $(CFLAGS) $(OF)input$E $(ALIAS) shell$E: shell.c $(CC) $(CFLAGS) $(OF)shell$E shell.c wildcard$E: wildcard.c $(CC) $(CFLAGS) $(OF)wildcard$E wildcard.c refont$E: refont.c $(CC) $(CFLAGS) $(OF)refont$E refont.c $(EXTRA2) ############################################################################## # The file cmd1.c is compiled with the extra flag -DDATE="today's date". cmd1$O: cmd1.c vi.h config.h $(EVAL) $(CC) $(CFLAGS) $(RF) $(DATE) cmd1.c # "It all depends..." $(OBJS): vi.h curses.h config.h # OS9 must create a custom date.c file, and compile it. date$O: $(OBJS) @echo '/* compilation date of elvis */' >-date.c @echo -r 'char date[] = "' >+date.c @echo -r 'echo -r ' >-/dd/tmp/date.c @date >+/dd/tmp/date.c @shell /dd/tmp/date.c >+date.c @echo '";' >+date.c @del /dd/tmp/date.c $(CC) $(CFLAGS) $(RF) date.c ############################################################################## install: $(INST) @echo Installation complete. inst.unix: $(DUMMY) cp $(PROGS) $(BIN) (cd $(BIN); chmod 755 $(PROGS)) (cd $(BIN); chown bin $(PROGS)) -ln $(BIN)/elvis $(BIN)/vi -ln $(BIN)/elvis $(BIN)/ex -ln $(BIN)/elvis $(BIN)/view -ln $(BIN)/elvis $(BIN)/input inst.dos: $(DUMMY) copy $(PROGS) $(BIN) copy $(BIN)/ex$E $(BIN)/vi$E copy $(BIN)/ex$E $(BIN)/view$E copy $(BIN)/ex$E $(BIN)/input$E inst.tos: $(DUMMY) copy $(PROGS) $(BIN) inst.os9: $(DUMMY) copy $(PROGS) -rw=$(BIN) chd $(BIN); attr -epenprnpw $(PROGS) ############################################################################## clean: $(DUMMY) $(RM) *$O $(DOC)*.1 elvis?.uue elvis?.sh core clobber: clean $(RM) tags refs $(PROGS) ############################################################################## print: refont$E $(PR1) $(DOCS) $(PR2) tags refs: ctags$E ctags -r *.c *.h ############################################################################## uue: elvis1.uue elvis2.uue elvis3.uue elvis4.uue elvis5.uue \ elvis6.uue elvis7.uue elvis8.uue elvis1.uue: $(SRC1) tar cf elvis1.tar $(SRC1) compress -b13 elvis1.tar cp README elvis1.uue uue elvis1.tar.Z - >>elvis1.uue $(RM) elvis1.tar* elvis2.uue: $(SRC2) tar cf elvis2.tar $(SRC2) compress -b13 elvis2.tar uue elvis2.tar.Z $(RM) elvis2.tar* elvis3.uue: $(SRC3) tar cf elvis3.tar $(SRC3) compress -b13 elvis3.tar uuencode elvis3.tar.Z elvis3.uue $(RM) elvis3.tar* elvis4.uue: $(SRC4) tar cf elvis4.tar $(SRC4) compress -b13 elvis4.tar uuencode elvis4.tar.Z elvis4.uue $(RM) elvis4.tar* elvis5.uue: $(SRC5) tar cf elvis5.tar $(SRC5) compress -b13 elvis5.tar uuencode elvis5.tar.Z elvis5.uue $(RM) elvis5.tar* elvis6.uue: $(SRC6) tar cf elvis6.tar $(SRC6) compress -b13 elvis6.tar uuencode elvis6.tar.Z elvis6.uue $(RM) elvis6.tar* elvis7.uue: $(SRC7) tar cf elvis7.tar $(SRC7) compress -b13 elvis7.tar uuencode elvis7.tar.Z elvis7.uue $(RM) elvis7.tar* elvis8.uue: $(SRC8) tar cf elvis8.tar $(SRC8) compress -b13 elvis8.tar uuencode elvis8.tar.Z elvis8.uue $(RM) elvis8.tar* ############################################################################## sh: elvis1.sh elvis2.sh elvis3.sh elvis4.sh elvis5.sh elvis6.sh \ elvis7.sh elvis8.sh elvis1.sh: $(SRC1) cat >elvis1.sh README echo >>elvis1.sh ': ------------------------ CUT HERE --------------------' echo >>elvis1.sh 'test -d doc || mkdir doc || exit 2' shar >>elvis1.sh -h $(SRC1) elvis2.sh: $(SRC2) echo >elvis2.sh ': ------------------------ CUT HERE --------------------' echo >>elvis2.sh 'test -d doc || mkdir doc || exit 2' shar >>elvis2.sh -h $(SRC2) elvis3.sh: $(SRC3) shar $(SRC3) >elvis3.sh elvis4.sh: $(SRC4) shar $(SRC4) >elvis4.sh elvis5.sh: $(SRC5) shar $(SRC5) >elvis5.sh elvis6.sh: $(SRC6) shar $(SRC6) >elvis6.sh elvis7.sh: $(SRC7) shar $(SRC7) >elvis7.sh elvis8.sh: $(SRC8) shar $(SRC8) >elvis8.sh ############################################################################## # Under XENIX only! This stores all sources on a 3.5" 720k floppy disk. floppy: $(SRC1) $(SRC2) $(SRC3) $(SRC4) $(SRC5) $(SRC6) $(SRC7) $(SRC8) tar c5v $(SRC1) $(SRC2) $(SRC3) $(SRC4) $(SRC5) $(SRC6) $(SRC7) $(SRC8)