| 1 |
# Copyright (C) 2006 International Business Machines and others. |
| 2 |
# All Rights Reserved. |
| 3 |
# This file is distributed under the Eclipse Public License. |
| 4 |
|
| 5 |
# $Id$ |
| 6 |
|
| 7 |
########################################################################## |
| 8 |
# You can modify this example makefile to fit for your own program. # |
| 9 |
# Usually, you only need to change CHANGEME entries below. # |
| 10 |
########################################################################## |
| 11 |
|
| 12 |
# CHANGEME |
| 13 |
# To compile other examples, either change the following line, or add the |
| 14 |
# argument DRIVER=filename_without_extension to make, e.g., |
| 15 |
# `make DRIVER=parameters' |
| 16 |
|
| 17 |
DRIVER = basic |
| 18 |
|
| 19 |
# CHANGME |
| 20 |
# This should be the name of your executable; change if you want a name |
| 21 |
# that's different from the file name. |
| 22 |
|
| 23 |
EXE = $(DRIVER)@EXEEXT@ |
| 24 |
|
| 25 |
# CHANGEME |
| 26 |
# OBJS should include all object files necessary to build your program. For |
| 27 |
# the examples, only one file is needed for each example. You will probably |
| 28 |
# have more as your code grows. |
| 29 |
|
| 30 |
OBJS = $(DRIVER).@OBJEXT@ |
| 31 |
|
| 32 |
# CHANGEME |
| 33 |
# Additional libraries. The examples require only the COIN libraries specified |
| 34 |
# as LIBS below. You may need more. |
| 35 |
|
| 36 |
ADDLIBS = |
| 37 |
|
| 38 |
# CHANGEME |
| 39 |
# Additional flags for compilation (e.g., include flags). As for libraries, |
| 40 |
# the examples require only COIN include files, specified as part of CXXFLAGS |
| 41 |
# below. |
| 42 |
|
| 43 |
ADDINCFLAGS = |
| 44 |
|
| 45 |
# CHANGEME |
| 46 |
# Directory to the sources for the (example) problem definition files. VPATH |
| 47 |
# is used if you are building in a different directory than the source. This |
| 48 |
# can be handy for various reasons; if none occur to you, don't worry about |
| 49 |
# it. |
| 50 |
|
| 51 |
SRCDIR = @srcdir@ |
| 52 |
VPATH = @srcdir@ |
| 53 |
|
| 54 |
########################################################################## |
| 55 |
# Usually, you don't have to change anything below. Note that if you # |
| 56 |
# change certain compiler options, you might have to recompile the # |
| 57 |
# package. # |
| 58 |
########################################################################## |
| 59 |
|
| 60 |
COIN_HAS_PKGCONFIG = @COIN_HAS_PKGCONFIG_TRUE@TRUE |
| 61 |
COIN_CXX_IS_CL = @COIN_CXX_IS_CL_TRUE@TRUE |
| 62 |
COIN_HAS_SAMPLE = @COIN_HAS_SAMPLE_TRUE@TRUE |
| 63 |
COIN_HAS_NETLIB = @COIN_HAS_NETLIB_TRUE@TRUE |
| 64 |
|
| 65 |
# C++ Compiler command |
| 66 |
CXX = @CXX@ |
| 67 |
|
| 68 |
# C++ Compiler options |
| 69 |
CXXFLAGS = @CXXFLAGS@ @OSI_EXAMPLES_SOLVER_CFLAGS@ \ |
| 70 |
-DOSIXXXhpp=\"@[email protected]\" -DOSIXXX=@OSI_EXAMPLES_SOLVER_NAME@ |
| 71 |
|
| 72 |
# Sample data directory |
| 73 |
ifeq ($(COIN_HAS_SAMPLE), TRUE) |
| 74 |
ifeq ($(COIN_HAS_PKGCONFIG), TRUE) |
| 75 |
CXXFLAGS += -DSAMPLEDIR=\"`PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@ @PKG_CONFIG@ --variable=datadir coindatasample`\" |
| 76 |
else |
| 77 |
CXXFLAGS += -DSAMPLEDIR=\"@SAMPLE_DATA_INSTALLED@\" |
| 78 |
endif |
| 79 |
endif |
| 80 |
|
| 81 |
# Netlib data directory |
| 82 |
ifeq ($(COIN_HAS_NETLIB), TRUE) |
| 83 |
ifeq ($(COIN_HAS_PKGCONFIG), TRUE) |
| 84 |
CXXFLAGS += -DNETLIBDIR=\"`PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@ @PKG_CONFIG@ --variable=datadir coindatanetlib`\" |
| 85 |
else |
| 86 |
CXXFLAGS += -DNETLIBDIR=\"@NETLIB_DATA_INSTALLED@\" |
| 87 |
endif |
| 88 |
endif |
| 89 |
|
| 90 |
# additional C++ Compiler options for linking |
| 91 |
CXXLINKFLAGS = @RPATH_FLAGS@ |
| 92 |
|
| 93 |
# Include directories (we use the CYGPATH_W variables to allow compilation with Windows compilers) |
| 94 |
ifeq ($(COIN_HAS_PKGCONFIG), TRUE) |
| 95 |
INCL = `PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@ @PKG_CONFIG@ --cflags @OSI_EXAMPLES_SOLVER_PCNAME@ osi` |
| 96 |
else |
| 97 |
INCL = @OSILIB_CFLAGS_INSTALLED@ |
| 98 |
endif |
| 99 |
INCL += $(ADDINCFLAGS) |
| 100 |
|
| 101 |
# Linker flags |
| 102 |
ifeq ($(COIN_HAS_PKGCONFIG), TRUE) |
| 103 |
LIBS = `PKG_CONFIG_PATH=@COIN_PKG_CONFIG_PATH@ @PKG_CONFIG@ --libs @OSI_EXAMPLES_SOLVER_PCNAME@ osi` |
| 104 |
else |
| 105 |
ifeq ($(COIN_CXX_IS_CL), TRUE) |
| 106 |
LIBS = -link -libpath:`$(CYGPATH_W) @abs_lib_dir@` libOsi.lib @OSI_EXAMPLES_SOLVER_LIBS@ @OSILIB_LIBS_INSTALLED@ |
| 107 |
else |
| 108 |
LIBS = -L@abs_lib_dir@ -lOsi @OSI_EXAMPLES_SOLVER_LIBS@ @OSILIB_LIBS_INSTALLED@ |
| 109 |
endif |
| 110 |
endif |
| 111 |
|
| 112 |
# The following is necessary under cygwin, if native compilers are used |
| 113 |
CYGPATH_W = @CYGPATH_W@ |
| 114 |
|
| 115 |
all: $(EXE) |
| 116 |
|
| 117 |
.SUFFIXES: .cpp .c .o .obj |
| 118 |
|
| 119 |
$(EXE): $(OBJS) |
| 120 |
bla=;\ |
| 121 |
for file in $(OBJS); do bla="$$bla `$(CYGPATH_W) $$file`"; done; \ |
| 122 |
$(CXX) $(CXXLINKFLAGS) $(CXXFLAGS) -o $@ $$bla $(LIBS) $(ADDLIBS) |
| 123 |
|
| 124 |
clean: |
| 125 |
rm -rf $(EXE) $(OBJS) |
| 126 |
|
| 127 |
.cpp.o: |
| 128 |
$(CXX) $(CXXFLAGS) $(INCL) -c -o $@ `test -f '$<' || echo '$(SRCDIR)/'`$< |
| 129 |
|
| 130 |
|
| 131 |
.cpp.obj: |
| 132 |
$(CXX) $(CXXFLAGS) $(INCL) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(SRCDIR)/$<'; fi` |
| 133 |
|
| 134 |
.c.o: |
| 135 |
$(CC) $(CFLAGS) $(INCL) -c -o $@ `test -f '$<' || echo '$(SRCDIR)/'`$< |
| 136 |
|
| 137 |
|
| 138 |
.c.obj: |
| 139 |
$(CC) $(CFLAGS) $(INCL) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(SRCDIR)/$<'; fi` |