GNUmakefile.in 1.64 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
45
46
ifeq ($(SYSTEM),Linux)
LIBS     += -ldl
endif
47

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

54
55
tevd:	tevd.o
	$(CC) $(LDFLAGS) -o $@ tevd.o \
Robert Ricci's avatar
Robert Ricci committed
56
		-L/usr/local/lib/mysql -lmysqlclient -ltb $(LIBS)
57
58
59

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

60
install:	$(INSTALL_SBINDIR)/tevd \
61
62
		$(INSTALL_SBINDIR)/tevd.restart \
		$(INSTALL_BINDIR)/tevc
63

64
65
control-install:	$(INSTALL_BINDIR)/tevc

66
67
client-install: tevc
	$(INSTALL_PROGRAM) -s tevc $(DESTDIR)$(CLIENT_BINDIR)/tevc
68
69

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