## Copyright (C) 2009 Keith Crane
## 
## This file is part DFILE Tools.
## 
## DFILE Tools 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 3 of the License, or (at
## your option) any later version.
## 
## DFILE Tools 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 DFILE Tools; see the file COPYING.  If not, see
## <http://www.gnu.org/licenses/>.
## 

##
##  $Id: Makefile,v 1.2 2009/11/01 22:37:58 keith Exp $
##
##  $Log: Makefile,v $
##  Revision 1.2  2009/11/01 22:37:58  keith
##  Added GPL to source code.
##
##  Revision 1.1  2009/02/15 03:47:23  keith
##  Initial revision
##
##

INCDIR=../include
##
## DNDEBUG turns off assert() calls.
##
CFLAGS=-Wall -O -I$(INCDIR) $(MT_CC)
VPATH=RCS

OBJ=atod.o dhsearch.o fmt_ctime.o fput_wrappers.o get_ctime.o glob_fname.o \
	global.o isprime.o nubsearch.o rbtree.o str_to_unix_time.o \
	strenv.o strhkey.o substitute_str.o toa_wrappers.o trim_spaces.o \
	unix_error.o thread_error.o psearch.o file_basename.o cfg_read.o \
	cfg_lookup.o parse_list.o insertion_sort.o shell_sort.o heap_sort.o \
	merge_sort.o strtoupper.o strnncmp.o load_text_file.o \
	load_script_file.o cfg_open.o

TARGET=libtbox.a

# Rule to compile any program (specify EXE= and OBJS= on command line)

$(TARGET): $(TARGET)(atod.o) $(TARGET)(dhsearch.o) \
	$(TARGET)(fmt_ctime.o) $(TARGET)(fput_wrappers.o) \
	$(TARGET)(get_ctime.o) $(TARGET)(glob_fname.o) $(TARGET)(global.o) \
	$(TARGET)(isprime.o) $(TARGET)(nubsearch.o) $(TARGET)(rbtree.o) \
	$(TARGET)(str_to_unix_time.o) $(TARGET)(strenv.o) \
	$(TARGET)(strhkey.o) $(TARGET)(substitute_str.o) \
	$(TARGET)(toa_wrappers.o) $(TARGET)(trim_spaces.o) \
	$(TARGET)(unix_error.o) $(TARGET)(thread_error.o) \
	$(TARGET)(load_text_file.o) $(TARGET)(psearch.o) \
	$(TARGET)(file_basename.o) $(TARGET)(cfg_read.o) \
	$(TARGET)(cfg_lookup.o) $(TARGET)(parse_list.o) \
	$(TARGET)(insertion_sort.o) $(TARGET)(shell_sort.o) \
	$(TARGET)(heap_sort.o) $(TARGET)(merge_sort.o) \
	$(TARGET)(strtoupper.o) $(TARGET)(strnncmp.o) \
	$(TARGET)(load_script_file.o) $(TARGET)(cfg_open.o)
	$(AR) $(ARFLAGS) $(TARGET) $(OBJ)

cfg_read: cfg_read.o global.o fmt_ctime.o unix_error.o get_ctime.o fput_wrappers.o
	$(CC) -Aa -o cfg_read cfg_read.o fmt_ctime.o global.o unix_error.o get_ctime.o fput_wrappers.o

parse_list: parse_list.o global.o fmt_ctime.o unix_error.o get_ctime.o
	$(CC) -Wall -o parse_list parse_list.o fmt_ctime.o global.o unix_error.o get_ctime.o

unix_error: unix_error.o global.o fmt_ctime.o
	$(CC) -Aa -o unix_error unix_error.o fmt_ctime.o global.o

substitute_str: substitute_str.o global.o fmt_ctime.o
	$(CC) -Aa -o substitute_str substitute_str.o fmt_ctime.o global.o

rbtree: rbtree.o
	$(CC) -Aa -o rbtree rbtree.o

dhsearch: dhsearch.o isprime.o strhkey.o global.o
	$(CC) -Aa -o dhsearch dhsearch.o isprime.o strhkey.o global.o

fmt_ctime.o: $(INCDIR)/tbox.h

global.o: $(INCDIR)/tbox.h

dhsearch.o: $(INCDIR)/tbox.h

isprime.o: $(INCDIR)/tbox.h

strhkey.o: $(INCDIR)/tbox.h

unix_error.o: $(INCDIR)/tbox.h

substitute_str.o: $(INCDIR)/tbox.h

rbtree.o: $(INCDIR)/rbtree.h

clean:
	rm -f $(TARGET) $(OBJ)

$(TARGET)(atod).o: $(INCDIR)/tbox.h
$(TARGET)(dhsearch).o: $(INCDIR)/tbox.h
$(TARGET)(fmt_ctime).o: $(INCDIR)/tbox.h
$(TARGET)(fput_wrappers).o: $(INCDIR)/tbox.h
$(TARGET)(get_ctime).o: $(INCDIR)/tbox.h
$(TARGET)(glob_fname).o: $(INCDIR)/tbox.h
$(TARGET)(global).o: $(INCDIR)/tbox.h
$(TARGET)(isprime).o: $(INCDIR)/tbox.h
$(TARGET)(nubsearch).o: $(INCDIR)/tbox.h
$(TARGET)(rbtree).o: $(INCDIR)/tbox.h
$(TARGET)(str_to_unix_time).o: $(INCDIR)/tbox.h
$(TARGET)(strenv).o: $(INCDIR)/tbox.h
$(TARGET)(strhkey).o: $(INCDIR)/tbox.h
$(TARGET)(substitute_str).o: $(INCDIR)/tbox.h
$(TARGET)(toa_wrappers).o: $(INCDIR)/tbox.h
$(TARGET)(trim_spaces).o: $(INCDIR)/tbox.h
$(TARGET)(unix_error).o: $(INCDIR)/tbox.h
$(TARGET)(thread_error).o: $(INCDIR)/tbox.h
$(TARGET)(load_text_file).o: $(INCDIR)/tbox.h
$(TARGET)(psearch).o: $(INCDIR)/tbox.h
$(TARGET)(file_basename).o: $(INCDIR)/tbox.h
$(TARGET)(cfg_read).o: $(INCDIR)/tbox.h
$(TARGET)(cfg_lookup).o: $(INCDIR)/tbox.h
$(TARGET)(parse_list).o: $(INCDIR)/tbox.h
$(TARGET)(insertion_sort).o: $(INCDIR)/tbox.h
$(TARGET)(shell_sort).o: $(INCDIR)/tbox.h
$(TARGET)(heap_sort).o: $(INCDIR)/tbox.h
$(TARGET)(merge_sort).o: $(INCDIR)/tbox.h
$(TARGET)(strtoupper).o: $(INCDIR)/tbox.h
$(TARGET)(strnncmp).o: $(INCDIR)/tbox.h
$(TARGET)(load_script_file).o: $(INCDIR)/tbox.h
$(TARGET)(cfg_open).o: $(INCDIR)/tbox.h
