-
Notifications
You must be signed in to change notification settings - Fork 342
/
Makefile.am
174 lines (138 loc) · 4.02 KB
/
Makefile.am
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
EXTRA_DIST = \
BSDCOPYING \
SECURITY \
build-aux/mtr.bat \
img/mtr_icon.xpm
$(TEST_FILES)
sbin_PROGRAMS = mtr mtr-packet
TESTS = \
test/cmdparse.py \
test/param.py \
test/probe.py
TEST_FILES = \
test/cmdparse.py \
test/mtrpacket.py \
test/param.py \
test/probe.py \
test/lint.sh
EXTRA_DIST += $(TEST_FILES)
PATHFILES =
CLEANFILES = $(PATHFILES)
EXTRA_DIST += $(PATHFILES:=.in)
#
# We would use % pattern matching here, but that is a GNU make
# extension and doesn't work on FreeBSD.
#
mtr-packet.8: $(srcdir)/man/mtr-packet.8.in
$(AM_V_GEN) $(srcdir)/build-aux/mangen.sh "$(VERSION)" \
$(srcdir)/man/mtr-packet.8.in $@
mtr.8: $(srcdir)/man/mtr.8.in
$(AM_V_GEN) $(srcdir)/build-aux/mangen.sh "$(VERSION)" \
$(srcdir)/man/mtr.8.in $@
$(PATHFILES): Makefile
dist_man_MANS = mtr.8 mtr-packet.8
PATHFILES += man/mtr.8 man/mtr-packet.8
install-exec-hook:
`setcap cap_net_raw+ep $(DESTDIR)$(sbindir)/mtr-packet` \
|| chmod u+s $(DESTDIR)$(sbindir)/mtr-packet
mtr_SOURCES = ui/mtr.c ui/mtr.h \
ui/net.c ui/net.h \
ui/cmdpipe.c ui/cmdpipe.h \
ui/dns.c ui/dns.h \
ui/raw.c ui/raw.h \
ui/split.c ui/split.h \
ui/display.c ui/display.h \
ui/report.c ui/report.h \
ui/select.c ui/select.h \
ui/utils.c ui/utils.h \
packet/cmdparse.c packet/cmdparse.h \
packet/sockaddr.c packet/sockaddr.h \
ui/mtr-curses.h \
img/mtr_icon.xpm \
ui/mtr-gtk.h
if WITH_ERROR
mtr_SOURCES += \
portability/error.h \
portability/error.c
endif
if WITH_GETOPT
mtr_SOURCES += \
portability/getopt.h \
portability/getopt.c \
portability/getopt1.c
endif
if WITH_IPINFO
mtr_SOURCES += ui/asn.c ui/asn.h
endif
if WITH_CURSES
mtr_SOURCES += ui/curses.c
endif
if WITH_GTK
mtr_SOURCES += ui/gtk.c
endif
if WITH_LIBASAN
ASAN_CFLAGS = -fno-omit-frame-pointer
ASAN_CFLAGS += -fsanitize=undefined
ASAN_CFLAGS += -fsanitize=address
endif
mtr_INCLUDES = $(GLIB_CFLAGS) -I$(top_builddir) -I$(top_srcdir)
mtr_CFLAGS = $(GTK_CFLAGS) $(NCURSES_CFLAGS) $(ASAN_CFLAGS) $(JANSSON_CFLAGS)
mtr_LDADD = $(GTK_LIBS) $(NCURSES_LIBS) $(RESOLV_LIBS) $(JANSSON_LIBS)
mtr_packet_SOURCES = \
portability/queue.h \
packet/packet.c \
packet/cmdparse.c packet/cmdparse.h \
packet/command.c packet/command.h \
packet/platform.h \
packet/probe.c packet/probe.h \
packet/protocols.h \
packet/timeval.c packet/timeval.h \
packet/wait.h \
packet/sockaddr.c packet/sockaddr.h
mtr_packet_LDADD = $(CAP_LIBS)
if WITH_ERROR
mtr_packet_SOURCES += \
portability/error.h \
portability/error.c
endif
if CYGWIN
mtr_packet_SOURCES += \
packet/probe_cygwin.c packet/probe_cygwin.h \
packet/wait_cygwin.c
mtr_packet_LDADD += -lcygwin -liphlpapi -lws2_32
dist_windows_aux = \
$(srcdir)/build-aux/mtr.bat \
$(srcdir)/AUTHORS \
$(srcdir)/BSDCOPYING \
$(srcdir)/COPYING \
$(srcdir)/README \
$(srcdir)/NEWS
distwindir = $(distdir)-win-$(host_cpu)
# Bundle necessary files for a Windows binary distribution
distdir-win: $(dist_windows_aux) mtr.exe mtr-packet.exe
rm -fr $(distwindir)
mkdir -p $(distwindir) $(distwindir)/bin $(distwindir)/terminfo
cp $(dist_windows_aux) -t $(distwindir)
cp mtr.exe mtr-packet.exe -t $(distwindir)/bin
ldd mtr.exe | grep -v cygdrive | awk '{ print $$3 }' | xargs cp -t $(distwindir)/bin
cp `find /usr/share/terminfo -name cygwin | xargs dirname` -r $(distwindir)/terminfo
# Zip up a Windows binary distribution
dist-windows-bin: distdir-win
rm -f $(distwindir).zip
zip -rq $(distwindir).zip $(distwindir)
rm -fr $(distwindir)
else # if CYGWIN
check_PROGRAMS = mtr-packet-listen
mtr_packet_SOURCES += \
packet/construct_unix.c packet/construct_unix.h \
packet/deconstruct_unix.c packet/deconstruct_unix.h \
packet/probe_unix.c packet/probe_unix.h \
packet/wait_unix.c
mtr_packet_listen_SOURCES = \
test/packet_listen.c
endif # if CYGWIN
if BUILD_BASH_COMPLETION
dist_bashcompletion_DATA = bash-completion/mtr
endif
dist-hook:
$(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version