GNUmakefile.in 4.04 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		= ../..
27
SUBDIR		= event/new_sched
28 29 30

include $(OBJDIR)/Makeconf

31 32
ARCH	       := $(shell uname -m)

33 34 35 36
all: event-sched_rrpc

include $(TESTBED_SRCDIR)/GNUmakerules

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

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

51
CXXFLAGS += -pthread -O -I$(OBJDIR)
52
CXXFLAGS +=  -I$(TESTBED_LIBSRCDIR)/event -I$(TESTBED_LIBSRCDIR)/libtb
53 54
XMLRPCINC = `xmlrpc-c-config c++2 client --cflags`
CXXFLAGS += $(XMLRPCINC)
55
XMLRPCLIBS = `xmlrpc-c-config c++2 client --libs`
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70

#
# 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`
LIBS	 += -L/usr/local/lib -lpubsub_r -lssl -lcrypto -lm

OBJS	  = event-sched.o 

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

OBJS = \
71
	emulab_proxy.o \
72 73 74 75 76 77 78 79 80 81 82 83 84
	console-agent.o \
	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

85
event-sched_rrpc: $(OBJS) event-sched.h $(TESTBED_LIBOBJDIR)/event/libevent.a
86
	$(CXX) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(XMLRPCLIBS) $(LIBS)
87 88 89 90

DEPS = \
	console-agent.h error-record.h event-sched.h group-agent.h listNode.h \
	local-agent.h node-agent.h rpc.h simulator-agent.h timeline-agent.h \
91
	${TESTBED_LIBSRCDIR}/event/event.h
92

93
emulab_proxy.o:		emulab_proxy.cc $(DEPS)
94 95 96 97 98 99 100 101 102 103 104
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)
console-agent.o:	console-agent.cc $(DEPS)
node-agent.o:		node-agent.cc $(DEPS)
event-sched_rpc.o:	event-sched.c $(DEPS)
	$(CC) $(CFLAGS) -DRPC -c -o $@ $<
rpc.o:			rpc.cc rpc.h event-sched.h
105
	$(CXX) $(CXXFLAGS) -DSSHRPC $(XMLRPCINC) -c $<
106 107

rrpc.o:			rpc.cc $(DEPS)
108
	$(CXX) -g $(CXXFLAGS) -DSSLRPC $(XMLRPCINC) -c -o rrpc.o $<
109 110 111

install: event-sched_rrpc
	-mkdir -p $(INSTALL_DIR)/opsdir/sbin
112
	$(INSTALL_PROGRAM) $< $(INSTALL_DIR)/opsdir/sbin/new-event-sched
113 114 115
ifeq ($(ARCH),amd64)
	ln -sf new-event-sched $(INSTALL_DIR)/opsdir/sbin/event-sched
endif
116 117 118 119 120 121 122 123
	-mkdir -p $(INSTALL_DIR)/opsdir/man/man8
	$(INSTALL) -m 0644 $(SRCDIR)/event-sched.8 \
		$(INSTALL_DIR)/opsdir/man/man8/event-sched.8
	-mkdir -p $(INSTALL_DIR)/opsdir/bin
	$(INSTALL_PROGRAM) $(SRCDIR)/elog2xplot \
		$(INSTALL_DIR)/opsdir/bin/elog2xplot

control-install: event-sched_rrpc
124
	$(INSTALL_PROGRAM) $< $(INSTALL_SBINDIR)/new-event-sched
125 126 127
ifeq ($(ARCH),amd64)
	ln -sf new-event-sched $(INSTALL_SBINDIR)/event-sched
endif
128 129 130 131 132 133 134

# not a client thing
client:
client-install: client

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