CC = c++

NWAY_OBJ = bedfile.o bedfiles.o nway_calc.o exception.o result.o
BINFILE_OBJ = binfile.o bedfile.o exception.o

CFLAGS = -O2 -std=c++11 -Wwritable-strings
#CFLAGS = -Ofast -std=c++11 -Wwritable-strings
#-Wc++11-extensions -Wc++11-compat-deprecated-writable-strings

all: binfile nway_calc

binfile: $(BINFILE_OBJ) 
	$(CC) $(BINFILE_OBJ) -o binfile
	@mv binfile /data/projects/n-way/sbin

nway_calc: $(NWAY_OBJ)
	$(CC) $(NWAY_OBJ) -o nway_calc
	@mv nway_calc /data/projects/n-way/calculate

nway_calc.o: nway_calc.cc
	$(CC) $(CFLAGS) -c $<

bedfile.o: bedfile.hh bedfile.cc
	$(CC) $(CFLAGS) -c $<

bedfiles.o: bedfiles.hh bedfiles.cc
	$(CC) $(CFLAGS) -c $<

exception.o: exception.hh exception.cc
	$(CC) $(CFLAGS) -c $<

result.o: result.hh result.cc
	$(CC) $(CFLAGS) -c $<

binfile.o: binfile.cc
	$(CC) $(CFLAGS) -c $<

main.o: main.cc
	$(CC) $(CFLAGS) -c $<

clean:
	@rm -f *.o
