GNUmakefile.in 3.61 KB
Newer Older
1
#
2
# Copyright (c) 2000-2018 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
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
25 26
OBJDIR		= @top_builddir@
SUBDIR		= $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))
27 28

include $(OBJDIR)/Makeconf
29

30
all:	tip tiptunnel console.bin console console.boss tippty
31
client: console.bin console
32
rack-control: console-nossl
33

34
include $(TESTBED_SRCDIR)/GNUmakerules
35

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

48
CFLAGS = -g -O2 -DUSESOCKETS -I$(SRCDIR)/../os/capture \
49
           -I$(OBJDIR)
50

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

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

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

61
tip.old:	$(OBJS)
62
	$(CC) $(CFLAGS) $(LDSTATIC) -o tip $(OBJS) $(LIBS)
Chad Barb's avatar
 
Chad Barb committed
63

64 65
tip:	tip.deprecation
	cp $< tip
66

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

tiptunnel: tiptunnel.o
71
	$(CC) $(CFLAGS) $(LDSTATIC) -o tiptunnel tiptunnel.o $(SSLLIBS)
Chad Barb's avatar
 
Chad Barb committed
72 73 74

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

75
console.bin.o: tiptunnel.c $(SRCDIR)/../os/capture/capdecls.h
76
	$(CC) $(CFLAGS) -DLOCALBYDEFAULT -o console.bin.o -c $<
Chad Barb's avatar
 
Chad Barb committed
77

78
console.bin: console.bin.o
79
	$(CC) $(CFLAGS) -o console.bin console.bin.o
Chad Barb's avatar
 
Chad Barb committed
80

81 82 83 84 85 86
console-nossl.o: tiptunnel.c $(SRCDIR)/../os/capture/capdecls.h
	$(CC) $(CFLAGS) -o console-nossl.o -c $<

console-nossl: console-nossl.o
	$(CC) $(CFLAGS) -o console-nossl console-nossl.o

87
tippty.o: tiptunnel.c $(SRCDIR)/../os/capture/capdecls.h
88
	$(CC) $(CFLAGS) -DTIPPTY -o $@ -c $<
Timothy Stack's avatar
 
Timothy Stack committed
89 90

tippty: tippty.o
91
	$(CC) $(CFLAGS) -o $@ $< $(PTYLIBS)
Timothy Stack's avatar
 
Timothy Stack committed
92

93 94
$(OBJS): tipconf.h tip.h

Timothy Stack's avatar
 
Timothy Stack committed
95
client-install: client
96 97
	$(INSTALL_PROGRAM) console.bin $(DESTDIR)/usr/local/bin/console.bin
	$(INSTALL_PROGRAM) console $(DESTDIR)/usr/local/bin/console
Chad Barb's avatar
Chad Barb committed
98

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

101 102 103
install:	all $(INSTALL_BINDIR)/tip \
		$(INSTALL_BINDIR)/tiptunnel \
		$(INSTALL_BINDIR)/console.bin 
104
	-mkdir -p $(INSTALL_DIR)/opsdir/bin
105
	$(INSTALL_PROGRAM) console.boss $(INSTALL_DIR)/bin/console
Timothy Stack's avatar
 
Timothy Stack committed
106
	$(INSTALL_PROGRAM) tiptunnel $(INSTALL_DIR)/opsdir/bin/tiptunnel
107 108
	$(INSTALL_PROGRAM) tip $(INSTALL_DIR)/opsdir/bin/tip
	$(INSTALL_PROGRAM) console $(INSTALL_DIR)/opsdir/bin/console
109
	$(INSTALL_PROGRAM) console.bin $(INSTALL_DIR)/opsdir/bin/console.bin
110

111 112
boss-install: install

113 114
rack-control-install:	$(INSTALL_BINDIR)/console-nossl

115 116 117 118 119 120 121 122 123 124 125 126
# Tip not installed in these targets.
subboss: 
subboss-install: 
post-install:
fs-install:
mfs:
mfs-install: 
frisbee-mfs: 
frisbee-mfs-install:
newnode-mfs:
newnode-mfs-install:

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