1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
|
#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#* *
#* This file is part of the program and library *
#* SCIP --- Solving Constraint Integer Programs *
#* *
#* Copyright (c) 2002-2026 Zuse Institute Berlin (ZIB) *
#* *
#* Licensed under the Apache License, Version 2.0 (the "License"); *
#* you may not use this file except in compliance with the License. *
#* You may obtain a copy of the License at *
#* *
#* http://www.apache.org/licenses/LICENSE-2.0 *
#* *
#* Unless required by applicable law or agreed to in writing, software *
#* distributed under the License is distributed on an "AS IS" BASIS, *
#* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
#* See the License for the specific language governing permissions and *
#* limitations under the License. *
#* *
#* You should have received a copy of the Apache-2.0 license *
#* along with SCIP; see the file LICENSE. If not visit scipopt.org. *
#* *
#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#@file Makefile
#@brief Makefile for SCIP callable library example project
#@author Stefan Vigerske
#-----------------------------------------------------------------------------
# paths
#-----------------------------------------------------------------------------
SCIPDIR = ../..
#-----------------------------------------------------------------------------
# include default project Makefile from SCIP (need to do this twice, once to
# find the correct binary, then, after getting the correct flags from the
# binary (which is necessary since the ZIMPL flags differ from the default
# if compiled with the SCIP Optsuite instead of SCIP), we need to set the
# compile flags, e.g., for the ZIMPL library, which is again done in make.project
#-----------------------------------------------------------------------------
include $(SCIPDIR)/make/make.project
SCIPVERSION :=$(shell $(SCIPDIR)/bin/scip.$(BASE).$(LPS).$(TPI)$(EXEEXTENSION) -v | sed -e 's/$$/@/')
override ARCH :=$(shell echo "$(SCIPVERSION)" | sed -e 's/.* ARCH=\([^@]*\).*/\1/')
override EXPRINT :=$(shell echo "$(SCIPVERSION)" | sed -e 's/.* EXPRINT=\([^@]*\).*/\1/')
override GMP :=$(shell echo "$(SCIPVERSION)" | sed -e 's/.* GMP=\([^@]*\).*/\1/')
override SYM :=$(shell echo "$(SCIPVERSION)" | sed -e 's/.* SYM=\([^@]*\).*/\1/')
override IPOPT :=$(shell echo "$(SCIPVERSION)" | sed -e 's/.* IPOPT=\([^@]*\).*/\1/')
override IPOPTOPT :=$(shell echo "$(SCIPVERSION)" | sed -e 's/.* IPOPTOPT=\([^@]*\).*/\1/')
override CONOPT :=$(shell echo "$(SCIPVERSION)" | sed -e 's/.* CONOPT=\([^@]*\).*/\1/')
override LPSCHECK :=$(shell echo "$(SCIPVERSION)" | sed -e 's/.* LPSCHECK=\([^@]*\).*/\1/')
override LPSOPT :=$(shell echo "$(SCIPVERSION)" | sed -e 's/.* LPSOPT=\([^@]*\).*/\1/')
override NOBLKBUFMEM :=$(shell echo "$(SCIPVERSION)" | sed -e 's/.* NOBLKBUFMEM=\([^@]*\).*/\1/')
override NOBLKMEM :=$(shell echo "$(SCIPVERSION)" | sed -e 's/.* NOBLKMEM=\([^@]*\).*/\1/')
override NOBUFMEM :=$(shell echo "$(SCIPVERSION)" | sed -e 's/.* NOBUFMEM=\([^@]*\).*/\1/')
override THREADSAFE :=$(shell echo "$(SCIPVERSION)" | sed -e 's/.* THREADSAFE=\([^@]*\).*/\1/')
override READLINE :=$(shell echo "$(SCIPVERSION)" | sed -e 's/.* READLINE=\([^@]*\).*/\1/')
override SANITIZE :=$(shell echo "$(SCIPVERSION)" | sed -e 's/.* SANITIZE=\([^@]*\).*/\1/')
override ZIMPL :=$(shell echo "$(SCIPVERSION)" | sed -e 's/.* ZIMPL=\([^@]*\).*/\1/')
override ZIMPLOPT :=$(shell echo "$(SCIPVERSION)" | sed -e 's/.* ZIMPLOPT=\([^@]*\).*/\1/')
override ZLIB :=$(shell echo "$(SCIPVERSION)" | sed -e 's/.* ZLIB=\([^@]*\).*/\1/')
include $(SCIPDIR)/make/make.project
#-----------------------------------------------------------------------------
# Main Program
#-----------------------------------------------------------------------------
MAINNAMES = spring gastrans brachistochrone circlepacking
MAINOBJ = $(addsuffix .o,$(MAINNAMES))
MAINSRC = $(addprefix $(SRCDIR)/,$(MAINOBJ:.o=.c))
MAINS = $(addsuffix .$(BASE).$(LPS)$(EXEEXTENSION),$(MAINNAMES))
MAINFILES = $(addprefix $(BINDIR)/,$(MAINS))
MAINSHORTLINKS = $(addprefix $(BINDIR)/,$(MAINNAMES))
MAINOBJFILES = $(addprefix $(OBJDIR)/,$(MAINOBJ))
#-----------------------------------------------------------------------------
# Rules
#-----------------------------------------------------------------------------
ifeq ($(VERBOSE),false)
.SILENT: $(MAINFILES) $(MAINOBJFILES) $(MAINSHORTLINKS)
endif
.PHONY: all
all: $(SCIPDIR) $(MAINFILES) $(MAINSHORTLINKS)
.PHONY: lint
lint: $(MAINSRC)
-rm -f lint.out
-ln -fs $(SCIPDIR)/lint
$(SHELL) -ec 'for i in $^; \
do \
echo $$i; \
$(LINT) -I$(SCIPDIR) lint/main-gcc.lnt +os\(lint.out\) -u -zero \
$(FLAGS) -UNDEBUG -USCIP_WITH_READLINE -USCIP_ROUNDING_FE $$i; \
done'
.PHONY: pclint
pclint: $(MAINSRC)
-rm -f pclint.out
ifeq ($(FILES),)
@$(SHELL) -ec 'echo "-> running pclint on $^..."; \
$(PCLINT) -I$(SCIPDIR) -I$(SCIPDIR)/pclint main-gcc.lnt +os\(pclint.out\) -u -zero -max_threads=$(MAXJOBS) \
$(USRFLAGS) $(FLAGS) -uNDEBUG -uSCIP_WITH_READLINE -uSCIP_ROUNDING_FE -D_BSD_SOURCE $^;'
else
@$(SHELL) -ec 'echo "-> running pclint on files $(FILES) ..."; \
$(PCLINT) -I$(SCIPDIR) -I$(SCIPDIR)/pclint main-gcc.lnt +os\(pclint.out\) -u -zero -max_threads=$(MAXJOBS) \
$(USRFLAGS) $(FLAGS) -uNDEBUG -uSCIP_WITH_READLINE -uSCIP_ROUNDING_FE -D_BSD_SOURCE $(FILES);'
endif
$(MAINSHORTLINKS): $(MAINFILES)
@rm -f $@
cd $(dir $@) && ln -s $(notdir $@.$(BASE).$(LPS)$(EXEEXTENSION)) $(notdir $@)
$(OBJDIR):
@-mkdir -p $(OBJDIR)
$(BINDIR):
@-mkdir -p $(BINDIR)
.PHONY: test
test: $(MAINFILES)
for i in $(MAINFILES) ; do $$i || break 1 ; done
.PHONY: clean
clean: $(OBJDIR)
ifneq ($(OBJDIR),)
-rm -f $(OBJDIR)/*.o $(OBJDIR)/*.d
-rmdir $(OBJDIR)
endif
-rm -f $(MAINFILES)
.PHONY: doc
doc:
cd doc && doxygen scip.dxy
-include $(MAINOBJFILES:.o=.d)
$(BINDIR)/%.$(BASE).$(LPS)$(EXEEXTENSION): $(SCIPLIBFILE) $(LPILIBFILE) $(OBJDIR)/%.o | $(BINDIR)
@echo "-> linking $@"
$(LINKCXX) $(OBJDIR)/$*.o $(LINKCXXSCIPALL) $(LDFLAGS) $(LINKCXX_o)$@
$(OBJDIR)/%.o: $(SRCDIR)/%.c | $(OBJDIR)
@echo "-> compiling $@"
$(CC) $(FLAGS) $(OFLAGS) $(BINOFLAGS) $(CFLAGS) $(DFLAGS) -c $< $(CC_o)$@
#---- EOF --------------------------------------------------------------------
|