include ../Makefile.toolchain

OPTFLAG?=-O0 -fno-rtti

CFLAGS=$(OPTFLAG) -pipe -Wall -ggdb -D__ZLIB_AVAILABLE__  -D_FILE_OFFSET_BITS=64 -I../thirdParty/zlib -I../thirdParty/samtools/ -D__STDC_LIMIT_MACROS

SOURCES=\
	BaseAsciiMap.cpp \
	BasicHash.cpp \
	BaseQualityHelper.cpp \
	BgzfFileType.cpp \
	CigarRoller.cpp \
	Error.cpp \
	GenomeSequence.cpp \
	GenotypeLists.cpp \
	GreedyTupleAligner.cpp \
	GzipFileType.cpp \
	GzipHeader.cpp \
	glfHandler.cpp \
	FastQ.cpp \
	FileType.cpp \
	FortranFormat.cpp \
	Hash.cpp \
	Input.cpp \
	InputFile.cpp \
	IntArray.cpp \
	IntHash.cpp \
	LongHash.cpp \
	LongLongCounter.cpp \
	MapFunction.cpp \
	MathVector.cpp \
	MemoryAllocators.cpp \
	MemoryInfo.cpp \
	MemoryMapArray.cpp \
	MemoryMap.cpp \
	MiniDeflate.cpp \
	Parameters.cpp \
	PedigreeAlleleFreq.cpp \
	Pedigree.cpp \
	PedigreeDescription.cpp \
	PedigreeFamily.cpp \
	PedigreeGlobals.cpp \
	PedigreeLoader.cpp \
	PedigreePerson.cpp \
	PedigreeTrim.cpp \
	PedigreeTwin.cpp \
	QuickIndex.cpp \
	Random.cpp \
	SmithWaterman.cpp \
	Sort.cpp \
	String.cpp \
	StringArray.cpp \
	StringBasics.cpp \
	StringHash.cpp \
	StringMap.cpp \
	TrimSequence.cpp \
	UncompressedFileType.cpp \
	WindowsHelper.cpp

# HEADERS=$(SOURCES:.cpp=.h)

OBJECTS=$(SOURCES:.cpp=.o)

LIBRARY=libcsg.a

$(LIBRARY) : $(OBJECTS)
	$(AR) cr $@ $(OBJECTS)
	$(RANLIB) $@

all: $(LIBRARY)

.cpp.o : 
	$(CXX) $(CFLAGS) -o $@ -c $*.cpp -DVERSION=\"$(VERSION)\"

test : all
	(cd test; $(MAKE) $(PARALLEL_MAKE) OPTFLAG="$(OPTFLAG)" --no-print-directory $@);

clean:
	-rm -rf $(LIBRARY) $(OBJECTS)
	(cd test; $(MAKE) $(PARALLEL_MAKE) OPTFLAG="$(OPTFLAG)" --no-print-directory $@);

.SUFFIXES : .cpp .c .o .X.o $(SUFFIXES)

# DFLAGS=-I$(HEADER_DIR) -I/usr/include/g++
DFLAGS=-Y

cleandepend:
	makedepend -- $(DFLAGS) --

depend:
	makedepend -- $(DFLAGS) -- $(SOURCES) >/dev/null 2>&1

# DO NOT DELETE THIS LINE -- make depend depends on it

