| 1 |
# Makefile for lacheck. |
| 2 |
|
| 3 |
# If both flex lacheck.c are missing, copy lacheck.noflex.c to |
| 4 |
# lacheck.c. |
| 5 |
|
| 6 |
prefix = /usr/local |
| 7 |
exec_prefix = $(prefix) |
| 8 |
|
| 9 |
bindir = $(exec_prefix)/bin |
| 10 |
mandir = $(prefix)/man/man1 |
| 11 |
manext = .1 |
| 12 |
srcdir = . |
| 13 |
|
| 14 |
# Use `cc -bsd' on a next |
| 15 |
# use `cc -cckr' on a sgi |
| 16 |
# CC = gcc -traditional |
| 17 |
CC=cc |
| 18 |
|
| 19 |
CFLAGS = -g # -O -DNEED_STRSTR |
| 20 |
|
| 21 |
# No changes should be needed below |
| 22 |
|
| 23 |
# Remember to change when lacheck is updated. |
| 24 |
REV = 1.26 |
| 25 |
|
| 26 |
DISTFILES = lacheck.lex lacheck.man Makefile lacheck.c test.tex test.old \ |
| 27 |
lacheck.hlp make_vms.com |
| 28 |
|
| 29 |
FTPDIR = /home/ftp/pub/Staff/Per.Abrahamsen/mirror/ftp/lacheck |
| 30 |
|
| 31 |
SHELL = /bin/sh |
| 32 |
|
| 33 |
LACHECK=lacheck |
| 34 |
|
| 35 |
INSTALL = cp |
| 36 |
INSTALL_PROGRAM = $(INSTALL) |
| 37 |
INSTALL_DATA = $(INSTALL) |
| 38 |
|
| 39 |
FLEX = flex |
| 40 |
FLEXFLAGS = -8 |
| 41 |
|
| 42 |
LIBS= #-ll |
| 43 |
|
| 44 |
$(LACHECK): lacheck.o |
| 45 |
$(CC) $(CFLAGS) -o $@ $(srcdir)/lacheck.o $(LIBS) |
| 46 |
|
| 47 |
lacheck.c: lacheck.lex |
| 48 |
-if [ ! -f $(srcdir)/lacheck.noflex.c ] ; then \ |
| 49 |
if [ -f $(srcdir)/lacheck.c ] ; then \ |
| 50 |
$(INSTALL_DATA) $(srcdir)/lacheck.c $(srcdir)/lacheck.noflex.c ; \ |
| 51 |
fi ; \ |
| 52 |
fi |
| 53 |
$(FLEX) $(FLEXFLAGS) $(srcdir)/lacheck.lex |
| 54 |
mv $(srcdir)/lex.yy.c $@ |
| 55 |
|
| 56 |
lacheck.1: lacheck.man |
| 57 |
-sed -e "s!%%LACHECKREV%%!Release $(REV)!" $(srcdir)/lacheck.man |\ |
| 58 |
sed -e "s!%%LACHECKDATE%%!`date +%D`!" |\ |
| 59 |
sed -e "s!%%LACHECKPATH%%!$(bindir)/$(LACHECK)!" > $@ |
| 60 |
|
| 61 |
test.new: test.tex $(LACHECK) |
| 62 |
$(srcdir)/$(LACHECK) $(srcdir)/test.tex > $@ |
| 63 |
|
| 64 |
test.old: test.tex $(LACHECK) |
| 65 |
$(srcdir)/$(LACHECK) $(srcdir)/test.tex > $@ |
| 66 |
|
| 67 |
check: test.new |
| 68 |
-diff $(srcdir)/test.old $(srcdir)/test.new |
| 69 |
|
| 70 |
install: $(LACHECK) lacheck.1 |
| 71 |
cp $(srcdir)/$(LACHECK) $(DESTDIR)$(bindir) |
| 72 |
cp $(srcdir)/lacheck.1 $(DESTDIR)$(mandir)/lacheck$(manext) |
| 73 |
|
| 74 |
uninstall: |
| 75 |
-rm -f $(bindir)/$(LACHECK) $(mandir)/lacheck$(manext) |
| 76 |
|
| 77 |
clean: |
| 78 |
-rm -f $(srcdir)/$(LACHECK) $(srcdir)/*.o $(srcdir)/*.1 $(srcdir)/*~ |
| 79 |
|
| 80 |
distclean: clean |
| 81 |
|
| 82 |
mostlyclean: clean |
| 83 |
-rm -f $(srcdir)/lacheck.c $(srcdir)/lacheck.noflex.c |
| 84 |
|
| 85 |
realclean: mostlyclean |
| 86 |
-rm -f test.old |
| 87 |
|
| 88 |
dist: $(DISTFILES) |
| 89 |
mkdir lacheck-$(REV) |
| 90 |
cp $(DISTFILES) lacheck-$(REV) |
| 91 |
touch lacheck-$(REV)/lacheck.c |
| 92 |
-rm -f $(FTPDIR)/lacheck-$(REV).tar.gz |
| 93 |
-rm -f $(FTPDIR)/lacheck.tar.gz $(FTPDIR)/lacheck.tar.Z |
| 94 |
tar -cf - lacheck-$(REV) | gzip > $(FTPDIR)/lacheck-$(REV).tar.gz |
| 95 |
tar -cf - lacheck-$(REV) | compress > $(FTPDIR)/lacheck-$(REV).tar.Z |
| 96 |
(cd $(FTPDIR); ln -s lacheck-$(REV).tar.gz lacheck.tar.gz) |
| 97 |
|