#
# Makefile -- Makefile for CONSERV
#
#   Copyright (C) 2005 Naohisa Goto <ngoto@gen-info.osaka-u.ac.jp>
# 
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  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
#
#
CC = gcc
CFLAGS = -Wall -O9

LIBSRCS      = mfstlib3.c my_malloc.c
LIBHEADERS   = $(LIBSRCS:.c=.h)
LIBOBJS      = $(LIBSRCS:.c=.o)

FILTERSRCS   = ifilter.c case_ifilter.c only_ifilter.c xmask_ifilter.c
FILTERHEDERS = $(FILTERSRCS:.c=.h)
FILTEROBJS   = $(FILTERSRCS:.c=.o)

CONSERVSRCS  = conserv.c $(LIBSRCS) $(FILTERSRCS)
CONSERVOBJS  = $(CONSERVSRCS:.c=.o)

SORTSRCS     = conserv_sort.c $(LIBSRCS)
SORTOBJS     = $(SORTSRCS:.c=.o)

all: conserv conserv_sort

# for optimizing, compile altogether
conserv: $(CONSERVSRCS) $(LIBHEADERS) $(FILTERHEADERS)
	$(CC) $(CFLAGS) -o $@ $(CONSERVSRCS)

conserv_sort: $(SORTSRCS) $(LIBHEADERS)
	$(CC) $(CFLAGS) -o $@ $(SORTSRCS)

clean:
	rm -f conserv conserv_sort $(CONSERVOBJS) $(SORTOBJS)

