GNUmakefile.in 6.06 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 13

include $(OBJDIR)/Makeconf
14

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

22 23
all: assign

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

26
include $(TESTBED_SRCDIR)/GNUmakerules
27

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

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

43
# Pick either this
Leigh B Stoller's avatar
Leigh B Stoller committed
44
CXXFLAGS += -O3
45
# or this
46
#CXXFLAGS += -O0 -g -Wall -DVERBOSE
47 48 49 50 51 52 53 54
# 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
55
#CXXFLAGS += -DSTATS
56

57 58
# This is added to disable link mapping while we figure out how to get assign
# to deal with interfaces on switches
59
#CXXFLAGS += -DDISABLE_LINK_ANNOTATION
60

61 62 63 64 65 66 67 68 69
# 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
CXXFLAGS += -DINTERSWITCH_LENGTH -DPNODE_SWITCH_LOAD -DFIX_SHARED_INTERFACES 
# Various tweaks to the simulated annealing behavior
CXXFLAGS += -DFIND_PNODE_SEARCH -DNO_REVERT
70 71 72 73 74
# Keeps information about which pclasses are potential mappings for vnodes on a
# per-vnode basis, not a per-type basis
CXXFLAGS += -DPER_VNODE_TT
# Should be on by default, but not well tested enough
#CXXFLAGS += -DSMART_UNMAP
Robert Ricci's avatar
Robert Ricci committed
75 76
# Make sure that all emulated links that are assigned to a plink have the same
# endpoints
77
CXXFLAGS += -DFIX_PLINK_ENDPOINTS
78 79
# Allow pnodes to cap the amount of trivial link bandwidth they can handle
CXXFLAGS += -DTRIVIAL_LINK_BW
80
# Use the old acceptance criteria, which gives special treatment to violations
81
CXXFLAGS += -DSPECIAL_VIOLATION_TREATMENT
82 83
# Pass the Emulab installation root directory
CXXFLAGS += -DTBROOT='"$(TBROOT)"'
84

85 86 87
# 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
88 89
DEPLIBS=$(OBJS)

90
assign: ${MAKEFILE_IN} ${DEPLIBS} ${OBJS}
91
	${CXX} -o assign ${LIBS} $(OBJS) ${LDFLAGS}
92 93 94 95

install: install-schemata $(INSTALL_LIBEXECDIR)/assign

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

97 98 99 100 101 102 103
# 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
104
clean:
105
	-${RM} *.o assign 
106

107 108 109 110 111
$(INSTALL_LIBDIR)/assign/%: %
	@echo "Installing $<"
	-mkdir -p $(INSTALL_LIBDIR)/assign
	$(INSTALL) $< $@

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