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

12 13
SYSTEM	       := $(shell uname -s)

14
include $(OBJDIR)/Makeconf
15

16 17
all:		boss-all tipserv-all
boss-all:	capserver
18 19
tipserv-all:	capture capture-tty capquery
client: capture capquery
20

21
include $(TESTBED_SRCDIR)/GNUmakerules
22

23
DBFLAGS	+= -I/usr/local/include -I$(TESTBED_SRCDIR)/lib/libtb
24

25 26 27 28
#
# Define LOG_DROPS to record warnings in syslog whenever chars were dropped
# due to the output device/pty being full.
#
Mike Hibler's avatar
Mike Hibler committed
29
CFLAGS += -Wall -g -O2 -DLOG_DROPS -I${OBJDIR} -DLOG_TESTBED=$(LOG_TESTBED)
30 31 32 33

ifeq ($(SYSTEM),Linux)
ifeq ($(host_cpu),arm)
else
34 35 36 37 38
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
39 40 41 42
endif
else
LDFLAGS += -static
endif
43

44
capture: capture.c capdecls.h
45 46 47 48
	$(CC) $(CFLAGS) -DUSESOCKETS -DWITHSSL -DPREFIX=\"$(TBROOT)\" -o capture $< -lssl -lcrypto $(LDFLAGS)

capquery: capquery.c capdecls.h
	$(CC) $(CFLAGS) -DPREFIX=\"$(TBROOT)\" -o $@ $<
49

50
capture-nossl: capture.c capdecls.h
51
	$(CC) $(CFLAGS) -DUSESOCKETS -DPREFIX=\"$(TBROOT)\" -o capture-nossl $<
52

53
capture-tty: capture.c capdecls.h
54
	$(CC) $(CFLAGS) -o capture-tty $<
55

56
capserver:	capserver.c capdecls.h
57
	$(CC) $(CFLAGS) $(DBFLAGS) -o capserver $< \
58
		${OBJDIR}/lib/libtb/libtb.a \
59 60
		-L/usr/local/lib/mysql -lmysqlclient

61
#
62
# Do not capture install by default.
63
#
64
install:	all $(INSTALL_SBINDIR)/capserver
65 66 67 68 69
	$(INSTALL_PROGRAM) capture $(INSTALL_DIR)/opsdir/sbin/capture

client-install: client
	$(INSTALL_PROGRAM) capture$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/capture$(EXE)
	$(INSTALL_PROGRAM) capquery$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/capquery$(EXE)
70

71
real-install:	all $(INSTALL_SBINDIR)/capserver $(INSTALL_SBINDIR)/capture
72

73
tipserv-install:	tipserv-all $(INSTALL_SBINDIR)/capture
74

75
clean:
76
	rm -f *.o capture capture-tty capserver core errs Errs