# makefile for mcube with gcc on *nix by Eric
# This makefile was seriously broken, using for example CPP for
# the C++ compiler, CFLAGS for compiler flags for the C++ compiler
# DBGCFLAGS was set to an empty value, but then used. Not a serious
# issue, but as it was surpurflous, I removed it.
# It was broken in other ways too numerous to mention.
# Edited by David Kirkby, 29th Sept 2009

RM=rm -f
INCLUDES=mcube.h config.h
OBJS=mcube.o main.o
DBGOBJS=mcube.o.dbg main.o.dbg
DBGLIBS=

all: build

debug: build-debug

build: $(OBJS)
	$(CXX) $(CXXFLAGS)  -o mcube  $(OBJS) $(LIBS)

build-debug: $(DBGOBJS)
	$(CXX) $(CXXFLAGS)  -o mcube  $(OBJS) $(DBGLIBS)

clean:
	$(RM) $(OBJS)

distclean: clean
	$(RM) mcube

main.o: main.cpp $(INCLUDES)
	$(CXX) $(CXXFLAGS) -c main.cpp

mcube.o: mcube.cpp $(INCLUDES)
	$(CXX) $(CXXFLAGS) -c mcube.cpp

main.o.dbg: main.cpp $(INCLUDES)
	$(CXX) -c main.cpp

mcube.o.dbg: mcube.cpp $(INCLUDES)
	$(CXX) -c mcube.cpp

dummy: