## 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 20:56:22 keith Exp $
##
##  $Log: Makefile,v $
##  Revision 1.3  2009/11/01 20:56:22  keith
##  Added GPL to source code.
##
##  Revision 1.2  2009/03/18 00:23:21  keith
##  Added checks for NDEBUG macro.
##
##  Revision 1.1  2009/03/12 15:24:44  keith
##  Initial revision
##
##

##
## DNDEBUG turns off assert() calls.
##
INC=../include

CFLAGS=-Wall -O -I$(INC) $(MT_CC)

VPATH=SRC

OBJ = main.o get_args.o parse_one_key.o parse_key_argument.o open_input.o \
	assign_order_by_field_offset.o copy_sort_record.o \
	sort_records.o \
	open_output.o map_io_fields.o merge_records.o numeric_cmp.o \
	high_value_null_cmp.o open_merge_input.o \
	copy_record_to_bind.o write_sorted_records.o compare.o \
	map_merge_fields.o create_merge_queue.o compare_order_by_bind.o \
	add_to_merge_queue.o compare_sort_field_bind.o control_syntax_error.o \
	assign_control_information.o level1_syntax.o assign_order_by.o \
	assign_field_attribute.o assign_sort.o assign_sort_dfile.o \
	assign_sort_dfile_attribute.o assign_tag.o \
	assign_algorithm.o assign_ushort.o assign_open_mode.o assign_output.o \
	assign_output_dfile.o assign_output_dfile_attribute.o \
	load_sort.o merge_write.o

TARGET = dfile_sort

$(TARGET): $(OBJ)
	$(CC) -O -o $(TARGET) $(OBJ) -L../lib \
	-lwhere -lsexpr -ldfile_dynamic -ldfile_utility -ldfile -ltbox -lz -lpthread

main.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

get_args.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

open_input.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

open_output.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

parse_one_key.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

parse_key_argument.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

assign_order_by_field_offset.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

copy_record.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

sort_records.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

map_io_fields.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

merge_records.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

numeric_cmp.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

high_value_null_cmp.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

open_merge_input.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

copy_record_to_bind.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

write_sorted_records.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

compare.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

map_merge_fields.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

create_merge_queue.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

compare_order_by_bind.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

add_to_merge_queue.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

compare_sort_field_bind.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

control_syntax_error.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

assign_control_information.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

level1_syntax.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

assign_order_by.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

assign_field_attribute.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

assign_sort.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

assign_sort_dfile.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

assign_sort_dfile_attribute.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

assign_tag.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

assign_algorithm.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

assign_ushort.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

assign_open_mode.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

assign_output.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

assign_output_dfile.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

assign_output_dfile_attribute.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

load_sort.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

merge_write.o: $(INC)/tbox.h $(INC)/dfile.h dfile_sort.h

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