# 
# $Id: Makefile,v 1.2 2000/10/20 19:33:56 kurt Exp kurt $
#
# Makefile for the main zenix-source
#

# set your compile-options here
#COMPILEFLAGS = -O3
COMPILEFLAGS = -O0 -g -Wall #-pg

###########################################
# no user servicable parts after this line
###########################################

DEFINES = $(EXTRAINCLUDES)

CFLAGS = $(COMPILEFLAGS) $(DEFINES)
DATE = `date +'%Y%m%d'`
CXX = g++

# sources
sources_cpp = zenix.cpp MYp.cpp game.cpp lists.cpp ratings.cpp sendmail.cpp \
	board2d.cpp file.cpp chkuser.cpp gamefile.cpp strutl.cpp zenix_main.cpp


# objectfiles
objects = $(sources_cpp:.cpp=.o)

# executable-name
program = zenix

.SUFFIXES: .cpp .o
.cpp.o:
	$(CXX) $(CFLAGS) -c -o $@ $*.cpp

.PHONY: all clean realclean zippbem

all: $(program)

clean:
	- rm $(program) $(objects)

realclean: clean
	- rm *.d

$(program): $(objects)
	$(CXX) $(CFLAGS) -o $@ $^ $(libs) 

zippbem:
	- rm pbemzertz.zip
	zip pbemzertz xmlite.cxx xmlite.h pbemzertz.cxx pbemzertz.h \
	core.cxx z_position.cxx z_position.h z_move.cxx z_move.h \
	z_log.cxx z_log.h z_board.cxx z_board.h utility.h zertz_help.txt



# some things for automatic dependency generation
%.d: %.cpp
	$(SHELL) -ec '$(CXX) -MM $(CPPFLAGS) $(DEFINES) $< \
		| sed '\''s/$*\\.o[ :]*/& $@/g'\'' > $@'

include $(sources_cpp:.cpp=.d)

# not all dependencies can be added automatically
# so I add some here myself

