optimization for normal masks requires keeping ptr to associated leaf,
[unix-history] / usr / src / usr.bin / spell / Makefile
index e6e0ad2..89121f6 100644 (file)
@@ -1,48 +1,62 @@
-#      @(#)Makefile    4.4     %G%
-
-# The word lists may be extended by adding local words.
-# The set of files containing words to be added are defined
-# by LOCAL below. By default we add commands and library
-# function names defined in /usr/man/man[1238n].
-
-LOCAL=special.4bsd
-
-CFLAGS= -O
-
-all:   spell hlist hlista hlistb hstop spellin spellout
-
-install:       all
-       install -s spell $(DESTDIR)/usr/lib
-       install -s spellin ${DESTDIR}/usr/bin
-       install -s spellout ${DESTDIR}/usr/bin
-       install -c spell.sh $(DESTDIR)/usr/bin/spell
-       install -c hlista $(DESTDIR)/usr/dict
-       install -c hlistb $(DESTDIR)/usr/dict
-       install -c hstop $(DESTDIR)/usr/dict
-       install -c words $(DESTDIR)/usr/dict
-       install -c american $(DESTDIR)/usr/dict
-       install -c british $(DESTDIR)/usr/dict
-       install -c stop $(DESTDIR)/usr/dict
-       install -c README $(DESTDIR)/usr/dict
-       -mkdir $(DESTDIR)/usr/dict/special
-       install -c special.4bsd $(DESTDIR)/usr/dict/special/4bsd
-       install -c special.math $(DESTDIR)/usr/dict/special/math
-
-clean: 
-       rm -f *.o spell spellin hlista hlistb hlist hstop spellout
-
-spell: spell.o
-       cc spell.o -o spell
-spellin: spellin.o
-       cc spellin.o -o spellin
-spellout: spellout.o
-       cc spellout.o -o spellout
-
-hlist: /usr/dict/words spellin
-       spellin <words >hlist
-hlista: american $(LOCAL) hlist spellin
-       (cat american $(LOCAL))|spellin hlist >hlista
-hlistb: british $(LOCAL) hlist spellin
-       (cat british $(LOCAL))|spellin hlist >hlistb
+#      @(#)Makefile    8.1 (Berkeley) %G%
+
+LIBC=  /usr/lib/libc.a
+SRCS=  spell.c spellin.c spellout.c
+MAN1=  spell.0
+MLINKS=        spell.1 spellin.1 spell.1 spellout.1
+SPECIAL=${.CURDIR}/special.4bsd
+
+all: spell hlist hlista hlistb hstop spellin spellout ${MAN1}
+
+spell spellin spellout: ${LIBC}
+       ${CC} ${CFLAGS} ${.CURDIR}/${.PREFIX}.c -o ${.TARGET}
+
+hlist: spellin
+       spellin < /usr/share/dict/words > hlist
+
+hlista: american ${SPECIAL} hlist spellin
+       (cat ${.CURDIR}/american ${SPECIAL}) | spellin hlist > hlista
+
+hlistb: british ${SPECIAL} hlist spellin
+       (cat ${.CURDIR}/british ${SPECIAL}) | spellin hlist > hlistb
+
 hstop: stop spellin
 hstop: stop spellin
-       spellin <stop >hstop
+       spellin < ${.CURDIR}/stop > hstop
+
+clean:
+       rm -f a.out Errs errs mklog core spell spellin hlista \
+           hlistb hlist hstop spellout
+
+cleandir: clean
+       rm -f ${MAN1} ${.CURDIR}/tags .depend
+
+depend: .depend
+.depend: ${SRCS}
+       mkdep -p ${CFLAGS:M-[ID]*} ${.ALLSRC}
+
+DIR=   ${DESTDIR}/usr/share/dict
+FILES= ${.CURDIR}/american ${.CURDIR}/british hlist hlista hlistb hstop \
+       ${.CURDIR}/stop
+
+install: maninstall
+       install ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
+           spellin spellout ${DESTDIR}/usr/bin
+       install ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
+           spell ${DESTDIR}/usr/libexec
+       install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
+           ${.CURDIR}/spell.sh ${DESTDIR}/usr/bin/spell
+       install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${FILES} ${DIR}
+       install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/special.4bsd \
+           ${DIR}/special/4bsd
+       install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/special.math \
+           ${DIR}/special/math
+
+lint: ${SRCS}
+       cd ${.CURDIR}; ${LINT} ${LINTFLAGS} ${CFLAGS} spell.c
+       cd ${.CURDIR}; ${LINT} ${LINTFLAGS} ${CFLAGS} spellin.c
+       cd ${.CURDIR}; ${LINT} ${LINTFLAGS} ${CFLAGS} spellout.c
+
+tags: ${SRCS}
+       cd ${.CURDIR}; ctags ${SRCS}
+
+.include <bsd.prog.mk>