File: Makefile.manual

package info (click to toggle)
ttt 1.7-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 568 kB
  • ctags: 544
  • sloc: ansic: 4,767; sh: 2,804; tcl: 159; makefile: 136
file content (145 lines) | stat: -rw-r--r-- 3,785 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Top level hierarchy
prefix = /usr/local
# Pathname of directory to install the binary
BINDEST = ${prefix}/bin
# Pathname of directory to install the man page
MANDEST = ${prefix}/man
# Pathname of directory to install the library
LIBDEST = ${prefix}/lib/ttt
INSTALL = install -c
SHELL="/bin/sh"
#
#	Site Dependent Configuration
#
#CC=	gcc
# specify STATICLINK if you want tttprobe and tttrelay statically linked
#STATICLINK=	-static
#WARNINGS=	-Wreturn-type -Wshadow -Wpointer-arith -Wunused \
#		-Wmissing-prototypes


#
# include file path for blt, tcl, tk, and X11.
#

TK_INCLUDES=	-I/usr/local/include/tcl7.6 -I/usr/local/include/tk4.2 \
		-I/usr/local/blt/lib
TK_LIBS=	-lBLT -ltk42 -ltcl76 -lX11


SITE_INCLUDES=	-I. -I/usr/X11R6/include -I/usr/local/include $(TK_INCLUDES)

SITE_LDFLAGS=	-L/usr/X11R6/lib -L/usr/local/lib -L/usr/local/blt/lib

#
#	System Dependent Configuration
#
#	-DALIGN_WORD: for risc machines (e.g. sparc, alpha)
#	-DHAVE_GETHOSTENT: turn on if the system has gethostent(3).
#

# for FreeBSD
# (nothing required)

# for BSD/OS
#SYS_LIBS=	-lipc
# for BSD/OS dynamic libraries 
#SYS_LIBS=	-lipc -ldl

# for Solaris
#SYS_DEFINES=	-DALIGN_WORD -DHAVE_GETHOSTENT -DHAVE_SYS_SOCKIO_H 
#SYS_LIBS=	-lsocket -lnsl

# for SunOS4.x
#SYS_DEFINES=	-DALIGN_WORD -DHAVE_GETHOSTENT

# for NewsOS6.x
#SYS_DEFINES=	-DSVR4 -DALIGN_WORD -DHAVE_GETHOSTENT -DHAVE_SYS_SOCKIO_H 
#SYS_LIBS=	-lsocket -lnsl

# for Linux (Slackware3.0 + tcpdump-3.0.4 for linux) (should be site-dependent)
#SYS_INCLUDES=	-I/usr/include/tcl -I/src/tcpdump-3.0.4/linux-include

#
# ttt related flags
#
#	-DIPV6: for IPv6 support
#	-DTTT_LIBRARY="your_ttt.tcl_path"
#

TTT_DEFINES=
#TTT_DEFINES=	-DIPV6
#TTT_DEBUG_FLAGS=	-DNODE_DEBUG -DWG_DEBUG -DREMOTE_DEBUG

PCAP_LIB=	 -lpcap

#DEBUG_FLAGS=	-g $(TTT_DEBUG_FLAGS) $(WARNINGS)
DEBUG_FLAGS=	-O2 -DNDEBUG $(TTT_DEBUG_FLAGS)

CFLAGS=	  $(DEBUG_FLAGS) $(SITE_CFLAGS) $(SYS_CFLAGS)
LDFLAGS=  $(SITE_LDFLAGS) $(SYS_LDFLAGS)
DEFINES=  $(TTT_DEFINES) $(SITE_DEFINES) $(SYS_DEFINES)
INCLUDES= $(SITE_INCLUDES) $(SYS_INCLUDES)
LIBS=	  $(SITE_LIBS) $(SYS_LIBS)


TTT_OBJS=	ttt.o tk_ttt.o common.o display.o account.o net_names.o \
		window.o node.o net_read.o
PROBE_OBJS=	probe.o common.o account.o remote.o node.o net_read.o
VIEW_OBJS=	tk_view.o common.o remote.o display.o net_names.o \
		window.o viewer.o node_emu.o pcap_inet.o
TEXTVIEW_OBJS=	textview.o common.o net_names.o remote.o \
		window.o text_viewer.o node_emu.o pcap_inet.o

TTT_HEADERS=	ttt.h ttt_tk.h ttt_remote.h ttt_window.h ttt_node.h

PROG=	ttt tttprobe tttview

all: $(PROG)

ttt: $(TTT_OBJS)
	$(CC) -o $@ $(TTT_OBJS) $(LDFLAGS) $(TK_LIBS) $(PCAP_LIB) $(LIBS) -lm

tttprobe: $(PROBE_OBJS)
	$(CC) -o $@ $(PROBE_OBJS) $(STATICLINK) $(LDFLAGS) $(PCAP_LIB) $(LIBS) $(SYSLIBS)

tttview: $(VIEW_OBJS)
	$(CC) -o $@ $(VIEW_OBJS) $(LDFLAGS) $(TK_LIBS) $(LIBS) $(SYSLIBS) -lm

ttttextview: $(TEXTVIEW_OBJS)
	$(CC) -o $@ $(TEXTVIEW_OBJS) $(LDFLAGS) $(LIBS) $(SYSLIBS)

tttrelay: relay.o
	$(CC) -o $@ relay.o $(STATICLINK) $(LDFLAGS) $(LIBS) $(SYSLIBS)


tk_view.o: tk_ttt.c
	$(CC) $(CFLAGS) $(INCLUDES) $(DEFINES) -DTTT_VIEW -o $@ -c tk_ttt.c

text_viewer.o: viewer.c 
	$(CC) $(CFLAGS) $(INCLUDES) $(DEFINES) -DTTT_TEXT -o $@ -c viewer.c

.c.o: 
	$(CC) $(CFLAGS) $(INCLUDES) $(DEFINES) -c $*.c


install: all
	for i in ttt tttprobe tttview; do \
		$(INSTALL) -m 555 -o bin -g bin $$i $(DESTDIR)$(BINDEST); \
	done
	if [ ! -d $(DESTDIR)$(LIBDEST) ]; then \
		mkdir $(DESTDIR)$(LIBDEST); \
	fi
	$(INSTALL) -m 444 -o bin -g bin ttt.tcl $(DESTDIR)$(LIBDEST)
	

install-man:
	for i in ttt tttprobe tttview; do \
		$(INSTALL) -m 444 -o bin -g bin $$i.1 \
			    $(DESTDIR)$(MANDEST)/man1; \
	done

cleanobj:;	-rm -f *.o core *.core *.bak ,* *~ "#"*

clean:;		-rm -f $(PROG) *.o core *.core *.bak ,* *~ "#"*