-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
executable file
·90 lines (67 loc) · 2.39 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
SYSTEM = x86-64_linux
LIBFORMAT = static_pic
#------------------------------------------------------------
#
# When you adapt this makefile to compile your CPLEX programs
# please copy this makefile and set CPLEXDIR and CONCERTDIR to
# the directories where CPLEX and CONCERT are installed.
#
#------------------------------------------------------------
CPLEXDIR = /opt/ibm/ILOG/CPLEX_Studio1271/cplex
CONCERTDIR = /opt/ibm/ILOG/CPLEX_Studio1271/concert
# ---------------------------------------------------------------------
# HIRO details
# ---------------------------------------------------------------------
VERBOSE = false
SRCDIR = src
OBJDIR = obj
LIBDIR = lib
HIRONAME = hiro
HIROOBJ = hiro.o \
hirosolution.o
HIROSRC = $(addprefix $(SRCDIR)/,$(HIROOBJ:.o=.cpp))
HIROOBJFILES = $(addprefix $(OBJDIR)/,$(HIROOBJ))
HIROLIBFILE = $(LIBDIR)/lib$(HIRONAME).a
# ---------------------------------------------------------------------
# Compiler selection
# ---------------------------------------------------------------------
CCC = g++ -O0 -std=c++11
AR = ar rcs
# ---------------------------------------------------------------------
# Compiler options
# ---------------------------------------------------------------------
CCOPT = -m64 -O -fPIC -fno-strict-aliasing -fexceptions -DNDEBUG -DIL_STD
# ---------------------------------------------------------------------
# Link options and libraries
# ---------------------------------------------------------------------
CONCERTINCDIR = $(CONCERTDIR)/include
CPLEXINCDIR = $(CPLEXDIR)/include
CCFLAGS = $(CCOPT) -I$(CPLEXINCDIR) -I$(CONCERTINCDIR) -Wno-ignored-attributes
USRFLAGS =
# ------------------------------------------------------------
# Build commands
# ------------------------------------------------------------
ifeq ($(VERBOSE),false)
.SILENT: $(MAINFILE) $(MAINOBJFILES) $(MAINSHORTLINK)
endif
.PHONY: all
all: $(HIROLIBFILE)
@echo "-> linking $<"
$(AR) $(HIROLIBFILE) $(HIROOBJFILES)
.PHONY: clean
clean :
@echo "removing obj, bin and lib files"
/bin/rm -rf obj/*.o obj-eval/*.o *~ bin/* lib/*
$(HIROLIBFILE): $(LIBDIR) $(OBJDIR) $(HIROOBJFILES)
$(OBJDIR):
@echo "creating $@ directory"
@-mkdir -p $(OBJDIR)
$(LIBDIR):
@echo "creating $@ directory"
@-mkdir -p $(LIBDIR)
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
@echo "-> compiling $@"
$(CCC) -c $(CCFLAGS) $(USRFLAGS) $< -o $@
# Local Variables:
# mode: makefile
# End: