## 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.3 2009/11/01 21:29:21 keith Exp $
##
##
## $Log: Makefile,v $
## Revision 1.3  2009/11/01 21:29:21  keith
## Added GPL to source code.
##
## Revision 1.2  2009/03/18 00:49:46  keith
## Added checks for NDEBUG macro.
##
## Revision 1.1  2009/02/28 22:49:11  keith
## Initial revision
##
##

INCDIR=../include

##
## DNDEBUG turns off assert() calls.
##
#CC=gcc
CFLAGS=-D_REENTRANT -Wall -O -I$(INCDIR) $(MT_CC)
#CFLAGS=-Wall $(64bit) -I. -I$(INCDIR)

OBJ=_dfile_bind.o dfile_read_open.o dfile_read.o \
	_dfile_parse_field.o \
	_dfile_parse_escaped_field.o _dfile_read_open_file.o \
	_dfile_escaped_overflow.o _dfile_overflow.o \
	_dfile_refill_ascii_buffer.o _dfile_buffer_read_thread.o \
	_dfile_buffer_write_thread.o _dfile_buffer_wait.o _dfile_read_gz_header.o \
	_dfile_refill_zipped_buffer.o _dfile_identify_format.o \
	_dfile_set_refill_buffer_func.o _dfile_resize_overflow.o \
	_dfile_check_zipped_crc.o _dfile_create_thread.o _dfile_free.o \
	_dfile_allocate_zipped_stream.o \
	_dfile_create_buffers.o dfile_write.o \
	_dfile_format_str_field.o _dfile_allocate_buffer.o dfile_write_open.o \
	_dfile_write_open_file.o _dfile_flush_ascii_buffer.o \
	_dfile_format_field.o _dfile_get_record.o _dfile_parse_record.o \
	_dfile_format_escaped_field.o _dfile_format_escaped_str_field.o \
	dfile_write_close.o _dfile_write_gz_header.o \
	_dfile_flush_zipped_buffer.o dfile_read_close.o \
	_dfile_write_zipped_crc.o _dfile_read_registry_field_file.o \
	_dfile_skip_spaces.o _dfile_parse_registry_field.o \
	_dfile_parse_registry_field_rec.o _dfile_read_gz_file.o \
	_dfile_copy_raw_gz_data.o _dfile_release_buffer.o dfile_cfg.o \
	_dfile_alloc_bind_fields.o _dfile_sub_tags.o _dfile_vdate_rwopen_args.o \
	_dfile_construct.o _dfile_advance_buffer.o \
	_dfile_copy_field_to_buffer.o _dfile_get_var_record.o \
	_dfile_var_rec_refill_zipped_buffer.o \
	_dfile_var_rec_refill_ascii_buffer.o _dfile_var_record_append_overflow.o \
	_dfile_var_record_save_overflow.o _dfile_process_delimited_record.o \
	_dfile_process_variable_record.o _dfile_process_threaded_read.o \
	_dfile_process_read.o _dfile_read_eof_processing.o \
	_dfile_parse_record_failure.o _dfile_var_field_failure.o \
	_dfile_create_bind_hash_table.o dfile_bind_field_name_cmp.o

TARGET=libdfile.a

