GNUmakefile.in 6.05 KB
Newer Older
1
#
Robert Ricci's avatar
Robert Ricci committed
2
# EMULAB-COPYRIGHT
3
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
Robert Ricci's avatar
Robert Ricci committed
4
# All rights reserved.
5
#
6 7 8 9
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= assign
10
MAKEFILE_IN	= @srcdir@/GNUmakefile.in
11
HAVE_XERCES	= @HAVE_XERCES@
12
NEWER_BOOST	= @NEWER_BOOST@
13 14

include $(OBJDIR)/Makeconf
15

16 17 18 19 20 21 22
#
# Uncomment these to build with gcc3.3
#
#CC=gcc33
#CPP=cpp33
#CXX=g++33	

23 24
all: assign

25
SCHEMATA = vtop.xsd ptop.xsd vtop-top.xsd ptop-top.xsd
26

27
include $(TESTBED_SRCDIR)/GNUmakerules
28

29
OBJS=parse_top.o parse_ptop.o assign.o pclass.o vclass.o score.o \
30 31
     parser.o solution.o anneal.o featuredesire.o neighborhood.o fstring.o \
     config.o
32 33
LIBS+= -lm
LDFLAGS+= -pipe -O3
34
CXXFLAGS = -pipe -I/usr/local/include -ftemplate-depth-40
35 36 37
# For OSX w/ macports
CXXFLAGS += -I/opt/local/include
LIBS += -L/opt/local/lib
38

39 40 41
ifeq ($(HAVE_XERCES),yes)
CXXFLAGS += -DWITH_XML
LIBS += -L/usr/local/lib -lxerces-c
42
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
43 44
endif

45 46 47 48
ifeq ($(NEWER_BOOST),yes)
CXXFLAGS += -DNEWER_BOOST
endif

49
# Pick either this
Leigh B Stoller's avatar
Leigh B Stoller committed
50
CXXFLAGS += -O3
51
# or this
52
#CXXFLAGS += -O0 -g -Wall -DVERBOSE
53 54 55 56 57 58 59 60
# 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
61
#CXXFLAGS += -DSTATS
62

63 64
# This is added to disable link mapping while we figure out how to get assign
# to deal with interfaces on switches
65
#CXXFLAGS += -DDISABLE_LINK_ANNOTATION
66

67 68 69 70 71 72
# 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
73
CXXFLAGS += -DINTERSWITCH_LENGTH
74 75
# Various tweaks to the simulated annealing behavior
CXXFLAGS += -DFIND_PNODE_SEARCH -DNO_REVERT
76 77 78
# 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
79 80
# Make sure that all emulated links that are assigned to a plink have the same
# endpoints
81
CXXFLAGS += -DFIX_PLINK_ENDPOINTS
82 83
# Allow pnodes to cap the amount of trivial link bandwidth they can handle
CXXFLAGS += -DTRIVIAL_LINK_BW
84
# Use the old acceptance criteria, which gives special treatment to violations
85
CXXFLAGS += -DSPECIAL_VIOLATION_TREATMENT
86 87
# Pass the Emulab installation root directory
CXXFLAGS += -DTBROOT='"$(TBROOT)"'
88

89 90 91
# 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... :)

Mac Newbold's avatar
Mac Newbold committed
92 93
DEPLIBS=$(OBJS)

94
assign: ${MAKEFILE_IN} ${DEPLIBS} ${OBJS}
95
	${CXX} -o assign ${LIBS} $(OBJS) ${LDFLAGS}
96 97 98 99

install: install-schemata $(INSTALL_LIBEXECDIR)/assign

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

101 102 103 104 105 106 107
# 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

Mac Newbold's avatar
Mac Newbold committed
108
clean:
109
	-${RM} *.o assign 
110

111 112 113 114 115
$(INSTALL_LIBDIR)/assign/%: %
	@echo "Installing $<"
	-mkdir -p $(INSTALL_LIBDIR)/assign
	$(INSTALL) $< $@

116 117 118 119
#
# 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
#
120 121 122
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
123 124
annotate.o: annotate.cc
annotate_rspec.o: annotate_rspec.cc
125
annotate_rspec_v2.o: annotate_rspec_v2.cc
126
annotate_vtop.o: annotate_vtop.cc
127 128
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 \
129
  solution.h maps.h anneal.h config.h
130 131
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
132
emulab_extensions_parser.o: emulab_extensions_parser.cc
133 134 135 136 137 138 139 140 141
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
142 143 144
parse_advertisement_rspec.o: parse_advertisement_rspec.cc
parse_error_handler.o: parse_error_handler.cc
parse_policy_xml.o: parse_policy_xml.cc
145 146
parse_ptop.o: parse_ptop.cc port.h delay.h physical.h common.h fstring.h \
  featuredesire.h forwarding.h parser.h
147 148
parse_ptop_xml.o: parse_ptop_xml.cc
parse_request_rspec.o: parse_request_rspec.cc
149 150 151
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
152 153
parse_vtop_xml.o: parse_vtop_xml.cc
parser.o: parser.cc parser.h port.h
154 155
pclass.o: pclass.cc port.h common.h fstring.h delay.h physical.h \
  featuredesire.h forwarding.h virtual.h pclass.h
156 157 158 159
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
160 161
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
162
solution.o: solution.cc solution.h port.h delay.h physical.h common.h \
163 164 165
  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
166
xmlhelpers.o: xmlhelpers.cc