GNUmakefile.in 6.91 KB
Newer Older
1
#
2
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# 
# {{{EMULAB-LICENSE
# 
# This file is part of the Emulab network testbed software.
# 
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
# License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this file.  If not, see <http://www.gnu.org/licenses/>.
# 
# }}}
22
#
23 24 25 26
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= assign
27
MAKEFILE_IN	= @srcdir@/GNUmakefile.in
28
HAVE_XERCES	= @HAVE_XERCES@
29
NEWER_BOOST	= @NEWER_BOOST@
30
USING_CLANG	= @USING_CLANG@
31 32

include $(OBJDIR)/Makeconf
33

34 35 36 37 38 39 40
#
# Uncomment these to build with gcc3.3
#
#CC=gcc33
#CPP=cpp33
#CXX=g++33	

41 42
all: assign

43
SCHEMATA = vtop.xsd ptop.xsd vtop-top.xsd ptop-top.xsd
44

45
include $(TESTBED_SRCDIR)/GNUmakerules
46

47
OBJS=parse_top.o parse_ptop.o assign.o pclass.o vclass.o score.o \
48 49
     parser.o solution.o anneal.o featuredesire.o neighborhood.o fstring.o \
     config.o
50 51
LIBS+= -lm
LDFLAGS+= -pipe -O3
52
CXXFLAGS = -pipe -I/usr/local/include -ftemplate-depth-80
53 54 55
# For OSX w/ macports
CXXFLAGS += -I/opt/local/include
LIBS += -L/opt/local/lib
56

57 58 59
#
# If we are on FreeBSD 10 with clang, we need to use C++11 extensions:
#
60
ifeq ($(USING_CLANG),yes)
61 62 63
CXXFLAGS += -Wno-c++11-extensions
endif

64 65 66
ifeq ($(HAVE_XERCES),yes)
CXXFLAGS += -DWITH_XML
LIBS += -L/usr/local/lib -lxerces-c
67
OBJS += parse_ptop_xml.o parse_vtop_xml.o parse_policy_xml.o parse_error_handler.o xmlhelpers.o parse_advertisement_rspec.o parse_request_rspec.o annotate_rspec_v2.o annotate_rspec.o annotate_vtop.o annotate.o rspec_parser_helper.o rspec_parser.o rspec_parser_v1.o rspec_parser_v2.o emulab_extensions_parser.o
68 69
endif

70 71 72 73
ifeq ($(NEWER_BOOST),yes)
CXXFLAGS += -DNEWER_BOOST
endif

74
# Pick either this
Leigh B Stoller's avatar
Leigh B Stoller committed
75
CXXFLAGS += -O3
76
# or this
77
#CXXFLAGS += -O0 -g -Wall -DVERBOSE
78 79 80 81 82 83 84 85
# and then zero or more of these
#CXXFLAGS += -DSCORE_DEBUG
#CXXFLAGS += -DSCORE_DEBUG_MORE
#CXXFLAGS += -DPCLASS_DEBUG
#CXXFLAGS += -DDUMP_GRAPH
#CXXFLAGS += -DSCORE_DEBUG_LOTS

# And then, regardless, you can also have this
86
#CXXFLAGS += -DSTATS
87

88 89
# This is added to disable link mapping while we figure out how to get assign
# to deal with interfaces on switches
90
#CXXFLAGS += -DDISABLE_LINK_ANNOTATION
91

92 93 94 95 96 97
# assign now supports a dizzing array of defines, which are as-yet undocumented
# Here are the ones used for a typical build:
# Pick cooling schedule
CXXFLAGS += -DMELT -DEPSILON_TERMINATE -DCHILL -DNEIGHBOR_LENGTH \
    -DLOCAL_DERIVATIVE -DALLOW_NEGATIVE_DELTA
# Bug/scoring fixes
98
CXXFLAGS += -DINTERSWITCH_LENGTH
99 100
# Various tweaks to the simulated annealing behavior
CXXFLAGS += -DFIND_PNODE_SEARCH -DNO_REVERT
101 102 103
# Keeps information about which pclasses are potential mappings for vnodes on a
# per-vnode basis, not a per-type basis
CXXFLAGS += -DPER_VNODE_TT
Robert Ricci's avatar
Robert Ricci committed
104 105
# Make sure that all emulated links that are assigned to a plink have the same
# endpoints
106
CXXFLAGS += -DFIX_PLINK_ENDPOINTS
107 108
# Allow pnodes to cap the amount of trivial link bandwidth they can handle
CXXFLAGS += -DTRIVIAL_LINK_BW
109
# Use the old acceptance criteria, which gives special treatment to violations
110
CXXFLAGS += -DSPECIAL_VIOLATION_TREATMENT
111 112
# Pass the Emulab installation root directory
CXXFLAGS += -DTBROOT='"$(TBROOT)"'
113

