GNUmakefile.in 2.33 KB
Newer Older
1 2
#
# EMULAB-COPYRIGHT
3
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
4 5
# All rights reserved.
#
6 7 8 9 10 11
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= tip

include $(OBJDIR)/Makeconf
12

13
all:	tip tiptunnel console.bin console console.boss tippty
14
client: tippty
15

16
include $(TESTBED_SRCDIR)/GNUmakerules
17

18 19
SSLFLAGS = -DWITHSSL
SSLLIBS	 = -lssl -lcrypto
20
PTYLIBS  =
21
SYSTEM := $(shell uname -s)
22
PTYLIBS += -lutil
23
ifeq ($(SYSTEM),Linux)
24
ifneq ($(wildcard /usr/kerberos/bin/krb5-config),)
25 26 27 28 29
 SSLFLAGS += `/usr/kerberos/bin/krb5-config --cflags`
 SSLLIBS  += `/usr/kerberos/bin/krb5-config --libs krb5`
endif
endif

30
CC = gcc -g -O2 -DUSESOCKETS -I$(TESTBED_SRCDIR)/capture -I$(OBJDIR)
31

32 33
OBJS = cmds.o cmdtab.o hunt.o partab.o \
       remote.o tip.o value.o vars.o getcap.o
34

Chad Barb's avatar
Chad Barb committed
35 36
TUNNELOBJS = tiptunnel.o

37 38 39 40
#
# If HAVE_UUCPLOCK is defined you need -lutil for BSD
#
LIBS=
41

42 43
tip.old:	$(OBJS)
	$(CC) $(LDSTATIC) -o tip $(OBJS) $(LIBS)
44 45 46

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

48
tiptunnel.o: tiptunnel.c $(TESTBED_SRCDIR)/capture/capdecls.h
49 50 51
	$(CC) $(SSLFLAGS) -o tiptunnel.o -c $<

tiptunnel: tiptunnel.o
52
	$(CC) $(LDSTATIC) -o tiptunnel tiptunnel.o $(SSLLIBS)
53 54 55

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

56 57
console.bin.o: tiptunnel.c $(TESTBED_SRCDIR)/capture/capdecls.h
	$(CC) -DLOCALBYDEFAULT -o console.bin.o -c $<
58

59 60
console.bin: console.bin.o
	$(CC) -o console.bin console.bin.o
61

62 63 64 65 66 67
tippty.o: tiptunnel.c $(TESTBED_SRCDIR)/capture/capdecls.h
	$(CC) -DTIPPTY -o $@ -c $<

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

68 69
$(OBJS): tipconf.h tip.h

70 71
client-install: client
	$(INSTALL_PROGRAM) tippty$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/tippty$(EXE)
Chad Barb's avatar
Chad Barb committed
72

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

75 76 77
install:	all $(INSTALL_BINDIR)/tip \
		$(INSTALL_BINDIR)/tiptunnel \
		$(INSTALL_BINDIR)/console.bin 
78
	-mkdir -p $(INSTALL_DIR)/opsdir/bin
79
	$(INSTALL_PROGRAM) console.boss $(INSTALL_DIR)/bin/console
80
	$(INSTALL_PROGRAM) tiptunnel $(INSTALL_DIR)/opsdir/bin/tiptunnel
81 82
	$(INSTALL_PROGRAM) tip $(INSTALL_DIR)/opsdir/bin/tip
	$(INSTALL_PROGRAM) console $(INSTALL_DIR)/opsdir/bin/console
83
	$(INSTALL_PROGRAM) console.bin $(INSTALL_DIR)/opsdir/bin/console.bin
84

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