GNUmakefile.in 2.97 KB
Newer Older
Leigh B. Stoller's avatar
Leigh B. Stoller committed
1
2
#
# EMULAB-COPYRIGHT
Timothy Stack's avatar
Timothy Stack committed
3
# Copyright (c) 2000-2002, 2004, 2005, 2006 University of Utah and the Flux Group.
Leigh B. Stoller's avatar
Leigh B. Stoller committed
4
5
6
# All rights reserved.
#

7
8
9
10
11
12
13
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ../..
SUBDIR		= event/sched

include $(OBJDIR)/Makeconf

Timothy Stack's avatar
   
Timothy Stack committed
14
all: event-sched_rrpc
15
16
17

include $(TESTBED_SRCDIR)/GNUmakerules

Timothy Stack's avatar
   
Timothy Stack committed
18
19
CFLAGS   += -g -pthread -DBINDIR='"$(INSTALL_BINDIR)"'
CFLAGS   += -DSBINDIR='"$(INSTALL_SBINDIR)"'
20
#CFLAGS  += -DDEBUG
21
CFLAGS	 += -O -Wall
22
CFLAGS   += -I. -I${OBJDIR} -I$(SRCDIR)/../lib -I$(TESTBED_SRCDIR)/lib/libtb
23
24
CFLAGS   += `elvin-config --cflags vin4mt`

25
LDFLAGS  += -pthread
26
LDFLAGS  += -L../lib -L${OBJDIR}/lib/libtb
27
28
29
30
DBLIBS    = -L/usr/local/lib/mysql -lmysqlclient -lz
LIBS     += -levent_r -ltb -lcipher -lz

ULXRINC   = -I/usr/local/include -I/usr/local/include/ulxmlrpcpp
Timothy Stack's avatar
   
Timothy Stack committed
31
32
CXXFLAGS += -pthread -O $(ULXRINC) -I$(OBJDIR) -I$(TESTBED_SRCDIR)/lib/libtb
CXXFLAGS += -I$(SRCDIR)/../lib
33
ULXRLIBS  = -L/usr/local/lib  -lulsshxmlrpcpp -lulxmlrpcpp -lexpat
34
35
36
37
38
39
40
41

#
# 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 -lvin4mt -lvin4c -lvin4 -lssl -lcrypto -lm
42

43
44
OBJS	  = event-sched.o 

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

OBJS = \
Timothy Stack's avatar
   
Timothy Stack committed
49
	console-agent.o \
Timothy Stack's avatar
   
Timothy Stack committed
50
51
52
53
54
55
56
57
58
59
60
61
62
63
	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

event-sched_rrpc: $(OBJS) event-sched.h ../lib/libevent.a
	$(CXX) $(CFLAGS) -static $(LDFLAGS) -o $@ $(OBJS) $(ULXRLIBS) $(LIBS)
64

65
DEPS = \
Timothy Stack's avatar
   
Timothy Stack committed
66
	console-agent.h error-record.h event-sched.h group-agent.h listNode.h \
67
68
69
	local-agent.h node-agent.h rpc.h simulator-agent.h timeline-agent.h \
	../lib/event.h

70
71
72
73
74
75
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)
Timothy Stack's avatar
   
Timothy Stack committed
76
console-agent.o:	console-agent.cc $(DEPS)
77
78
node-agent.o:		node-agent.cc $(DEPS)
event-sched_rpc.o:	event-sched.c $(DEPS)
79
	$(CC) $(CFLAGS) -DRPC -c -o $@ $<
80
rpc.o:			rpc.cc rpc.h event-sched.h
81
	$(CXX) $(CXXFLAGS) -DSSHRPC $(ULXRINC) -c $<
82

83
rrpc.o:			rpc.cc $(DEPS)
Timothy Stack's avatar
   
Timothy Stack committed
84
	$(CXX) -g $(CXXFLAGS) -DSSLRPC $(ULXRINC) -c -o rrpc.o $<
85

86
install: event-sched_rrpc
87
	-mkdir -p $(INSTALL_DIR)/opsdir/sbin
Timothy Stack's avatar
   
Timothy Stack committed
88
	$(INSTALL_PROGRAM) $< $(INSTALL_DIR)/opsdir/sbin/event-sched
89
	-mkdir -p $(INSTALL_DIR)/opsdir/man/man8
Timothy Stack's avatar
   
Timothy Stack committed
90
	$(INSTALL) -m 0644 $(SRCDIR)/event-sched.8 \
91
		$(INSTALL_DIR)/opsdir/man/man8/event-sched.8
Timothy Stack's avatar
Timothy Stack committed
92
93
	$(INSTALL_PROGRAM) $(SRCDIR)/elog2xplot \
		$(INSTALL_DIR)/opsdir/bin/elog2xplot
94

Timothy Stack's avatar
   
Timothy Stack committed
95
control-install: event-sched_rrpc
Timothy Stack's avatar
   
Timothy Stack committed
96
	$(INSTALL_PROGRAM) $< $(INSTALL_SBINDIR)/event-sched
Leigh B. Stoller's avatar
Leigh B. Stoller committed
97

98
99
100
101
# not a client thing
client:
client-install: client

102
clean:
Timothy Stack's avatar
   
Timothy Stack committed
103
	/bin/rm -f *.o event-sched event-sched_rpc event-sched_rrpc version.c