TOP = ../../
include $(TOP)/util/include/make.preamble

# - -  L i n u x  - - 
ifeq ($(OSTYPE), Linux)
PROFILEFLAGS	= -a -pg
LCCFLAGS	+= -g $(PROFILEFLAGS) 
LLDOPTS  	+= $(PROFILEFLAGS)
JUNK		+= gmon.out
JUNKCLOBBER	+= bb.out
endif

# - -  I R I X  - - 
ifeq ($(OSTYPE), Irix)
JUNK		+= *pixn32 *pixie
LCCFLAGS        += -LANG:restrict=on -O3
endif

# - -  A l l  - -
JUNKCLOBBER	+= *results

BIN             = go.exe

OBJECTS         = \
                  main.o \
                  $(NULL)

EXTRA_LIBS	= \
		timeit \
		$(NULL)

include $(TOP)/util/include/make.tmpl

#  - -  I R I X  - - 
ifeq ($(OSTYPE), Irix)
profile: go.exe
	@echo "Profiling with ideal time" 
	ssrun -ideal go.exe; 
	@echo "\nProfiling with user time" 
	ssrun -usertime go.exe; 
	prof *ideal* > go.exe_ideal_results; 
	prof *usertime* > go.exe_usertime_results; 
	$(DELETE) go.exe*[0-9]
endif
#  - -  L i n u x  - - 
ifeq ($(OSTYPE), Linux)
profile: go.exe
	./go.exe; 
	gprof go.exe > go.exe_usertime_results
endif
