# Copyright (C) 2006 International Business Machines and others.
# All Rights Reserved.
# This file is distributed under the Eclipse Public License.

# $Id: Makefile.in 726 2006-04-17 04:16:00Z andreasw $

##########################################################################
#			!! IMPORTANT !!

# Makefile.in is the template used to produce the Makefile for the examples.
# Makefile.in is processed when you run configure.  Variables bracketed by `@'
# characters, e.g., , will be replaced with a value that is correct for
# your specific installation and the choices you make when running configure.

# If you write your own main program, or need to customise the Makefile for
# some other reason, modify Makefile.in, not Makefile! Makefile is regenerated
# every time you run configure, and your changes will be lost. If you don't see
# variables like  below, you're looking at Makefile. You want
# Makefile.in.

# For those familiar with GNU autotools, who are asking ``What about
# Makefile.am?'', stop looking. Makefile.in is the starting point in example
# directories in a COIN distribution. Knowledge of make is all that's required
# to work with Makefile.in, a more reasonable assumption for most users.
##########################################################################

# Blocks prefixed with CHANGEME will probably need some adjustment if you write
# a custom main program.

# As distributed, this makefile will build two sample main programs:
#  * osi_dylp is a bare C driver for dylp; it makes no use of COIN software
#  * odsi+dylp is a driver to exercise dylp via the OsiDylp OSI layer; it
#    uses dylp as you should use it in the context of COIN.
# Have a look at the README for more information about each of them.
#
# If you're customising this file for your own code, choose one of DRIVER_CXX
# or DRIVER_C based on whether the main program is C or C++. The remainder of
# the source files can be any mix of C or C++. (Adding other languages to the
# mix will probably require more extensive modifications.)

# CHANGEME: The name of your main program.

DRIVER_CXX = odsi+dylp
DRIVER_C = osi_dylp

# CHANGEME: This should be the name of your executable. You won't need to edit
# these lines unless you want the final executable to have a name that's
# different from the name you gave for DRIVER_CXX / DRIVER_C just above.

EXE_CXX = $(DRIVER_CXX)
EXE_C = $(DRIVER_C)

# CHANGEME: OBJS* should specify the files required to build the executable.

OBJS_CXX =  $(DRIVER_CXX).o

OBJS_C = $(DRIVER_C).o \
	mpsio.o

# CHANGEME: Additional libraries
ADDLIBS =

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

# CHANGEME: Directory to the sources for the (example) problem definition
# files
SRCDIR = .


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

COIN_HAS_PKGCONFIG = #TRUE
COIN_CXX_IS_CL = #TRUE

# C++ Compiler command
CXX = g++

# C++ Compiler options
CXXFLAGS = -g -O2 -ffile-prefix-map=/build/coinor-dylp-zsqVwG/coinor-dylp-1.10.4=. -fstack-protector-strong -Wformat -Werror=format-security -DDYLP_BUILD -fno-strict-aliasing
CPPFLAGS = -Wdate-time -D_FORTIFY_SOURCE=2

# additional C++ Compiler options for linking
CXXLINKFLAGS = -Wl,-z,relro -lm  -Wl,--rpath -Wl,/usr/lib

# C Compiler command
CC = gcc

# C Compiler options
CFLAGS = -g -O2 -ffile-prefix-map=/build/coinor-dylp-zsqVwG/coinor-dylp-1.10.4=. -fstack-protector-strong -Wformat -Werror=format-security -DDYLP_BUILD -fno-strict-aliasing

# Include directories (we use the CYGPATH_W variables to allow compilation with Windows compilers)
ifeq ($(COIN_HAS_PKGCONFIG), TRUE)
  INCL = `PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig:  --cflags osi-dylp`
else
  INCL = 
endif
INCL += $(ADDINCFLAGS)

# Linker flags
ifeq ($(COIN_HAS_PKGCONFIG), TRUE)
  LIBS_C   = `PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig:  --libs dylp`
  LIBS_CXX = `PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig:  --libs osi-dylp`
else
  ifeq ($(COIN_CXX_IS_CL), TRUE)
    LIBS_C   = -link -libpath:`$(CYGPATH_W) /usr/lib` libDylp.lib -lm 
    LIBS_CXX = -link -libpath:`$(CYGPATH_W) /usr/lib` libOsiDylp.lib libDylp.lib 
  else
    LIBS_C   = -L/usr/lib -lDylp -lm 
    LIBS_CXX = -L/usr/lib -lOsiDylp -lDylp 
  endif
endif

# Location of xxx_addlibs.txt
prefix = /usr
DATADIR = ${prefix}/share
DYLPDOCDIR = $(DATADIR)/coin/doc/DyLP
COINUTILSDOCDIR = $(DATADIR)/coin/doc/CoinUtils
OSIDOCDIR = $(DATADIR)/coin/doc/Osi

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

# check and installcheck are standard automake targets. The sample main
# programs osi_dylp and odsi+dylp are included as simple checks for the
# package, so it makes some sense to build them under these rules. But the
# main test for dylp is to build and run the OSI unitTest with ODSI in the
# build.

examples: $(EXE_C) $(EXE_CXX)

.SUFFIXES: .cpp .c .o .obj

$(EXE_CXX): $(OBJS_CXX)
	bla=;\
	for file in $(OBJS_CXX); do bla="$$bla `$(CYGPATH_W) $$file`"; done; \
	$(CXX) $(CXXLINKFLAGS) $(CXXFLAGS) \
	  -o $@ $$bla $(LIBS_CXX) $(ADDLIBS)

$(EXE_C): $(OBJS_C)
	bla=;\
	for file in $(OBJS_C); do bla="$$bla `$(CYGPATH_W) $$file`"; done; \
	$(CC) $(CXXLINKFLAGS) $(CFLAGS) \
	  -o $@ $$bla $(LIBS_C) $(ADDLIBS)

# Standard automake clean targets, so that this directory gets properly
# cleaned.

mostlyclean clean: 
	rm -rf $(EXE_CXX) $(EXE_C) $(OBJS_CXX) $(OBJS_C)
	rm -rf afiro.log afiro.out greenbeb.log greenbeb.out

distclean maintainer-clean: clean
	rm -rf Makefile

.cpp.o:
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(INCL) -c -o $@ `test -f '$<' || echo '$(SRCDIR)/'`$<


.cpp.obj:
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(INCL) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(SRCDIR)/$<'; fi`

.c.o:
	$(CC) $(CPPFLAGS) $(CFLAGS) $(INCL) -c -o $@ `test -f '$<' || echo '$(SRCDIR)/'`$<


.c.obj:
	$(CC) $(CPPFLAGS) $(CFLAGS) $(INCL) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(SRCDIR)/$<'; fi`

# These are standard automake targets that are not implemented. As per
# recommendation in the automake manual for third-party makefiles.

EMPTY_AUTOMAKE_TARGETS = \
  all install install-data install-exec uninstall install-info installdirs \
  check installcheck dvi pdf ps info html tags ctags
.PHONY: $(EMPTY_AUTOMAKE_TARGETS)
$(EMPTY_AUTOMAKE_TARGETS):

