-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
76 lines (59 loc) · 2.59 KB
/
Makefile
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
# Default pod makefile distributed with pods version: 12.11.14
default_target: all
# Default to a less-verbose build. If you want all the gory compiler output,
# run "make VERBOSE=1"
$(VERBOSE).SILENT:
# Figure out where to build the software.
# Use BUILD_PREFIX if it was passed in.
# If not, search up to four parent directories for a 'build' directory.
# Otherwise, use ./build.
ifeq "$(BUILD_PREFIX)" ""
BUILD_PREFIX:=$(shell for pfx in ./ .. ../.. ../../.. ../../../..; do d=`pwd`/$$pfx/build;\
if [ -d $$d ]; then echo $$d; exit 0; fi; done; echo `pwd`/build)
endif
# create the build directory if needed, and normalize its path name
BUILD_PREFIX:=$(shell mkdir -p $(BUILD_PREFIX) && cd $(BUILD_PREFIX) && echo `pwd`)
# Default to a release build. If you want to enable debugging flags, run
# "make BUILD_TYPE=Debug"
ifeq "$(BUILD_TYPE)" ""
BUILD_TYPE="Release"
endif
DL_PATH = https://github.com/RobotLocomotion/gurobi-tarballs/archive
UNZIP_DIR = gurobi562
all: pod-build/Makefile $(HOME)/gurobi.lic
$(MAKE) -C pod-build all install
$(UNZIP_DIR):
./download_gurobi.pl
pod-build/Makefile: $(UNZIP_DIR)
$(MAKE) configure
.PHONY: configure
configure: $(UNZIP_DIR)
@echo "\nBUILD_PREFIX: $(BUILD_PREFIX)\n\n"
# create the temporary build directory if needed
@mkdir -p pod-build
# run CMake to generate and configure the build scripts
@cd pod-build && cmake -DCMAKE_INSTALL_PREFIX=$(BUILD_PREFIX) \
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE) ..
# todo: make this logic more robust:
# check for license path environment variable
$(HOME)/gurobi.lic :
@echo "You do not appear to have a license for gurobi installed in $(HOME)/gurobi.lic\n"
@echo "Open the following url in your favorite browser and request the license:\n"
@echo " http://www.gurobi.com/download/licenses/free-academic\n"
@echo "Then run the grbgetkey line provide on the website and follow the prompts to\n"
@echo "store your license file in $(HOME)/gurobi.lic\n"
@echo "Note that you will need to create an account on the GUROBI website if you do\n"
@echo "not yet have one.\n"
clean:
-if [ -e pod-build/install_manifest.txt ]; then rm -f `cat pod-build/install_manifest.txt`; fi
-if [ -d pod-build ]; then $(MAKE) -C pod-build clean; rm -rf pod-build; fi
.PHONY: install_prereqs_macports install_prereqs_homebrew install_prereqs_ubuntu
install_prereqs_macports :
port install curl
install_prereqs_homebrew :
brew install curl
install_prereqs_ubuntu :
apt-get install curl libwww-perl libterm-readkey-perl
# other (custom) targets are passed through to the cmake-generated Makefile
%::
$(MAKE) -C pod-build $@