GNUmakefile.in 1.84 KB
Newer Older
Leigh B. Stoller's avatar
Leigh B. Stoller committed
1
2
#
# EMULAB-COPYRIGHT
Leigh B. Stoller's avatar
Leigh B. Stoller committed
3
# Copyright (c) 2000-2004 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
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ../..
SUBDIR		= event/tbgen

12
SYSTEM	       := $(shell uname -s)
13
PROGRAMS	= tevc
14
ifneq ($(SYSTEM),Linux)
15
PROGRAMS       += tevd tevd.restart
16
endif
17
18
19
20

include $(OBJDIR)/Makeconf

all:	$(PROGRAMS)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
21
client: tevc
22
23
24

include $(TESTBED_SRCDIR)/GNUmakerules

25
26
27
28
29
30
31
32
33
34
35
LIBTBDIR    = $(OBJDIR)/lib/libtb
LIBEVENTDIR = ../lib

# Rules to make sure that some libraries we need from other directories get
# built first
$(LIBTBDIR)/%.o:
	@$(MAKE) -C $(LIBTBDIR) $(@F)

$(LIBEVENTDIR)/%.a:
	@$(MAKE) -C $(LIBEVENTDIR) $(@F)

36
CFLAGS   += -DDEBUG
37
CFLAGS	 += -O -g -static -Wall
38
CFLAGS   += -I. -I${OBJDIR} -I$(SRCDIR)/../lib -I$(TESTBED_SRCDIR)/lib/libtb
39
CFLAGS   += `elvin-config --cflags vin4c`
40

Robert Ricci's avatar
Robert Ricci committed
41
LDFLAGS  += -L$(OBJDIR)/lib -L$(OBJDIR)/lib/libtb -L../lib
42
LIBS     += -levent -lcrypto
43
LIBS     += `elvin-config --libs vin4c`
44
ifeq ($(SYSTEM),Linux)
45
46
47
48
49
NEEDKERB := $(shell nm /usr/lib/libssl.a | grep -q krb; echo $$?)
ifeq ($(NEEDKERB),0)
 CFLAGS   += `/usr/kerberos/bin/krb5-config --cflags`
 LIBS     += `/usr/kerberos/bin/krb5-config --libs krb5`
endif
50
51
LIBS     += -ldl
endif
52

53
tevc:	tevc.o $(LIBTBDIR)/log.o $(LIBTBDIR)/tbdefs.o
Robert Ricci's avatar
Robert Ricci committed
54
55
	# Link against some of the object files from libtb, instead of the
	# whole library, since the latter cannot be built on ops
56
57
	$(CC) $(LDFLAGS) -static -o $@ tevc.o $(LIBTBDIR)/log.o \
		$(LIBTBDIR)/tbdefs.o $(LIBS)
58

59
60
tevd:	tevd.o
	$(CC) $(LDFLAGS) -o $@ tevd.o \
Robert Ricci's avatar
Robert Ricci committed
61
		-L/usr/local/lib/mysql -lmysqlclient -ltb $(LIBS)
62
63
64

$(PROGRAMS):	../lib/libevent.a ../lib/event.h

65
install:	$(INSTALL_SBINDIR)/tevd \
66
67
		$(INSTALL_SBINDIR)/tevd.restart \
		$(INSTALL_BINDIR)/tevc
68

69
70
control-install:	$(INSTALL_BINDIR)/tevc

71
72
client-install: tevc
	$(INSTALL_PROGRAM) -s tevc $(DESTDIR)$(CLIENT_BINDIR)/tevc
73
74

clean:
Mike Hibler's avatar
Mike Hibler committed
75
	rm -f *.o $(PROGRAMS)