#
# Makefile for Topology GenaRator and fault injection for
# Opnet
# 
# Included a modified version of Tiers Algorithm
#

#
# Location of tiers source code
#
SRC = .
DEST= ../bin

#
# includes
#
INCLUDES = \
	-I $(SRC)

#
# flags
#
#FLAGS= -fconserve-space -fno-inline -Wall -Winline -Wpointer-arith -g -DDEBUG
FLAGS= -fconserve-space

#
# tools
#
COMPILER = g++
CC = gcc

#
# Default build rule
#.SUFFIXES: .cc .o .hh 
.cc.o:
	$(COMPILER) $(INCLUDES) -o $@ -c $(FLAGS) $(SRC)/$<

#
# objects to be built
#
OBJECTS = \
	tiers.o \
	tiers_config.o \
	tiers_create.o \
	tiers_dists.o \
	tiers_misc.o \
	tiers_main.o \
	tiers_output.o \
	tiers_output_gnuplot.o \
	tiers_prims.o \
	tiers_red_intra.o \
	tiers_red_inter.o 

EXEC = $(DEST)/tiers

#
# dependencies
#

all: creator algorithm 

algorithm : $(OBJECTS) 
		g++ $(OBJECTS) $(FLAGS) -o $(EXEC) -lm	
		@echo "Modyfing tiers_config"
		@cp tiers_config $(DEST) 
                

creator: creator.c
	$(CC) -o $(DEST)/creator creator.c
        

clean : robj 

robj:
	rm *.o
	rm $(EXEC)
	rm $(DEST)/creator


# end of file
