1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
|
# Makefile for Joe's Own Editor
###############
# Configuration
###############
# Set where you want joe to go, where you
# want joe's initialization file (joerc)
# to go and where you want the man page
# to go:
WHEREJOE = /usr/bin
WHERERC = /etc/joe
WHEREMAN = /usr/man/man1
DESTDIR =
WHEREINSTALLJOE = $(DESTDIR)$(WHEREJOE)
WHEREINSTALLRC = $(DESTDIR)$(WHERERC)
WHEREINSTALLMAN = $(DESTDIR)$(WHEREMAN)
# If you want to use TERMINFO, you have to set
# the following variable to 1. Also you have to
# include some additional libraries- see below.
TERMINFO = 1
# You may also have to add some additional
# defines to get the include files to work
# right on some systems.
#
# for some HPUX systems, you need to add: -D_HPUX_SOURCE
# C compiler options: make's built-in rules use this variable
CFLAGS = -O2
# C compiler to use: make's built-in rules use this variable
CC = gcc
# You may have to include some extra libraries
# for some systems
#
# for Xenix, add (in this order!!): -ldir -lx
#
# For some systems you might have to add: -lbsd
# to get access to the timer system calls.
#
# If you wish to use terminfo, you have to
# add '-ltinfo', '-lcurses' or '-ltermlib',
# depending on the system.
EXTRALIBS = -lcurses
# Object files
OBJS = b.o blocks.o bw.o cmd.o hash.o help.o kbd.o macro.o main.o menu.o \
path.o poshist.o pw.o queue.o qw.o random.o rc.o regex.o scrn.o tab.o \
termcap.o tty.o tw.o ublock.o uedit.o uerror.o ufile.o uformat.o uisrch.o \
umath.o undo.o usearch.o ushell.o utag.o va.o vfile.o vs.o w.o zstr.o
# That's it!
# How to make joe from object files. Object files are made from source
joe: $(OBJS)
rm -f jmacs jstar rjoe jpico
$(CC) $(CFLAGS) -o joe $(OBJS) $(EXTRALIBS)
ln joe jmacs
ln joe jstar
ln joe rjoe
ln joe jpico
# All object files depend on config.h
$(OBJS): config.h
# How to make config.h
config.h:
$(CC) conf.c -o conf
./conf $(WHERERC) $(TERMINFO)
# How to make termidx
termidx: termidx.o
$(CC) $(CFLAGS) -o termidx termidx.o
# Install proceedure
install: joe termidx
strip joe
strip termidx
if [ ! -d $(WHEREINSTALLJOE) ]; then mkdir $(WHEREINSTALLJOE); chmod a+rx $(WHEREINSTALLJOE); fi
rm -f $(WHEREINSTALLJOE)/joe $(WHEREINSTALLJOE)/jmacs $(WHEREINSTALLJOE)/jstar $(WHEREINSTALLJOE)/jpico $(WHEREINSTALLJOE)/rjoe $(WHEREINSTALLJOE)/termidx
mv joe $(WHEREINSTALLJOE)
ln $(WHEREINSTALLJOE)/joe $(WHEREINSTALLJOE)/jmacs
ln $(WHEREINSTALLJOE)/joe $(WHEREINSTALLJOE)/jstar
ln $(WHEREINSTALLJOE)/joe $(WHEREINSTALLJOE)/rjoe
ln $(WHEREINSTALLJOE)/joe $(WHEREINSTALLJOE)/jpico
mv termidx $(WHEREINSTALLJOE)
if [ ! -d $(WHEREINSTALLRC) ]; then mkdir $(WHEREINSTALLRC); chmod a+rx $(WHEREINSTALLRC); fi
rm -f $(WHEREINSTALLRC)/joerc $(WHEREINSTALLRC)/jmacsrc $(WHEREINSTALLRC)/jstarrc $(WHEREINSTALLRC)/jpicorc $(WHEREINSTALLRC)/rjoerc $(WHEREINSTALLMAN)/joe.1
cp joerc $(WHEREINSTALLRC)
cp editorrc $(WHEREINSTALLRC)
cp jmacsrc $(WHEREINSTALLRC)
cp jstarrc $(WHEREINSTALLRC)
cp rjoerc $(WHEREINSTALLRC)
cp jpicorc $(WHEREINSTALLRC)
cp joe.1 $(WHEREINSTALLMAN)
chmod a+x $(WHEREINSTALLJOE)/joe
chmod a+x $(WHEREINSTALLJOE)/jmacs
chmod a+x $(WHEREINSTALLJOE)/jstar
chmod a+x $(WHEREINSTALLJOE)/rjoe
chmod a+x $(WHEREINSTALLJOE)/jpico
chmod a+r $(WHEREINSTALLRC)/joerc
chmod a+r $(WHEREINSTALLRC)/jmacsrc
chmod a+r $(WHEREINSTALLRC)/jstarrc
chmod a+r $(WHEREINSTALLRC)/rjoerc
chmod a+r $(WHEREINSTALLRC)/jpicorc
chmod a+r $(WHEREINSTALLMAN)/joe.1
chmod a+x $(WHEREINSTALLJOE)/termidx
rm -f $(WHEREINSTALLRC)/termcap
cp termcap $(WHEREINSTALLRC)/termcap
chmod a+r $(WHEREINSTALLRC)/termcap
rm -f $(WHEREINSTALLRC)/terminfo
cp terminfo $(WHEREINSTALLRC)/terminfo
chmod a+r $(WHEREINSTALLRC)/terminfo
# Cleanup proceedure
clean:
rm -f $(OBJS) termidx.o conf conf.o config.h
|