BaseAsciiMap.o: BaseAsciiMap.h StringBasics.h InputFile.h FileType.h
BasicHash.o: BasicHash.h Error.h
BaseQualityHelper.o: BaseQualityHelper.h
BgzfFileType.o: BgzfFileType.h FileType.h
CigarRoller.o: CigarRoller.h Generic.h
Error.o: Error.h
GenomeSequence.o: Error.h Generic.h GenomeSequence.h MemoryMapArray.h
GenomeSequence.o: MemoryMap.h StringArray.h StringBasics.h InputFile.h
GenomeSequence.o: FileType.h
GenotypeLists.o: GenotypeLists.h Pedigree.h Constant.h PedigreeAlleles.h
GenotypeLists.o: LongInt.h PedigreePerson.h PedigreeGlobals.h StringArray.h
GenotypeLists.o: StringBasics.h InputFile.h FileType.h StringHash.h Hash.h
GenotypeLists.o: IntArray.h MathVector.h PedigreeFamily.h
GenotypeLists.o: PedigreeDescription.h PedigreeAlleleFreq.h
GreedyTupleAligner.o: GreedyTupleAligner.h Generic.h CigarRoller.h
GzipFileType.o: GzipFileType.h
GzipHeader.o: GzipHeader.h
glfHandler.o: glfHandler.h InputFile.h FileType.h StringBasics.h
glfHandler.o: BaseQualityHelper.h
FastQ.o: FastQ.h
FileType.o: FileType.h
FortranFormat.o: FortranFormat.h StringBasics.h InputFile.h FileType.h
FortranFormat.o: IntArray.h Error.h
Hash.o: Hash.h
Input.o: Input.h Error.h Constant.h
InputFile.o: InputFile.h FileType.h StringBasics.h GzipHeader.h
InputFile.o: BgzfFileType.h GzipFileType.h UncompressedFileType.h
IntArray.o: IntArray.h Error.h Hash.h Sort.h Constant.h
IntHash.o: IntHash.h Error.h
LongLongCounter.o: LongLongCounter.h LongHash.h Error.h
MapFunction.o: MapFunction.h MathConstant.h
MathVector.o: MathVector.h StringBasics.h InputFile.h FileType.h MathMatrix.h
MathVector.o: Error.h MathConstant.h Sort.h Constant.h
MemoryAllocators.o: MemoryAllocators.h
MemoryInfo.o: MemoryInfo.h StringBasics.h InputFile.h FileType.h
MemoryMapArray.o: MemoryMapArray.h MemoryMap.h
MemoryMap.o: MemoryMap.h
MiniDeflate.o: MiniDeflate.h
Parameters.o: Parameters.h StringMap.h StringBasics.h InputFile.h FileType.h
Parameters.o: Constant.h MathConstant.h Error.h
PedigreeAlleleFreq.o: PedigreeAlleleFreq.h Pedigree.h Constant.h
PedigreeAlleleFreq.o: PedigreeAlleles.h LongInt.h PedigreePerson.h
PedigreeAlleleFreq.o: PedigreeGlobals.h StringArray.h StringBasics.h
PedigreeAlleleFreq.o: InputFile.h FileType.h StringHash.h Hash.h IntArray.h
PedigreeAlleleFreq.o: MathVector.h PedigreeFamily.h PedigreeDescription.h
PedigreeAlleleFreq.o: QuickIndex.h StringMap.h Error.h
Pedigree.o: Pedigree.h Constant.h PedigreeAlleles.h LongInt.h
Pedigree.o: PedigreePerson.h PedigreeGlobals.h StringArray.h StringBasics.h
Pedigree.o: InputFile.h FileType.h StringHash.h Hash.h IntArray.h
Pedigree.o: MathVector.h PedigreeFamily.h PedigreeDescription.h
Pedigree.o: PedigreeAlleleFreq.h GenotypeLists.h MemoryInfo.h Error.h Sort.h
PedigreeDescription.o: PedigreeDescription.h PedigreeGlobals.h Constant.h
PedigreeDescription.o: StringArray.h StringBasics.h InputFile.h FileType.h
PedigreeDescription.o: StringHash.h Hash.h IntArray.h MathVector.h
PedigreeDescription.o: PedigreePerson.h PedigreeAlleles.h LongInt.h
PedigreeDescription.o: MapFunction.h FortranFormat.h Error.h
PedigreeFamily.o: Pedigree.h Constant.h PedigreeAlleles.h LongInt.h
PedigreeFamily.o: PedigreePerson.h PedigreeGlobals.h StringArray.h
PedigreeFamily.o: StringBasics.h InputFile.h FileType.h StringHash.h Hash.h
PedigreeFamily.o: IntArray.h MathVector.h PedigreeFamily.h
PedigreeFamily.o: PedigreeDescription.h PedigreeAlleleFreq.h MathConstant.h
PedigreeFamily.o: Error.h
PedigreeGlobals.o: PedigreeGlobals.h Constant.h StringArray.h StringBasics.h
PedigreeGlobals.o: InputFile.h FileType.h StringHash.h Hash.h IntArray.h
PedigreeGlobals.o: MathVector.h Sort.h Error.h
PedigreeLoader.o: Pedigree.h Constant.h PedigreeAlleles.h LongInt.h
PedigreeLoader.o: PedigreePerson.h PedigreeGlobals.h StringArray.h
PedigreeLoader.o: StringBasics.h InputFile.h FileType.h StringHash.h Hash.h
PedigreeLoader.o: IntArray.h MathVector.h PedigreeFamily.h
PedigreeLoader.o: PedigreeDescription.h PedigreeAlleleFreq.h FortranFormat.h
PedigreeLoader.o: Error.h
PedigreePerson.o: PedigreePerson.h Constant.h PedigreeAlleles.h LongInt.h
PedigreePerson.o: PedigreeGlobals.h StringArray.h StringBasics.h InputFile.h
PedigreePerson.o: FileType.h StringHash.h Hash.h IntArray.h MathVector.h
PedigreePerson.o: Error.h
PedigreeTrim.o: Pedigree.h Constant.h PedigreeAlleles.h LongInt.h
PedigreeTrim.o: PedigreePerson.h PedigreeGlobals.h StringArray.h
PedigreeTrim.o: StringBasics.h InputFile.h FileType.h StringHash.h Hash.h
PedigreeTrim.o: IntArray.h MathVector.h PedigreeFamily.h
PedigreeTrim.o: PedigreeDescription.h PedigreeAlleleFreq.h
PedigreeTwin.o: Pedigree.h Constant.h PedigreeAlleles.h LongInt.h
PedigreeTwin.o: PedigreePerson.h PedigreeGlobals.h StringArray.h
PedigreeTwin.o: StringBasics.h InputFile.h FileType.h StringHash.h Hash.h
PedigreeTwin.o: IntArray.h MathVector.h PedigreeFamily.h
PedigreeTwin.o: PedigreeDescription.h PedigreeAlleleFreq.h Error.h
QuickIndex.o: QuickIndex.h MathVector.h StringBasics.h InputFile.h FileType.h
QuickIndex.o: StringArray.h IntArray.h StringMap.h Error.h
Random.o: Random.h MathConstant.h Error.h
SmithWaterman.o: SmithWaterman.h CigarRoller.h Generic.h
Sort.o: Sort.h Constant.h Error.h
UncompressedFileType.o: UncompressedFileType.h FileType.h
String.o: String.h
StringArray.o: StringArray.h StringBasics.h InputFile.h FileType.h Sort.h
StringArray.o: Constant.h Error.h
StringBasics.o: StringBasics.h InputFile.h FileType.h Error.h Constant.h
StringBasics.o: MathConstant.h
StringHash.o: StringHash.h StringBasics.h InputFile.h FileType.h Constant.h
StringHash.o: Hash.h Error.h
StringMap.o: StringMap.h StringBasics.h InputFile.h FileType.h
TrimSequence.o: TrimSequence.h
WindowsHelper.o: WindowsHelper.h
