
#
# This is mtecarlo/makefile
#

ifeq ($(suffix $(MAKE)),.exe) # switch for MS DOS options
	CXX=gxx                    # MS DOS options
	XSUFFIX=.exe
	RM=-del
	COPY=copy
else                          # LINUX options
	CXX=g++ -static
	XSUFFIX=.elf
	LIBS=-lg++
	COPY=cp
endif

CXXFLAGS=-Wall -O

TARGETS= \
fox$(XSUFFIX) \
prim$(XSUFFIX) \
dart$(XSUFFIX) 


%$(XSUFFIX) : %.cc
	$(CXX) $(CXXFLAGS) $(LIBS) -o $@ $<
	strip $@

.PHONY: all runall

all: $(TARGETS)

$(TARGETS) : 

new:
	$(RM) fox$(XSUFFIX)
	$(RM) prim$(XSUFFIX)	
	$(RM) dart$(XSUFFIX)
	$(MAKE) all

runall: $(TARGETS)
	fox$(XSUFFIX)  10000
	prim$(XSUFFIX) 10000
	dart$(XSUFFIX) 10000 