$(TARGET): $(TARGET)(_dfile_bind.o) $(TARGET)(dfile_read_open.o) \
	$(TARGET)(dfile_read.o) \
	$(TARGET)(_dfile_parse_field.o) \
	$(TARGET)(_dfile_parse_escaped_field.o) \
	$(TARGET)(_dfile_read_open_file.o) \
	$(TARGET)(_dfile_escaped_overflow.o) $(TARGET)(_dfile_overflow.o) \
	$(TARGET)(_dfile_refill_ascii_buffer.o) \
	$(TARGET)(_dfile_buffer_read_thread.o) \
	$(TARGET)(_dfile_buffer_write_thread.o) \
	$(TARGET)(_dfile_buffer_wait.o) $(TARGET)(_dfile_read_gz_header.o) \
	$(TARGET)(_dfile_refill_zipped_buffer.o) \
	$(TARGET)(_dfile_identify_format.o) \
	$(TARGET)(_dfile_set_refill_buffer_func.o) \
	$(TARGET)(_dfile_resize_overflow.o) $(TARGET)(_dfile_check_zipped_crc.o) \
	$(TARGET)(_dfile_create_thread.o) $(TARGET)(_dfile_free.o) \
	$(TARGET)(_dfile_allocate_zipped_stream.o) \
	$(TARGET)(_dfile_create_buffers.o) \
	$(TARGET)(dfile_write.o) $(TARGET)(_dfile_format_str_field.o) \
	$(TARGET)(_dfile_allocate_buffer.o) $(TARGET)(dfile_write_open.o) \
	$(TARGET)(_dfile_write_open_file.o) \
	$(TARGET)(_dfile_flush_ascii_buffer.o) \
	$(TARGET)(_dfile_format_field.o) \
	$(TARGET)(_dfile_format_escaped_field.o) \
	$(TARGET)(_dfile_format_escaped_str_field.o) \
	$(TARGET)(dfile_write_close.o) $(TARGET)(_dfile_write_gz_header.o) \
	$(TARGET)(_dfile_flush_zipped_buffer.o) \
	$(TARGET)(_dfile_write_zipped_crc.o) $(TARGET)(dfile_read_close.o) \
	$(TARGET)(_dfile_read_registry_field_file.o) \
	$(TARGET)(_dfile_skip_spaces.o) \
	$(TARGET)(_dfile_parse_registry_field.o) \
	$(TARGET)(_dfile_parse_registry_field_rec.o) \
	$(TARGET)(_dfile_read_gz_file.o) $(TARGET)(_dfile_copy_raw_gz_data.o) \
	$(TARGET)(_dfile_release_buffer.o) \
	$(TARGET)(_dfile_get_record.o) \
	$(TARGET)(_dfile_parse_record.o) \
	$(TARGET)(dfile_cfg.o) \
	$(TARGET)(_dfile_alloc_bind_fields.o) \
	$(TARGET)(_dfile_sub_tags.o) \
	$(TARGET)(_dfile_vdate_rwopen_args.o) \
	$(TARGET)(_dfile_construct.o) \
	$(TARGET)(_dfile_advance_buffer.o) \
	$(TARGET)(_dfile_copy_field_to_buffer.o) \
	$(TARGET)(_dfile_get_var_record.o) \
	$(TARGET)(_dfile_var_rec_refill_zipped_buffer.o) \
	$(TARGET)(_dfile_var_rec_refill_ascii_buffer.o) \
	$(TARGET)(_dfile_var_record_append_overflow.o) \
	$(TARGET)(_dfile_var_record_save_overflow.o) \
	$(TARGET)(_dfile_process_delimited_record.o) \
	$(TARGET)(_dfile_process_variable_record.o) \
	$(TARGET)(_dfile_process_threaded_read.o) \
	$(TARGET)(_dfile_process_read.o) \
	$(TARGET)(_dfile_read_eof_processing.o) \
	$(TARGET)(_dfile_var_field_failure.o) \
	$(TARGET)(_dfile_parse_record_failure.o) \
	$(TARGET)(_dfile_create_bind_hash_table.o) \
	$(TARGET)(dfile_bind_field_name_cmp.o)
	$(AR) $(ARFLAGS) $(TARGET) $(OBJ)

64bit:
	$(MAKE) '64bit=-q64' 'ARFLAGS=-rv -X64'

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

$(TARGET)(_dfile_bind).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(dfile_read_open).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(dfile_read).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_read_open_file).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_parse_field).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_parse_escaped_field).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_escaped_overflow).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_overflow).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_refill_ascii_buffer).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_buffer_read_thread).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_buffer_write_thread).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_buffer_wait).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_read_gz_header).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_refill_zipped_buffer).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_identify_format).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_set_refill_buffer_func).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_resize_overflow).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_check_zipped_crc).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_create_thread).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_free).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_allocate_zipped_stream).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_create_buffers).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(dfile_write).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_format_str_field).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_allocate_buffer).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(dfile_write_open).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_write_open_file).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_flush_ascii_buffer).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_format_field).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_format_escaped_field).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_format_escaped_str_field).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(dfile_write_close).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_write_gz_header).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_flush_zipped_buffer).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_write_zipped_crc).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(dfile_read_close).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_read_registry_field_file).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_skip_spaces).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(dfile_open_registry_file).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_parse_registry_field_rec).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_parse_registry_field).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_read_gz_file).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_copy_raw_gz_data).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_release_buffer).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_get_record).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_parse_record).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(dfile_cfg).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_alloc_bind_fields).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_sub_tags).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_vdate_rwopen_args).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_construct).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_advance_buffer).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_copy_field_to_buffer).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_get_var_record).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_var_rec_refill_zipped_buffer).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_var_rec_refill_ascii_buffer).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_var_record_append_overflow).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_var_record_save_overflow).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_process_delimited_record).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_process_variable_record).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_process_threaded_read).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_process_read).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_read_eof_processing).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_parse_record_failure).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_var_field_failure).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(_dfile_create_bind_hash_table).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h

$(TARGET)(dfile_bind_field_name_cmp).o: $(INCDIR)/dfile.h $(INCDIR)/tbox.h
