blob: 9efebf136be76544b6e7e580015c03b08141a9c5 [file] [log] [blame]
Roland McGrath6d2b3492002-12-30 00:51:30 +00001# Automake input for strace.
2
Dmitry V. Levin4e4b5ad2011-02-27 00:28:50 +00003SUBDIRS = tests
4
Roland McGrath6d2b3492002-12-30 00:51:30 +00005bin_PROGRAMS = strace
6man_MANS = strace.1
Denys Vlasenko796f6e82012-03-09 14:21:59 +01007bin_SCRIPTS = strace-graph strace-log-merge
Roland McGrath6d2b3492002-12-30 00:51:30 +00008
Dmitry V. Levinee245d82012-02-25 15:34:10 +01009OS = linux
Roland McGrath6d2b3492002-12-30 00:51:30 +000010# ARCH is `i386', `m68k', `sparc', etc.
11ARCH = @arch@
Roland McGrath6d2b3492002-12-30 00:51:30 +000012
Dmitry V. Levin916aded2010-09-09 17:36:36 +000013ACLOCAL_AMFLAGS = -I m4
Dmitry V. Levin918e49b2010-09-09 17:41:15 +000014AM_CFLAGS = $(WARN_CFLAGS)
Mike Frysinger9004e122011-02-20 23:24:22 -050015AM_CPPFLAGS = -I$(srcdir)/$(OS)/$(ARCH) -I$(srcdir)/$(OS) -I$(builddir)/$(OS)
Roland McGrath6d2b3492002-12-30 00:51:30 +000016
Mike Frysinger761ed9b2014-02-16 01:59:20 -050017include xlat/Makemodule.am
18
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000019strace_SOURCES = \
Dmitry V. Levin2b640342013-11-11 15:06:18 +000020 aio.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000021 bjm.c \
22 block.c \
23 count.c \
24 desc.c \
Dmitry V. Levin2ed2cc72014-09-11 22:40:37 +000025 dirent.c \
Dmitry V. Levin99db95d2014-02-05 04:13:18 +000026 fanotify.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000027 file.c \
Dmitry V. Levin2f332e92014-02-05 15:43:04 +000028 inotify.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000029 io.c \
30 ioctl.c \
Dmitry V. Levinfc4727d2014-02-05 17:27:43 +000031 ioprio.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000032 ipc.c \
Dmitry V. Levin90aa9f42014-02-05 13:48:26 +000033 kexec.c \
Dmitry V. Levin3acf4032014-02-05 22:41:45 +000034 keyctl.c \
Dmitry V. Levin99a05442014-04-10 14:10:17 +000035 ldt.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000036 loop.c \
37 mem.c \
38 mtd.c \
39 net.c \
Dmitry V. Levinf6eb0d62014-12-03 20:00:42 +000040 or1k_atomic.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000041 pathtrace.c \
42 process.c \
Stefan Sørensenb88a6f82014-01-31 12:01:01 +010043 ptp.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000044 quota.c \
Dmitry V. Levin9aaf88c2014-02-05 14:51:19 +000045 reboot.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000046 resource.c \
47 scsi.c \
48 signal.c \
49 sock.c \
Dmitry V. Levin2f6510c2014-08-21 03:17:48 +000050 socketutils.c \
Dmitry V. Levin9a0dd742014-09-22 00:17:42 +000051 statfs.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000052 strace.c \
53 stream.c \
54 syscall.c \
Dmitry V. Levin172241b2014-12-03 20:20:52 +000055 sysctl.c \
Dmitry V. Levin57d45a22014-09-29 23:13:05 +000056 sysinfo.c \
Dmitry V. Levin600e33c2014-12-03 20:08:44 +000057 sysmips.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000058 system.c \
59 term.c \
60 time.c \
61 util.c \
Philippe De Muyter0cc96142014-11-03 21:27:40 +010062 v4l2.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000063 vsprintf.c
64
Luca Clementi327064b2013-07-23 00:11:35 -070065if USE_LIBUNWIND
66strace_SOURCES += unwind.c
67strace_CPPFLAGS = $(AM_CPPFLAGS) $(libunwind_CPPFLAGS)
68strace_LDFLAGS = $(libunwind_LDFLAGS)
69strace_LDADD = $(libunwind_LIBS)
70else
71strace_CPPFLAGS = $(AM_CPPFLAGS)
72endif
73
Roland McGrath2746edd2002-12-30 09:13:08 +000074noinst_HEADERS = defs.h
Denys Vlasenko76f61be2013-03-06 18:59:09 +010075# Enable this to get link map generated
76#strace_CFLAGS = $(AM_CFLAGS) -Wl,-Map=strace.mapfile
Roland McGrath6d2b3492002-12-30 00:51:30 +000077
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000078EXTRA_DIST = \
79 $(man_MANS) \
Dmitry V. Levindce75932013-04-30 23:52:12 +000080 .version \
Mike Frysinger6c191362013-05-15 16:33:09 -040081 COPYING \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000082 CREDITS \
83 ChangeLog \
84 ChangeLog-CVS \
85 README-linux \
86 README-linux-ptrace \
87 debian/changelog \
88 debian/compat \
89 debian/control \
90 debian/copyright \
91 debian/rules \
92 debian/source/format \
93 debian/strace-udeb.install \
94 debian/strace.docs \
95 debian/strace.examples \
96 debian/strace.install \
97 debian/strace.manpages \
98 debian/strace64.install \
99 debian/strace64.manpages \
100 debian/watch \
101 errnoent.sh \
Dmitry V. Levin00119f62014-11-04 01:40:42 +0000102 ioctlsort.c \
Dmitry V. Levin0db34e72013-06-02 18:12:44 +0000103 linux/aarch64/errnoent1.h \
104 linux/aarch64/ioctlent.h.in \
105 linux/aarch64/ioctlent1.h \
106 linux/aarch64/signalent1.h \
107 linux/aarch64/syscallent.h \
108 linux/aarch64/syscallent1.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000109 linux/alpha/errnoent.h \
110 linux/alpha/ioctlent.h.in \
111 linux/alpha/signalent.h \
112 linux/alpha/syscallent.h \
Vineet Gupta7daacbb2013-08-16 12:47:06 +0530113 linux/arc/ioctlent.h.in \
114 linux/arc/syscallent.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000115 linux/arm/ioctlent.h.in \
116 linux/arm/syscallent.h \
117 linux/avr32/ioctlent.h.in \
118 linux/avr32/syscallent.h \
119 linux/bfin/ioctlent.h.in \
120 linux/bfin/syscallent.h \
121 linux/dummy.h \
122 linux/errnoent.h \
Dmitry V. Levin99db95d2014-02-05 04:13:18 +0000123 linux/fanotify.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000124 linux/hppa/errnoent.h \
125 linux/hppa/ioctlent.h.in \
126 linux/hppa/signalent.h \
127 linux/hppa/syscallent.h \
128 linux/i386/ioctlent.h.in \
129 linux/i386/syscallent.h \
130 linux/ia64/ioctlent.h.in \
131 linux/ia64/signalent.h \
132 linux/ia64/syscallent.h \
Dmitry V. Levin2f6510c2014-08-21 03:17:48 +0000133 linux/inet_diag.h \
Dmitry V. Levin2f332e92014-02-05 15:43:04 +0000134 linux/inotify.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000135 linux/ioctlent.h.in \
136 linux/ioctlent.sh \
Dmitry V. Levin90aa9f42014-02-05 13:48:26 +0000137 linux/kexec.h \
Dmitry V. Levin3acf4032014-02-05 22:41:45 +0000138 linux/keyctl.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000139 linux/m68k/ioctlent.h.in \
140 linux/m68k/syscallent.h \
Dmitry V. Levin0db34e72013-06-02 18:12:44 +0000141 linux/metag/ioctlent.h.in \
142 linux/metag/syscallent.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000143 linux/microblaze/ioctlent.h.in \
144 linux/microblaze/syscallent.h \
145 linux/mips/errnoent.h \
146 linux/mips/ioctlent.h.in \
147 linux/mips/ioctlent.sh \
148 linux/mips/signalent.h \
Dmitry V. Levin34c445b2013-05-07 02:46:46 +0000149 linux/mips/syscallent-compat.h \
150 linux/mips/syscallent-n32.h \
151 linux/mips/syscallent-n64.h \
152 linux/mips/syscallent-o32.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000153 linux/mips/syscallent.h \
154 linux/mtd-abi.h \
Dmitry V. Levin0db34e72013-06-02 18:12:44 +0000155 linux/or1k/ioctlent.h.in \
156 linux/or1k/syscallent.h \
Dmitry V. Levin2a32eaa2014-02-05 02:09:49 +0000157 linux/personality.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000158 linux/powerpc/errnoent1.h \
159 linux/powerpc/ioctlent.h.in \
160 linux/powerpc/ioctlent1.h \
161 linux/powerpc/signalent1.h \
162 linux/powerpc/syscallent.h \
163 linux/powerpc/syscallent1.h \
Stefan Sørensenb88a6f82014-01-31 12:01:01 +0100164 linux/ptp_clock.h \
Dmitry V. Levin9aaf88c2014-02-05 14:51:19 +0000165 linux/reboot.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000166 linux/s390/ioctlent.h.in \
167 linux/s390/syscallent.h \
168 linux/s390x/ioctlent.h.in \
169 linux/s390x/syscallent.h \
170 linux/sh/ioctlent.h.in \
171 linux/sh/syscallent.h \
172 linux/sh64/ioctlent.h.in \
173 linux/sh64/syscallent.h \
174 linux/signalent.h \
Dmitry V. Levin2f6510c2014-08-21 03:17:48 +0000175 linux/sock_diag.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000176 linux/sparc/dummy2.h \
177 linux/sparc/errnoent.h \
178 linux/sparc/errnoent1.h \
179 linux/sparc/gen.pl \
180 linux/sparc/ioctlent.h.in \
181 linux/sparc/ioctlent1.h \
182 linux/sparc/signalent.h \
183 linux/sparc/signalent1.h \
184 linux/sparc/syscall1.h \
185 linux/sparc/syscallent.h \
186 linux/sparc/syscallent1.h \
187 linux/sparc64/dummy2.h \
188 linux/sparc64/errnoent.h \
189 linux/sparc64/errnoent1.h \
190 linux/sparc64/errnoent2.h \
191 linux/sparc64/ioctlent.h.in \
192 linux/sparc64/ioctlent1.h \
193 linux/sparc64/ioctlent2.h \
194 linux/sparc64/signalent.h \
195 linux/sparc64/signalent1.h \
196 linux/sparc64/signalent2.h \
197 linux/sparc64/syscall1.h \
198 linux/sparc64/syscallent.h \
199 linux/sparc64/syscallent1.h \
200 linux/sparc64/syscallent2.h \
Dmitry V. Levinde462cf2013-05-07 18:38:01 +0400201 linux/subcall.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000202 linux/syscall.h \
Dmitry V. Levin0db34e72013-06-02 18:12:44 +0000203 linux/tile/errnoent1.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000204 linux/tile/ioctlent.h.in \
Dmitry V. Levin0db34e72013-06-02 18:12:44 +0000205 linux/tile/ioctlent1.h \
206 linux/tile/signalent1.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000207 linux/tile/syscallent.h \
Dmitry V. Levin0db34e72013-06-02 18:12:44 +0000208 linux/tile/syscallent1.h \
Dmitry V. Levin8e0b8be2013-06-02 18:09:44 +0000209 linux/ubi-user.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000210 linux/x32/errnoent.h \
211 linux/x32/errnoent1.h \
212 linux/x32/ioctlent.h.in \
213 linux/x32/ioctlent1.h \
214 linux/x32/signalent.h \
215 linux/x32/signalent1.h \
216 linux/x32/syscallent.h \
217 linux/x32/syscallent1.h \
218 linux/x86_64/errnoent1.h \
219 linux/x86_64/errnoent2.h \
220 linux/x86_64/gentab.pl \
221 linux/x86_64/ioctlent.h.in \
222 linux/x86_64/ioctlent1.h \
223 linux/x86_64/ioctlent2.h \
224 linux/x86_64/signalent1.h \
225 linux/x86_64/signalent2.h \
226 linux/x86_64/syscallent.h \
227 linux/x86_64/syscallent1.h \
228 linux/x86_64/syscallent2.h \
Dmitry V. Levin0db34e72013-06-02 18:12:44 +0000229 linux/xtensa/ioctlent.h.in \
230 linux/xtensa/syscallent.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000231 signalent.sh \
232 strace-graph \
233 strace-log-merge \
234 strace.spec \
235 syscallent.sh \
Mike Frysinger761ed9b2014-02-16 01:59:20 -0500236 $(XLAT_INPUT_FILES) \
237 $(XLAT_HEADER_FILES) \
238 xlat/gen.sh \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000239 xlate.el
Roland McGrathbc44e402004-07-12 05:45:08 +0000240
Roland McGrath2b832df2009-10-06 17:46:56 -0700241.PHONY: srpm
Dmitry V. Levin525a39a2011-02-27 14:05:58 +0000242srpm: dist-xz
243 rpmbuild --define '%_srcrpmdir .' -ts $(distdir).tar.xz
Roland McGrath2b832df2009-10-06 17:46:56 -0700244
Dmitry V. Levindce75932013-04-30 23:52:12 +0000245BUILT_SOURCES = .version
246
247$(srcdir)/.version:
248 $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
249
250dist-hook:
251 $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
252
253today = $(shell date +%Y-%m-%d)
254version_regexp = $(subst .,\.,$(VERSION))
255news_check_regexp = 'Noteworthy changes in release $(version_regexp) ($(today))'
256
257news-check: NEWS
258 $(AM_V_GEN)if head -1 $< | \
259 grep -x $(news_check_regexp) >/dev/null; then \
260 :; \
261 else \
262 echo >&2 '$<: check failed'; \
263 exit 1; \
264 fi
Mike Frysinger9004e122011-02-20 23:24:22 -0500265
Dmitry V. Levin00119f62014-11-04 01:40:42 +0000266ioctlent_h = $(builddir)/$(OS)/ioctlent.h
267BUILT_SOURCES += $(ioctlent_h)
268CLEANFILES = $(ioctlent_h)
269ioctlent_h_deps = $(srcdir)/$(OS)/ioctlent.h.in $(srcdir)/$(OS)/$(ARCH)/ioctlent.h.in
270$(ioctlent_h): $(top_builddir)/config.status $(ioctlent_h_deps)
271 $(MKDIR_P) $(builddir)/$(OS)
272 cat $(ioctlent_h_deps) | \
273 $(COMPILE) -E -P - | \
274 sed 's/^\([[:space:]]*{\)"[^"]\+",[[:space:]]*/\1/' | \
275 LC_ALL=C sort -u -k2,2 -k1,1 > $@
276
Roland McGrathbc44e402004-07-12 05:45:08 +0000277if MAINTAINER_MODE
Roland McGratha478d742009-10-06 17:41:02 -0700278
279gen_changelog_start_date = 2009-07-08 20:00
Dmitry V. Levindce75932013-04-30 23:52:12 +0000280$(srcdir)/ChangeLog: $(srcdir)/gitlog-to-changelog $(srcdir)/Makefile.in \
281 $(srcdir)/.version
Roland McGratha478d742009-10-06 17:41:02 -0700282 @rm -f $@.new
Dmitry V. Levindce75932013-04-30 23:52:12 +0000283 (cd $(srcdir); \
Dmitry V. Levin594399d2011-11-05 13:32:27 +0000284 ./gitlog-to-changelog --append-dot \
285 --since='$(gen_changelog_start_date)'; \
Roland McGratha478d742009-10-06 17:41:02 -0700286 echo; echo; echo 'See ChangeLog-CVS for older changes.' \
287 ) > $@.new
288 chmod 444 $@.new
289 mv -f $@.new $@
290
Dmitry V. Levindce75932013-04-30 23:52:12 +0000291$(srcdir)/CREDITS: $(srcdir)/CREDITS.in $(srcdir)/.mailmap \
292 $(srcdir)/Makefile.in $(srcdir)/.version
Dmitry V. Levin59138a22011-02-24 01:51:15 +0000293 $(AM_V_GEN) \
Mike Frysinger67c4d432014-08-14 04:05:37 -0400294 ( \
Dmitry V. Levindce75932013-04-30 23:52:12 +0000295 cd $(srcdir); \
Dmitry V. Levin59138a22011-02-24 01:51:15 +0000296 sed '/^##/,$$d' CREDITS.in; \
297 { sed -n '1,/^##>/d; s/ \+/\t/; s/^./&/p' CREDITS.in; \
298 git log --pretty=format:'%aN %aE'; \
299 } | LC_ALL=C sort -u \
300 | awk -F'\t' '{printf("\t%s <%s>\n",$$1,$$2)}'; \
Mike Frysinger67c4d432014-08-14 04:05:37 -0400301 ) > $@-t && mv $@-t $@
Dmitry V. Levin59138a22011-02-24 01:51:15 +0000302
Dmitry V. Levin76ac37d2009-10-09 22:10:09 +0000303export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner --mode=go-w,go+rX
304
Lubomir Rintel544a8102014-10-16 12:05:43 +0200305INCLUDEDIR = /usr/include
306KERNEL_RELEASE = $(shell uname -r)
307# Candidates for the kernel headers tree.
308KERNEL_INCLUDE = \
309 /lib/modules/$(KERNEL_RELEASE)/build/include \
310 /usr/src/linux-$(KERNEL_RELEASE)/include \
311 $(INCLUDEDIR)
312IOCTLDIR = $(shell find $(KERNEL_INCLUDE) -maxdepth 0 -type d -print -quit 2>/dev/null)
313IOCTLASM = $(INCLUDEDIR)/asm
Roland McGrathbc44e402004-07-12 05:45:08 +0000314
Dmitry V. Levin00119f62014-11-04 01:40:42 +0000315noinst_PROGRAMS = ioctlsort
316ioctlsort_SOURCES = ioctlsort.c
317nodist_ioctlsort_SOURCES = ioctls.h ioctldefs.h
318CLEANFILES += $(nodist_ioctlsort_SOURCES)
319ioctlsort.$(OBJEXT): $(nodist_ioctlsort_SOURCES)
Roland McGrathbc44e402004-07-12 05:45:08 +0000320ioctls.h: $(srcdir)/linux/ioctlent.sh
Roland McGrathadc2b302004-07-12 06:11:03 +0000321 $(SHELL) $< $(IOCTLDIR) $(IOCTLASM)
Roland McGrathbc44e402004-07-12 05:45:08 +0000322ioctldefs.h: ioctls.h ;
323
Dmitry V. Levin00119f62014-11-04 01:40:42 +0000324ioctlent_h_in = linux/ioctlent.h.in
325BUILT_SOURCES += $(ioctlent_h_in)
326$(srcdir)/$(ioctlent_h_in): ioctlsort
327 $(<D)/$(<F) > $@
Mike Frysinger9004e122011-02-20 23:24:22 -0500328
Dmitry V. Levin00119f62014-11-04 01:40:42 +0000329endif