114 115 116
# If you're looking to turn on or off USE_OPTIMAL, its now a cmdline
# option. Use OP={0,1} on the command line at run time... :)

117 118
DEPLIBS=$(OBJS)

119
assign: ${MAKEFILE_IN} ${DEPLIBS} ${OBJS}
120
	${CXX} -o assign ${LIBS} $(OBJS) ${LDFLAGS}
121 122 123 124

install: install-schemata $(INSTALL_LIBEXECDIR)/assign

install-schemata: $(addprefix $(INSTALL_LIBDIR)/assign/, $(SCHEMATA))
125

126 127 128 129 130 131 132
# XXX: This is a hack having to do with the fact that there have, historically,
# been both a config.c and a config.cc, and CVS doesn't always delete config.c
# on an update. This confuses make. So, here's an explicit rule to build
# config.o from config.cc (note that the dependencies for config.cc are below)
config.o:
	${CXX} -c -o $@ ${CXXFLAGS} $(SRCDIR)/config.cc

133
clean:
134
	-${RM} *.o assign 
135

136 137 138 139 140
$(INSTALL_LIBDIR)/assign/%: %
	@echo "Installing $<"
	-mkdir -p $(INSTALL_LIBDIR)/assign
	$(INSTALL) $< $@

141 142 143 144
#
# All this crap generated with 'g++ -MM' - don't want to do all the makefile goo
# to make this automatic, since none of it ever changes
#
145 146 147
anneal.o: anneal.cc anneal.h port.h delay.h physical.h common.h fstring.h \
  featuredesire.h forwarding.h pclass.h virtual.h maps.h score.h \
  solution.h vclass.h neighborhood.h
148 149
annotate.o: annotate.cc
annotate_rspec.o: annotate_rspec.cc
150
annotate_rspec_v2.o: annotate_rspec_v2.cc
151
annotate_vtop.o: annotate_vtop.cc
152 153
assign.o: assign.cc port.h common.h fstring.h delay.h physical.h \
  featuredesire.h forwarding.h virtual.h vclass.h pclass.h score.h \
154
  solution.h maps.h anneal.h config.h
155 156
config.o: config.cc config.h common.h port.h fstring.h score.h physical.h \
  delay.h featuredesire.h forwarding.h virtual.h anneal.h pclass.h
157
emulab_extensions_parser.o: emulab_extensions_parser.cc
158 159 160 161 162 163 164 165 166
featuredesire.o: featuredesire.cc featuredesire.h common.h port.h \
  fstring.h score.h physical.h delay.h forwarding.h virtual.h
forwarding.o: forwarding.cc forwarding.h port.h fstring.h physical.h \
  common.h delay.h featuredesire.h
fstring.o: fstring.cc fstring.h port.h
fstringtest.o: fstringtest.cc fstring.h port.h
neighborhood.o: neighborhood.cc neighborhood.h port.h common.h fstring.h \
  physical.h delay.h featuredesire.h forwarding.h vclass.h virtual.h \
  pclass.h
167 168 169
parse_advertisement_rspec.o: parse_advertisement_rspec.cc
parse_error_handler.o: parse_error_handler.cc
parse_policy_xml.o: parse_policy_xml.cc
170 171
parse_ptop.o: parse_ptop.cc port.h delay.h physical.h common.h fstring.h \
  featuredesire.h forwarding.h parser.h
172 173
parse_ptop_xml.o: parse_ptop_xml.cc
parse_request_rspec.o: parse_request_rspec.cc
174 175 176
parse_top.o: parse_top.cc port.h common.h fstring.h vclass.h delay.h \
  physical.h featuredesire.h forwarding.h virtual.h parser.h anneal.h \
  pclass.h
177 178
parse_vtop_xml.o: parse_vtop_xml.cc
parser.o: parser.cc parser.h port.h
179 180
pclass.o: pclass.cc port.h common.h fstring.h delay.h physical.h \
  featuredesire.h forwarding.h virtual.h pclass.h
181 182 183 184
rspec_parser.o: rspec_parser.cc
rspec_parser_helper.o: rspec_parser_helper.cc
rspec_parser_v1.o: rspec_parser_v1.cc
rspec_parser_v2.o: rspec_parser_v2.cc
185 186
score.o: score.cc port.h common.h fstring.h vclass.h delay.h physical.h \
  featuredesire.h forwarding.h virtual.h pclass.h score.h
187
solution.o: solution.cc solution.h port.h delay.h physical.h common.h \
188 189 190
  fstring.h featuredesire.h forwarding.h virtual.h maps.h vclass.h
vclass.o: vclass.cc port.h common.h fstring.h vclass.h delay.h physical.h \
  featuredesire.h forwarding.h virtual.h
191
xmlhelpers.o: xmlhelpers.cc