forked from lsof-org/lsof
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.am
167 lines (152 loc) · 5.58 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
bin_PROGRAMS = lsof
# Documentation
EXTRA_DIST = 00.README.FIRST 00CREDITS 00DCACHE 00DIALECTS 00DIST 00FAQ 00LSOF-L 00MANIFEST 00PORTING 00QUICKSTART 00README 00TEST 00XCONFIG
# Testing
EXTRA_DIST += tests/00README tests/TestDB tests/CkTestDB tests/Makefile tests/LsofTest.h check.bash
# Dialect neutral sources
lsof_SOURCES = arg.c main.c misc.c node.c print.c proc.c store.c usage.c util.c \
lib/ckkv.c lib/dvch.c lib/fino.c lib/isfn.c lib/lkud.c lib/pdvn.c lib/prfp.c lib/ptti.c lib/rdev.c lib/rnmt.c lib/rmnt.c lib/rnam.c lib/rnch.c lib/rnmh.c
lsof_SOURCES += lsof.h lsof_fields.h proto.h hash.h
DIALECT_ROOT = $(top_srcdir)/dialects
DIALECT_PATH = $(DIALECT_ROOT)/$(LSOF_DIALECT_DIR)
# Dialect specific sources
if LINUX
lsof_SOURCES += dialects/linux/dfile.c \
dialects/linux/dmnt.c \
dialects/linux/dnode.c \
dialects/linux/dproc.c \
dialects/linux/dsock.c \
dialects/linux/dstore.c \
dialects/linux/dlsof.h \
dialects/linux/dproto.h \
dialects/linux/machine.h
endif
if DARWIN
lsof_SOURCES += dialects/darwin/ddev.c \
dialects/darwin/dfile.c \
dialects/darwin/dmnt.c \
dialects/darwin/dproc.c \
dialects/darwin/dsock.c \
dialects/darwin/dstore.c \
dialects/darwin/dlsof.h \
dialects/darwin/dproto.h \
dialects/darwin/machine.h
endif
if FREEBSD
lsof_SOURCES += dialects/freebsd/dmnt.c \
dialects/freebsd/dnode.c \
dialects/freebsd/dproc.c \
dialects/freebsd/dsock.c \
dialects/freebsd/dstore.c \
dialects/freebsd/dlsof.h \
dialects/freebsd/dproto.h \
dialects/freebsd/machine.h
endif
if NETBSD
lsof_SOURCES += dialects/netbsd/dmnt.c \
dialects/netbsd/dnode.c \
dialects/netbsd/dproc.c \
dialects/netbsd/dsock.c \
dialects/netbsd/dstore.c \
dialects/netbsd/dlsof.h \
dialects/netbsd/dproto.h \
dialects/netbsd/machine.h
endif
if OPENBSD
lsof_SOURCES += dialects/openbsd/dfile.c \
dialects/openbsd/dmnt.c \
dialects/openbsd/dnode.c \
dialects/openbsd/dproc.c \
dialects/openbsd/dsock.c \
dialects/openbsd/dstore.c \
dialects/openbsd/dlsof.h \
dialects/openbsd/dproto.h \
dialects/openbsd/machine.h
endif
lsof_CPPFLAGS = -I$(DIALECT_PATH) -Iautotools
lsof_CPPFLAGS += -DAUTOTOOLS
# Manpages
lsof.man: Lsof.8 version 00DIALECTS
soelim < Lsof.8 > $@
man8_MANS = lsof.man
EXTRA_DIST += Lsof.8
# Fix distcheck error
clean-local:
rm -rf lsof.man
distclean-local:
rm -rf lockf_owner.h lockf.h
# Testing scripts
AM_TESTS_ENVIRONMENT = export LSOF_DIALECT_DIR=$(LSOF_DIALECT_DIR); export LSOF_DIALECT=$(LSOF_DIALECT);
# Dialect neutral
DIALECT_NEUTRAL_TESTS = tests/case-00-hello.bash \
tests/case-01-version.bash \
tests/case-20-exit-status.bash \
tests/case-20-fd-only-inclusion.bash \
tests/case-20-handle-missing-files.bash \
tests/case-20-offset-field.bash \
tests/case-20-repeat-count.bash \
tests/case-21-exit-Q-status.bash \
tests/case-22-empty-process-name.bash
TESTS = $(DIALECT_NEUTRAL_TESTS)
EXTRA_DIST += $(DIALECT_NEUTRAL_TESTS) \
tests/case-13-classic.bash \
tests/case-14-classic-opt.bash \
tests/common.bash
# Dialect specific
check_PROGRAMS =
# Linux
LINUX_TESTS = dialects/linux/tests/case-10-mqueue.bash \
dialects/linux/tests/case-10-ux-socket-state.bash \
dialects/linux/tests/case-20-epoll.bash \
dialects/linux/tests/case-20-eventfd-endpoint.bash \
dialects/linux/tests/case-20-inet6-ffffffff-handling.bash \
dialects/linux/tests/case-20-inet6-socket-endpoint.bash \
dialects/linux/tests/case-20-inet-socket-endpoint.bash \
dialects/linux/tests/case-20-mmap.bash \
dialects/linux/tests/case-20-mqueue-endpoint.bash \
dialects/linux/tests/case-20-open-flags-cx.bash \
dialects/linux/tests/case-20-open-flags-path.bash \
dialects/linux/tests/case-20-open-flags-tmpf.bash \
dialects/linux/tests/case-20-pidfd-pid.bash \
dialects/linux/tests/case-20-pipe-endpoint.bash \
dialects/linux/tests/case-20-pipe-no-close-endpoint.bash \
dialects/linux/tests/case-20-pty-endpoint.bash \
dialects/linux/tests/case-20-ux-socket-endpoint.bash \
dialects/linux/tests/case-20-ux-socket-endpoint-unaccepted.bash
EXTRA_DIST += $(LINUX_TESTS) dialects/linux/tests/Makefile dialects/linux/tests/case-00-linux-hello.bash
if LINUX
check_PROGRAMS += dialects/linux/tests/epoll \
dialects/linux/tests/eventfd \
dialects/linux/tests/mmap \
dialects/linux/tests/mq_fork \
dialects/linux/tests/mq_open \
dialects/linux/tests/open_with_flags \
dialects/linux/tests/pidfd \
dialects/linux/tests/pipe \
dialects/linux/tests/pty \
dialects/linux/tests/ux
dialects_linux_tests_mq_fork_LDADD = -lrt
dialects_linux_tests_mq_open_LDADD = -lrt
TESTS += $(LINUX_TESTS)
endif
# Testing programs
TESTS += tests/LTbasic tests/LTbigf tests/LTdnlc tests/LTlock tests/LTnfs tests/LTnlink tests/LTsock tests/LTszoff tests/LTunix
check_PROGRAMS += tests/LTbasic tests/LTbigf tests/LTdnlc tests/LTlock tests/LTnfs tests/LTnlink tests/LTsock tests/LTszoff tests/LTunix
tests_LTbasic_SOURCES = tests/LTbasic.c tests/LTlib.c
tests_LTbasic_CFLAGS = @LSOF_TEST_CFLAGS@
tests_LTbigf_SOURCES = tests/LTbigf.c tests/LTlib.c
tests_LTbigf_CFLAGS = @LSOF_TEST_CFLAGS@
tests_LTdnlc_SOURCES = tests/LTdnlc.c tests/LTlib.c
tests_LTdnlc_CFLAGS = @LSOF_TEST_CFLAGS@
tests_LTlock_SOURCES = tests/LTlock.c tests/LTlib.c
tests_LTlock_CFLAGS = @LSOF_TEST_CFLAGS@
tests_LTnfs_SOURCES = tests/LTnfs.c tests/LTlib.c
tests_LTnfs_CFLAGS = @LSOF_TEST_CFLAGS@
tests_LTnlink_SOURCES = tests/LTnlink.c tests/LTlib.c
tests_LTnlink_CFLAGS = @LSOF_TEST_CFLAGS@
tests_LTsock_SOURCES = tests/LTsock.c tests/LTlib.c
tests_LTsock_CFLAGS = @LSOF_TEST_CFLAGS@
tests_LTszoff_SOURCES = tests/LTszoff.c tests/LTlib.c
tests_LTszoff_CFLAGS = @LSOF_TEST_CFLAGS@
tests_LTunix_SOURCES = tests/LTunix.c tests/LTlib.c
tests_LTunix_CFLAGS = @LSOF_TEST_CFLAGS@