# Copyright (C) 2010 Hans Pirnay
# All Rights Reserved.
# This file is distributed under the Common Public License.


##########################################################################
#    You can modify this example makefile to fit for your own program.   #
#    Usually, you only need to change the five CHANGEME entries below.   #
##########################################################################

# CHANGEME: This should be the name of your executable
EXE = parametric_driver@EXEEXT@

# CHANGEME: Here is the name of all object files corresponding to the source
#           code that you wrote in order to define the problem statement
OBJS =  parametric_driver.@OBJEXT@ \
	parametricTNLP.@OBJEXT@

# CHANGEME: Additional libraries
ADDLIBS =

# CHANGEME: Additional flags for compilation (e.g., include flags)
ADDINCFLAGS =

##########################################################################
#  Usually, you don't have to change anything below.  Note that if you   #
#  change certain compiler options, you might have to recompile Ipopt.   #
##########################################################################

# C++ Compiler command
CXX = @CXX@

# C++ Compiler options
CXXFLAGS = @CXXFLAGS@

# additional C++ Compiler options for linking
CXXLINKFLAGS = @RPATH_FLAGS@

# Directory with header files
IPOPTINCDIR = @includedir@/coin

# Directory with libipopt.a
IPOPTLIBDIR = @libdir@
exec_prefix = @exec_prefix@
prefix = @prefix@

# Libraries necessary to link with IPOPT
LIBS = @ipoptlib@ @ADDLIBS@ -lasnmpc

# Necessary Include dirs (we use the CYGPATH_W variables to allow
# compilation with Windows compilers)
SRCDIR = @srcdir@
ipoptsrcdir  = $(SRCDIR)/../../../../src
asnmpcsrcdir = $(SRCDIR)/../../src
INCLUDEDIR  = -I${prefix}/include/coin -I$(ipoptsrcdir)/Interfaces -I$(ipoptsrcdir)/Algorithm -I$(ipoptsrcdir)/LinAlg -I$(ipoptsrcdir)/LinAlg/TMatrices -I$(ipoptsrcdir)/Apps/AmplSolver -I$(asnmpcsrcdir)
#INCL =  -I`$(CYGPATH_W) $(IPOPTINCDIR)` $(ADDINCFLAGS) $(ASNMPCINCL)
INCL =  $(ADDINCFLAGS) $(ASNMPCINCL) $(INCLUDEDIR)

# The following is necessary under cygwin, if native compilers are used
CYGPATH_W = @CYGPATH_W@

all: $(EXE)

.SUFFIXES: .cpp .c .o .obj

$(EXE): $(OBJS)
	bla=;\
	for file in $(OBJS); do bla="$$bla `$(CYGPATH_W) $$file`"; done; \
	$(CXX) $(CXXLINKFLAGS) $(CXXFLAGS) -o $@ $$bla $(ADDLIBS) $(LIBS)

clean:
	rm -rf $(EXE) $(OBJS)

.cpp.o:
	$(CXX) $(CXXFLAGS) $(INCL) -c -o $@ $<


.cpp.obj:
	$(CXX) $(CXXFLAGS) $(INCL) -c -o $@ `$(CYGPATH_W) '$<'`






