GNUmakefile.in 3.3 KB
Newer Older
Leigh Stoller's avatar
Leigh Stoller committed
1
#
2
# Copyright (c) 2000-2012 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/>.
# 
# }}}
Leigh Stoller's avatar
Leigh Stoller committed
22 23
#

24 25 26 27 28
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= capture

29 30
SYSTEM	       := $(shell uname -s)

31
include $(OBJDIR)/Makeconf
32

33 34 35 36
# For console server boxes that speak telnet.
# Requires libtelnet, see install/ports/libtelnet for a FreeBSD port
WITH_TELNET	= 0

37 38
all:		boss-all tipserv-all
boss-all:	capserver
39 40
tipserv-all:	capture capture-tty capquery caplogserver caplog caplog.bin
client: capture capquery caplog caplog.bin
41

42
include $(TESTBED_SRCDIR)/GNUmakerules
43

44
DBFLAGS	+= -I/usr/local/include -I$(TESTBED_LIBSRCDIR)/libtb
45

46 47 48 49
#
# 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
50
CFLAGS += -Wall -g -O2 -DLOG_DROPS -I${OBJDIR} -DLOG_TESTBED=$(LOG_TESTBED)
51
LDFLAGS  += $(LDSTATIC)
52 53

ifeq ($(SYSTEM),Linux)
54 55 56 57 58
ifneq ($(wildcard /usr/kerberos/bin/krb5-config),)
CFLAGS   += `/usr/kerberos/bin/krb5-config --cflags`
LIBS     += `/usr/kerberos/bin/krb5-config --libs krb5`
ifneq ($(wildcard /usr/lib/libkrb5support.a),)
LIBS     += -lkrb5support
59
endif
60
endif
61
LIBS	 += -ldl -lz
62
endif
63 64 65 66
ifeq ($(WITH_TELNET),1)
CFLAGS	+= -DWITH_TELNET -I/usr/local/include
LIBS	+= -L/usr/local/lib -ltelnet
endif
67

68
capture: capture.c capdecls.h
69
	$(CC) $(CFLAGS) -DUSESOCKETS -DWITHSSL -DPREFIX=\"$(TBROOT)\" -o capture $< $(LDFLAGS) -lssl -lcrypto $(LIBS)
70 71

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

74 75 76 77 78 79
caplog.bin: caplog.c capdecls.h
	$(CC) $(CFLAGS) -DPREFIX=\"$(TBROOT)\" -o $@ $< $(LDFLAGS) $(LIBS)

caplogserver: caplogserver.c capdecls.h
	$(CC) $(CFLAGS) -DPREFIX=\"$(TBROOT)\" -o $@ $< $(LDFLAGS) $(LIBS)

80
capture-nossl: capture.c capdecls.h
81
	$(CC) $(CFLAGS) -DUSESOCKETS -DPREFIX=\"$(TBROOT)\" -o capture-nossl $<
82

83
capture-tty: capture.c capdecls.h
84
	$(CC) $(CFLAGS) -o capture-tty $<
85

86
capserver:	capserver.c capdecls.h
87
	$(CC) $(CFLAGS) $(DBFLAGS) -o capserver $< \
88
		${TESTBED_LIBOBJDIR}/libtb/libtb.a \
89 90
		-L/usr/local/lib/mysql -lmysqlclient

91
#
92
# Do not capture install by default.
93
#
94
install:	all $(INSTALL_SBINDIR)/capserver
95 96 97 98 99
	$(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)
100

101
real-install:	all $(INSTALL_SBINDIR)/capserver $(INSTALL_SBINDIR)/capture
102

103 104
tipserv-install:	tipserv-all $(INSTALL_SBINDIR)/capture \
			$(INSTALL_SBINDIR)/caplogserver
105

106
clean:
107
	rm -f *.o capture capture-tty capserver capquery core errs Errs
108 109
	rm -f caplog caplog.bin caplogserver