# Type of the target.
#   LIBNOTEST: library only.
#   LIBRARY: a library with a test program.
#   PROGRAM: one program only.
Target_Type=PROGRAM

# Name of the target.
#   If Target_Type is LIBNOTEST, build libxxx.a
#   If Target_Type is LIBRARY, build libxxx.a and xxx_test(.exe).
#   If Target_Type is PROGRAM, build xxx(.exe).
Target_Name=fs

# Where are we going to put the library?
Library_Path=

# Where are we going to put the test and the program?
Program_Path=.

# Source files and including dirs.
Sources = flow_sizing_test.cpp \
	../misc/token_parser.cpp \
	../misc/string_table.cpp \
	../misc/auto_file.cpp \
	../misc/options.cpp \
	../misc/timer.cpp \
	../misc/trace.cpp \
	../graph/graph2_v.cpp \
	../misc/misc_str.cpp \
	posynomial.cpp \
	pmatrix.cpp \
	sizing_vars.cpp \
	sizing_vars_elmore.cpp \
	complex_cost_vars_map.cpp \
	sizing_graph.cpp \
	flow_sizing.cpp \
	flow_solver.cpp \
	lr_sizing.cpp \
	dual_sizing.cpp \
	cs2.c

Includes=

# Testing source files and including dirs for Target_Type=LIBRARY
Test_Sources=
Test_Includes=

# Flags to the compilers.
CFLAGS=
CXXFLAGS=-Wno-non-virtual-dtor

# Flags to the linker. Put the libraries needed by the program here.
LDFLAGS= -lm

#Tags for debugging
TAGS = etags

# Default configuration. See below.
Config?=debug

# Configurations
#   debug: all debugging information and assertions without optimization
#   prof: profiling with debugging information and assertions
#   opt: optimized with debugging information and assertions
#   release: full optimization without debug
#
#   When you begin write your code, use debug.
#   When you want to tune the program, use prof.
#   When you want to get data for papers, use opt.
#   If opt cannot meet you speed requirement, try release.
#
#   Avoid changing an existing one. Please add your favorite configuration below those four.
#
ifeq "$(Config)" "debug"
  Opt_CC=-g -DDEBUG -D_DEBUG
  Opt_CXX=$(Opt_CC)
  LDOpt_LD=
  Target_Suffix=D
else
ifeq "$(Config)" "prof"
  Opt_CC=-g -pg -O2 -DNDEBUG -D_NDEBUG -DMISC_NO_TRACE
  Opt_CXX=$(Opt_CC)
  Opt_LD=-pg
  Target_Suffix=P
else
ifeq "$(Config)" "opt"
  Opt_CC=-g -O -DDEBUG -D_DEBUG
  Opt_CXX=$(Opt_CC)
  Opt_LD=
  Target_Suffix=O
else
ifeq "$(Config)" "release"
  Opt_CC=-O2 -DNDEBUG -D_NDEBUG -DMISC_NO_TRACE
  Opt_CXX=$(Opt_CC)
  Opt_LD=
  Target_Suffix=
else
  $(error Unknown Config=$(Config))
endif
endif
endif
endif

all : tags

Tag_Source=$(shell find . -name "*.h") $(Sources)
tags : $(Tag_Source)
	$(TAGS) $^


# COLORS
CLR_TRM=\033[0m
CLR_TTL=\033[1;32;40m
CLR_CHG=\033[33;40m
CLR_CMD=\033[36;40m
