Makefile 3.35 KB
Newer Older
Richard Curnow's avatar
Richard Curnow committed
1 2
#########################################################################
#
3
# $Header: /cvs/src/mairix/Attic/Makefile,v 1.5 2003/02/24 23:56:40 richard Exp $
Richard Curnow's avatar
Richard Curnow committed
4 5 6 7 8
#
# =======================================================================
#
# mairix - message index builder and finder for maildir folders.
#
9
# Copyright (C) Richard P. Curnow  2002, 2003
Richard Curnow's avatar
Richard Curnow committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
# 
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
#
# =======================================================================

#########################################################################
# Edit the following variables as required
CC=gcc
#CFLAGS=-O2
#CFLAGS=-O2 -pg
CFLAGS=-Wall -g

33
prefix=/usr/local
Richard Curnow's avatar
Richard Curnow committed
34 35 36
bindir=$(prefix)/bin
mandir=$(prefix)/man
man1dir=$(mandir)/man1
37 38
infodir=$(prefix)/info
docdir=$(prefix)/docs
Richard Curnow's avatar
Richard Curnow committed
39 40 41 42 43

#########################################################################
# Things below this point shouldn't need to be edited.

OBJ = mairix.o db.o rfc822.o tok.o hash.o dirscan.o writer.o \
44
      reader.o search.o stats.o dates.o datescan.o
Richard Curnow's avatar
Richard Curnow committed
45 46 47 48 49 50

all : mairix

mairix : $(OBJ)
	$(CC) -o mairix $(CFLAGS) $(OBJ)

51
%.o : %.c memmac.h mairix.h reader.h Makefile
Richard Curnow's avatar
Richard Curnow committed
52 53
	$(CC) -c $(CFLAGS) $<

54 55 56
datescan.c : datescan.nfa
	dfasyn -o datescan.c -v -u datescan.nfa

Richard Curnow's avatar
Richard Curnow committed
57 58 59 60 61 62 63 64 65 66 67 68
clean:
	-rm -f *~ *.o mairix *.s core mairix.txt mairix.html mairix.dvi mairix.ps mairix.pdf mairix.info
	-rm -f mairix.cp mairix.fn mairix.aux mairix.log mairix.ky mairix.pg mairix.toc mairix.tp mairix.vr

install:
	[ -d $(prefix) ] || mkdir -p $(prefix)
	[ -d $(bindir) ] || mkdir -p $(bindir)
	[ -d $(mandir) ] || mkdir -p $(mandir)
	[ -d $(man1dir) ] || mkdir -p $(man1dir)
	cp -f mairix $(bindir)
	chmod 555 $(bindir)/mairix

69 70 71 72 73 74 75
install_docs:
	if [ -f mairix.info ]; then [ -d $(infodir) ] || mkdir -p $(infodir) ; cp -f mairix.info* $(infodir) ; chmod 444 $(infodir)/mairix.info* ; fi
	if [ -f mairix.txt ]; then [ -d $(docdir) ] || mkdir -p $(docdir) ; cp -f mairix.txt $(docdir) ; chmod 444 $(docdir)/mairix.txt ; fi
	if [ -f mairix.html ]; then [ -d $(docdir) ] || mkdir -p $(docdir) ; cp -f mairix.html $(docdir) ; chmod 444 $(docdir)/mairix.html ; fi
	if [ -f mairix.dvi ]; then [ -d $(docdir) ] || mkdir -p $(docdir) ; cp -f mairix.dvi $(docdir) ; chmod 444 $(docdir)/mairix.dvi ; fi
	if [ -f mairix.pdf ]; then [ -d $(docdir) ] || mkdir -p $(docdir) ; cp -f mairix.pdf $(docdir) ; chmod 444 $(docdir)/mairix.pdf ; fi

Richard Curnow's avatar
Richard Curnow committed
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
docs : mairix.info mairix.txt mairix.html mairix.dvi mairix.pdf

mairix.info : mairix.texi
	makeinfo mairix.texi

mairix.txt : mairix.texi
	makeinfo --no-split --number-sections --no-headers mairix.texi > mairix.txt

mairix.html : mairix.texi
	makeinfo --no-split --number-sections --html mairix.texi > mairix.html

mairix.dvi : mairix.texi
	tex mairix.texi
	tex mairix.texi

mairix.ps : mairix.dvi
	dvips mairix.dvi -o

mairix.pdf : mairix.texi
	pdftex mairix.texi
	pdftex mairix.texi