GNUmakefile.in 3.77 KB
Newer Older
Leigh B. Stoller's avatar
Leigh B. Stoller committed
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/>.
# 
# }}}
Leigh B. Stoller's avatar
Leigh B. Stoller committed
22 23
#

24 25 26 27 28 29 30
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ../..
SUBDIR		= event/sched

include $(OBJDIR)/Makeconf

31
all: event-sched_rrpc
32 33 34

include $(TESTBED_SRCDIR)/GNUmakerules

35 36
CFLAGS   += -g -pthread -DBINDIR='"$(INSTALL_BINDIR)"'
CFLAGS   += -DSBINDIR='"$(INSTALL_SBINDIR)"'
37
#CFLAGS  += -DDEBUG
38
CFLAGS	 += -O -Wall
39
CFLAGS   += -I. -I${OBJDIR}
40
CFLAGS   += -I$(TESTBED_LIBSRCDIR)/event -I$(TESTBED_LIBSRCDIR)/libtb
41
CFLAGS   += -I/usr/local/include
42

43
LDFLAGS  += -pthread
44
LDFLAGS  += -L${TESTBED_LIBOBJDIR}/event -L${TESTBED_LIBOBJDIR}/libtb
45
LDFLAGS  += $(LDSTATIC)
46
DBLIBS    = -L/usr/local/lib/mysql -lmysqlclient -lz
47
LIBS     += -levent_r -ltb -lz
48

49 50

CXXFLAGS += -pthread -O -I$(OBJDIR) -I$(TESTBED_LIBSRCDIR)/libtb
51
CXXFLAGS += -I$(TESTBED_LIBSRCDIR)/event
52 53
ULXRINC   = -I/usr/local/include -I/usr/local/include/ulxmlrpcpp
CXXFLAGS += $(ULXRINC)
54
ULXRLIBS  = -L/usr/local/lib  -lulsshxmlrpcpp -lulxmlrpcpp -lexpat
55 56 57 58 59 60 61

#
# XXX elvin-config adds -lc which is rather bogus, and messes up -pthread
#     build on freebsd. I made a vain attempt to filter it out, but
#     gave up quickly. Deal with it later. 
#
#LIBS     += `elvin-config --libs vin4mt`
62
LIBS	 += -L/usr/local/lib -lpubsub_r -lssl -lcrypto -lm
63

64 65
OBJS	  = event-sched.o 

66 67 68 69
version.c: event-sched.c
	echo >$@ "char build_info[] = \"Built on `date +%d-%b-%Y` by `id -nu`@`hostname | sed 's/\..*//'`:`pwd`\";"

OBJS = \
70
	console-agent.o \
71 72 73 74 75 76 77 78 79 80 81 82
	error-record.o \
	event-sched_rpc.o \
	group-agent.o \
	listNode.o \
	local-agent.o \
	node-agent.o \
	queue.o \
	rrpc.o \
	simulator-agent.o \
	timeline-agent.o \
	version.o

83
event-sched_rrpc: $(OBJS) event-sched.h $(TESTBED_LIBOBJDIR)/event/libevent.a
84
	$(CXX) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(ULXRLIBS) $(LIBS)
85

86
DEPS = \
87
	console-agent.h error-record.h event-sched.h group-agent.h listNode.h \
88
	local-agent.h node-agent.h rpc.h simulator-agent.h timeline-agent.h \
89
	${TESTBED_LIBSRCDIR}/event/event.h
90

91 92 93 94 95 96
queue.o:		queue.c $(DEPS)
listNode.o:		listNode.c $(DEPS)
error-record.o:		error-record.c $(DEPS)
local-agent.o:		local-agent.c $(DEPS)
group-agent.o:		group-agent.c $(DEPS)
simulator-agent.o:	simulator-agent.cc $(DEPS)
97
console-agent.o:	console-agent.cc $(DEPS)
98 99
node-agent.o:		node-agent.cc $(DEPS)
event-sched_rpc.o:	event-sched.c $(DEPS)
100
	$(CC) $(CFLAGS) -DRPC -c -o $@ $<
101
rpc.o:			rpc.cc rpc.h event-sched.h
102
	$(CXX) $(CXXFLAGS) -DSSHRPC $(ULXRINC) -c $<
103

104
rrpc.o:			rpc.cc $(DEPS)
105
	$(CXX) -g $(CXXFLAGS) -DSSLRPC $(ULXRINC) -c -o rrpc.o $<
106

107
install: event-sched_rrpc
108
	-mkdir -p $(INSTALL_DIR)/opsdir/sbin
109
	$(INSTALL_PROGRAM) $< $(INSTALL_DIR)/opsdir/sbin/event-sched
110
	-mkdir -p $(INSTALL_DIR)/opsdir/man/man8
111
	$(INSTALL) -m 0644 $(SRCDIR)/event-sched.8 \
112
		$(INSTALL_DIR)/opsdir/man/man8/event-sched.8
Leigh B. Stoller's avatar
Leigh B. Stoller committed
113
	-mkdir -p $(INSTALL_DIR)/opsdir/bin
Timothy Stack's avatar
Timothy Stack committed
114 115
	$(INSTALL_PROGRAM) $(SRCDIR)/elog2xplot \
		$(INSTALL_DIR)/opsdir/bin/elog2xplot
116

117
control-install: event-sched_rrpc
118
	$(INSTALL_PROGRAM) $< $(INSTALL_SBINDIR)/event-sched
119

120 121 122 123
# not a client thing
client:
client-install: client

124
clean:
125
	/bin/rm -f *.o event-sched event-sched_rpc event-sched_rrpc version.c