#
# This is bitrec/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=-lstdc++
	COPY=cp
endif

CXXFLAGS=-Wall -O

TARGETS=bitrec$(XSUFFIX)

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


.PHONY: all new runall

all:  $(TARGETS)

$(TARGETS) : 

new:
	$(RM) bitrec$(XSUFFIX)
	$(MAKE) all

runall : $(TARGETS)
	bitrec$(XSUFFIX)   
