#for quick tests, no optimization...to enable debug messages
#which may be printed by the Qubit classes, etc delete -DNODEBUG
CC			= g++
CFLAGS	= -O2 -g -DNODEBUG	
LNKOPT	= -L. -lOpenQubit
PERCEPS	= templates/perceps
PEROPT	= -a -b -e -m -r -t templates/ 

all: qubit docs

clean:
	rm -f *.o *.a qubitmain

docs:
	$(PERCEPS) $(PEROPT) -d doc/
	cp README doc/

libOpenQubit.a: qstate.o binary.o
	ar rc libOpenQubit.a qstate.o binary.o
	ranlib libOpenQubit.a

binary.o: binary.cc binary.h
	$(CC) $(CFLAGS) -c binary.cc

qstate.o: qstate.cc qstate.h
	$(CC) $(CFLAGS) -c qstate.cc

qubit: main.cc libOpenQubit.a
	$(CC) $(CFLAGS) main.cc -o qubitmain $(LNKOPT)
