CC=g++
CFLAGS=-O3 -Wall -c -fmessage-length=0 -MMD -MP


all: main

main: gas.o OCV_corr.o
	$(CC) -o "OCV_corr" OCV_corr.o gas.o

gas.o: gas.hpp gas.cpp
	$(CC) $(CFLAGS) -MF"gas.d" -MT"gas.d" -o"gas.o" "gas.cpp"

OCV_corr.o: OCV_corr.cpp pstream.h
	$(CC) $(CFLAGS) -MF"OCV_corr.d" -MT"OCV_corr.d" -o"OCV_corr.o" "OCV_corr.cpp"

OCV_corr: OCV_corr.o gas.o

install: OCV_corr
	cp OCV_corr /usr/local/bin/

update: OCV_corr
	cp OCV_corr /usr/local/bin/

clean:
	rm -rf *.d
	rm -rf *.o
	rm -rf OCV_corr
	rm -rf *.out
	rm -rf *~

test: test.out
	./test.out

test.out: gas.o test.o
	$(CC) -o "test.out" test.o gas.o

test.o:
	$(CC) $(CFLAGS) -MF"test.d" -MT"test.d" -o"test.o" "test.cpp"
