GNUmakefile.in 3.15 KB
Newer Older
1
#
2
# Copyright (c) 2000-2014 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/>.
# 
# }}}
22
#
23 24 25 26 27 28
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= tip

include $(OBJDIR)/Makeconf
29

30
all:	tip tiptunnel console.bin console console.boss tippty
31
client: tippty
32

33
include $(TESTBED_SRCDIR)/GNUmakerules
34

35 36
SSLFLAGS = -DWITHSSL
SSLLIBS	 = -lssl -lcrypto
37
PTYLIBS  =
38
SYSTEM := $(shell uname -s)
39
PTYLIBS += -lutil
40
ifeq ($(SYSTEM),Linux)
41
ifneq ($(wildcard /usr/kerberos/bin/krb5-config),)
42 43 44 45 46
 SSLFLAGS += `/usr/kerberos/bin/krb5-config --cflags`
 SSLLIBS  += `/usr/kerberos/bin/krb5-config --libs krb5`
endif
endif

47 48
CFLAGS = -g -O2 -DUSESOCKETS -I$(TESTBED_SRCDIR)/clientside/os/capture \
           -I$(OBJDIR)
49

50 51
OBJS = cmds.o cmdtab.o hunt.o partab.o \
       remote.o tip.o value.o vars.o getcap.o
52

Chad Barb's avatar
Chad Barb committed
53 54
TUNNELOBJS = tiptunnel.o

55 56 57 58
#
# If HAVE_UUCPLOCK is defined you need -lutil for BSD
#
LIBS=
59

60
tip.old:	$(OBJS)
61
	$(CC) $(CFLAGS) $(LDSTATIC) -o tip $(OBJS) $(LIBS)
62 63 64

tip:	$(TESTBED_SRCDIR)/tip/tip.deprecation
	cp $(TESTBED_SRCDIR)/tip/tip.deprecation tip
65

66
tiptunnel.o: tiptunnel.c $(TESTBED_SRCDIR)/clientside/os/capture/capdecls.h
67
	$(CC) $(CFLAGS) $(SSLFLAGS) -o tiptunnel.o -c $<
68 69

tiptunnel: tiptunnel.o
70
	$(CC) $(CFLAGS) $(LDSTATIC) -o tiptunnel tiptunnel.o $(SSLLIBS)
71 72 73

# 'console' is tiptunnel, without SSL, and with localmode on by default.

74
console.bin.o: tiptunnel.c $(TESTBED_SRCDIR)/clientside/os/capture/capdecls.h
75
	$(CC) $(CFLAGS) -DLOCALBYDEFAULT -o console.bin.o -c $<
76

77
console.bin: console.bin.o
78
	$(CC) $(CFLAGS) -o console.bin console.bin.o
79

80
tippty.o: tiptunnel.c $(TESTBED_SRCDIR)/clientside/os/capture/capdecls.h
81
	$(CC) $(CFLAGS) -DTIPPTY -o $@ -c $<
82 83

tippty: tippty.o
84
	$(CC) $(CFLAGS) -o $@ $< $(PTYLIBS)
85

86 87
$(OBJS): tipconf.h tip.h

88 89
client-install: client
	$(INSTALL_PROGRAM) tippty$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/tippty$(EXE)
Chad Barb's avatar
Chad Barb committed
90

91
control-install tipserv-install:	all $(INSTALL_BINDIR)/tip $(INSTALL_BINDIR)/tiptunnel $(INSTALL_BINDIR)/console.bin $(INSTALL_BINDIR)/console
92

93 94 95
install:	all $(INSTALL_BINDIR)/tip \
		$(INSTALL_BINDIR)/tiptunnel \
		$(INSTALL_BINDIR)/console.bin 
96
	-mkdir -p $(INSTALL_DIR)/opsdir/bin
97
	$(INSTALL_PROGRAM) console.boss $(INSTALL_DIR)/bin/console
98
	$(INSTALL_PROGRAM) tiptunnel $(INSTALL_DIR)/opsdir/bin/tiptunnel
99 100
	$(INSTALL_PROGRAM) tip $(INSTALL_DIR)/opsdir/bin/tip
	$(INSTALL_PROGRAM) console $(INSTALL_DIR)/opsdir/bin/console
101
	$(INSTALL_PROGRAM) console.bin $(INSTALL_DIR)/opsdir/bin/console.bin
102

103
clean:
104
	rm -f $(OBJS) *.o tip tiptunnel console console.bin tippty