blob: 97266f056ab238264aaacffd4fb3bc8df7353fab [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 \
Dmitry V. Levin95edb8b2014-12-03 20:50:08 +000023 cacheflush.c \
Dmitry V. Levin5e7987b2014-12-03 20:30:15 +000024 capability.c \
Dmitry V. Levin9b2f6742014-12-06 03:53:16 +000025 chdir.c \
Dmitry V. Levinad5cf1e2014-12-06 03:53:16 +000026 chmod.c \
Dmitry V. Levin2b7a53b2014-12-06 03:53:16 +000027 chown.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000028 count.c \
29 desc.c \
Dmitry V. Levin2ed2cc72014-09-11 22:40:37 +000030 dirent.c \
Dmitry V. Levin63f28dd2014-12-06 03:53:16 +000031 fadvise.c \
Dmitry V. Levin2795a5f2014-12-06 03:53:16 +000032 fallocate.c \
Dmitry V. Levin99db95d2014-02-05 04:13:18 +000033 fanotify.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000034 file.c \
Dmitry V. Levina8364302014-12-06 03:53:16 +000035 getcwd.c \
Dmitry V. Levin2f332e92014-02-05 15:43:04 +000036 inotify.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000037 io.c \
38 ioctl.c \
Dmitry V. Levinfc4727d2014-02-05 17:27:43 +000039 ioprio.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000040 ipc.c \
Dmitry V. Levin90aa9f42014-02-05 13:48:26 +000041 kexec.c \
Dmitry V. Levin3acf4032014-02-05 22:41:45 +000042 keyctl.c \
Dmitry V. Levin99a05442014-04-10 14:10:17 +000043 ldt.c \
Dmitry V. Levin231b19f2014-12-06 03:53:16 +000044 link.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000045 loop.c \
46 mem.c \
Dmitry V. Levindb23b342014-12-06 03:53:16 +000047 mknod.c \
Dmitry V. Levin6da7ca32014-12-03 21:12:07 +000048 mount.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000049 mtd.c \
50 net.c \
Dmitry V. Levinf6eb0d62014-12-03 20:00:42 +000051 or1k_atomic.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000052 pathtrace.c \
Dmitry V. Levind28b6a02014-12-03 21:06:11 +000053 personality.c \
Dmitry V. Levin9514ac72014-12-06 03:53:16 +000054 printmode.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000055 process.c \
Stefan Sørensenb88a6f82014-01-31 12:01:01 +010056 ptp.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000057 quota.c \
Dmitry V. Levin46245b32014-12-06 03:53:16 +000058 readlink.c \
Dmitry V. Levin9aaf88c2014-02-05 14:51:19 +000059 reboot.c \
Dmitry V. Levin6d20a0b2014-12-06 03:53:16 +000060 renameat.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000061 resource.c \
62 scsi.c \
63 signal.c \
64 sock.c \
Dmitry V. Levin2f6510c2014-08-21 03:17:48 +000065 socketutils.c \
Dmitry V. Levine36c72c2014-12-03 20:56:36 +000066 sram_alloc.c \
Dmitry V. Levin9a0dd742014-09-22 00:17:42 +000067 statfs.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000068 strace.c \
69 stream.c \
Dmitry V. Levin85a364a2014-12-06 03:53:16 +000070 swapon.c \
Dmitry V. Levin710b3ae2014-12-06 03:53:16 +000071 sync_file_range.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000072 syscall.c \
Dmitry V. Levin172241b2014-12-03 20:20:52 +000073 sysctl.c \
Dmitry V. Levin57d45a22014-09-29 23:13:05 +000074 sysinfo.c \
Dmitry V. Levinb21e2fb2014-12-03 21:01:35 +000075 syslog.c \
Dmitry V. Levin600e33c2014-12-03 20:08:44 +000076 sysmips.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000077 term.c \
78 time.c \
Dmitry V. Levin69341822014-12-06 03:53:16 +000079 truncate.c \
Dmitry V. Levin542ca1e2014-12-03 21:09:26 +000080 umount.c \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000081 util.c \
Dmitry V. Levinfb470f32014-12-06 03:53:16 +000082 utime.c \
Dmitry V. Levin481e0672014-12-06 03:53:16 +000083 utimes.c \
Philippe De Muyter0cc96142014-11-03 21:27:40 +010084 v4l2.c \
Dmitry V. Levin769ffe92014-12-06 03:53:16 +000085 vsprintf.c \
86 xattr.c
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +000087
Luca Clementi327064b2013-07-23 00:11:35 -070088if USE_LIBUNWIND
89strace_SOURCES += unwind.c
90strace_CPPFLAGS = $(AM_CPPFLAGS) $(libunwind_CPPFLAGS)
91strace_LDFLAGS = $(libunwind_LDFLAGS)
92strace_LDADD = $(libunwind_LIBS)
93else
94strace_CPPFLAGS = $(AM_CPPFLAGS)
95endif
96
Roland McGrath2746edd2002-12-30 09:13:08 +000097noinst_HEADERS = defs.h
Denys Vlasenko76f61be2013-03-06 18:59:09 +010098# Enable this to get link map generated
99#strace_CFLAGS = $(AM_CFLAGS) -Wl,-Map=strace.mapfile
Roland McGrath6d2b3492002-12-30 00:51:30 +0000100
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000101EXTRA_DIST = \
102 $(man_MANS) \
Dmitry V. Levindce75932013-04-30 23:52:12 +0000103 .version \
Mike Frysinger6c191362013-05-15 16:33:09 -0400104 COPYING \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000105 CREDITS \
106 ChangeLog \
107 ChangeLog-CVS \
108 README-linux \
109 README-linux-ptrace \
110 debian/changelog \
111 debian/compat \
112 debian/control \
113 debian/copyright \
114 debian/rules \
115 debian/source/format \
116 debian/strace-udeb.install \
117 debian/strace.docs \
118 debian/strace.examples \
119 debian/strace.install \
120 debian/strace.manpages \
121 debian/strace64.install \
122 debian/strace64.manpages \
123 debian/watch \
124 errnoent.sh \
Dmitry V. Levin00119f62014-11-04 01:40:42 +0000125 ioctlsort.c \
Dmitry V. Levin0db34e72013-06-02 18:12:44 +0000126 linux/aarch64/errnoent1.h \
127 linux/aarch64/ioctlent.h.in \
128 linux/aarch64/ioctlent1.h \
129 linux/aarch64/signalent1.h \
130 linux/aarch64/syscallent.h \
131 linux/aarch64/syscallent1.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000132 linux/alpha/errnoent.h \
133 linux/alpha/ioctlent.h.in \
134 linux/alpha/signalent.h \
135 linux/alpha/syscallent.h \
Vineet Gupta7daacbb2013-08-16 12:47:06 +0530136 linux/arc/ioctlent.h.in \
137 linux/arc/syscallent.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000138 linux/arm/ioctlent.h.in \
139 linux/arm/syscallent.h \
140 linux/avr32/ioctlent.h.in \
141 linux/avr32/syscallent.h \
142 linux/bfin/ioctlent.h.in \
143 linux/bfin/syscallent.h \
144 linux/dummy.h \
145 linux/errnoent.h \
Dmitry V. Levin99db95d2014-02-05 04:13:18 +0000146 linux/fanotify.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000147 linux/hppa/errnoent.h \
148 linux/hppa/ioctlent.h.in \
149 linux/hppa/signalent.h \
150 linux/hppa/syscallent.h \
151 linux/i386/ioctlent.h.in \
152 linux/i386/syscallent.h \
153 linux/ia64/ioctlent.h.in \
154 linux/ia64/signalent.h \
155 linux/ia64/syscallent.h \
Dmitry V. Levin2f6510c2014-08-21 03:17:48 +0000156 linux/inet_diag.h \
Dmitry V. Levin2f332e92014-02-05 15:43:04 +0000157 linux/inotify.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000158 linux/ioctlent.h.in \
159 linux/ioctlent.sh \
Dmitry V. Levin90aa9f42014-02-05 13:48:26 +0000160 linux/kexec.h \
Dmitry V. Levin3acf4032014-02-05 22:41:45 +0000161 linux/keyctl.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000162 linux/m68k/ioctlent.h.in \
163 linux/m68k/syscallent.h \
Dmitry V. Levin0db34e72013-06-02 18:12:44 +0000164 linux/metag/ioctlent.h.in \
165 linux/metag/syscallent.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000166 linux/microblaze/ioctlent.h.in \
167 linux/microblaze/syscallent.h \
168 linux/mips/errnoent.h \
169 linux/mips/ioctlent.h.in \
170 linux/mips/ioctlent.sh \
171 linux/mips/signalent.h \
Dmitry V. Levin34c445b2013-05-07 02:46:46 +0000172 linux/mips/syscallent-compat.h \
173 linux/mips/syscallent-n32.h \
174 linux/mips/syscallent-n64.h \
175 linux/mips/syscallent-o32.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000176 linux/mips/syscallent.h \
177 linux/mtd-abi.h \
Dmitry V. Levin0db34e72013-06-02 18:12:44 +0000178 linux/or1k/ioctlent.h.in \
179 linux/or1k/syscallent.h \
Dmitry V. Levin2a32eaa2014-02-05 02:09:49 +0000180 linux/personality.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000181 linux/powerpc/errnoent1.h \
182 linux/powerpc/ioctlent.h.in \
183 linux/powerpc/ioctlent1.h \
184 linux/powerpc/signalent1.h \
185 linux/powerpc/syscallent.h \
186 linux/powerpc/syscallent1.h \
Stefan Sørensenb88a6f82014-01-31 12:01:01 +0100187 linux/ptp_clock.h \
Dmitry V. Levin9aaf88c2014-02-05 14:51:19 +0000188 linux/reboot.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000189 linux/s390/ioctlent.h.in \
190 linux/s390/syscallent.h \
191 linux/s390x/ioctlent.h.in \
192 linux/s390x/syscallent.h \
193 linux/sh/ioctlent.h.in \
194 linux/sh/syscallent.h \
195 linux/sh64/ioctlent.h.in \
196 linux/sh64/syscallent.h \
197 linux/signalent.h \
Dmitry V. Levin2f6510c2014-08-21 03:17:48 +0000198 linux/sock_diag.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000199 linux/sparc/dummy2.h \
200 linux/sparc/errnoent.h \
201 linux/sparc/errnoent1.h \
202 linux/sparc/gen.pl \
203 linux/sparc/ioctlent.h.in \
204 linux/sparc/ioctlent1.h \
205 linux/sparc/signalent.h \
206 linux/sparc/signalent1.h \
207 linux/sparc/syscall1.h \
208 linux/sparc/syscallent.h \
209 linux/sparc/syscallent1.h \
210 linux/sparc64/dummy2.h \
211 linux/sparc64/errnoent.h \
212 linux/sparc64/errnoent1.h \
213 linux/sparc64/errnoent2.h \
214 linux/sparc64/ioctlent.h.in \
215 linux/sparc64/ioctlent1.h \
216 linux/sparc64/ioctlent2.h \
217 linux/sparc64/signalent.h \
218 linux/sparc64/signalent1.h \
219 linux/sparc64/signalent2.h \
220 linux/sparc64/syscall1.h \
221 linux/sparc64/syscallent.h \
222 linux/sparc64/syscallent1.h \
223 linux/sparc64/syscallent2.h \
Dmitry V. Levinde462cf2013-05-07 18:38:01 +0400224 linux/subcall.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000225 linux/syscall.h \
Dmitry V. Levin0db34e72013-06-02 18:12:44 +0000226 linux/tile/errnoent1.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000227 linux/tile/ioctlent.h.in \
Dmitry V. Levin0db34e72013-06-02 18:12:44 +0000228 linux/tile/ioctlent1.h \
229 linux/tile/signalent1.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000230 linux/tile/syscallent.h \
Dmitry V. Levin0db34e72013-06-02 18:12:44 +0000231 linux/tile/syscallent1.h \
Dmitry V. Levin8e0b8be2013-06-02 18:09:44 +0000232 linux/ubi-user.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000233 linux/x32/errnoent.h \
234 linux/x32/errnoent1.h \
235 linux/x32/ioctlent.h.in \
236 linux/x32/ioctlent1.h \
237 linux/x32/signalent.h \
238 linux/x32/signalent1.h \
239 linux/x32/syscallent.h \
240 linux/x32/syscallent1.h \
241 linux/x86_64/errnoent1.h \
242 linux/x86_64/errnoent2.h \
243 linux/x86_64/gentab.pl \
244 linux/x86_64/ioctlent.h.in \
245 linux/x86_64/ioctlent1.h \
246 linux/x86_64/ioctlent2.h \
247 linux/x86_64/signalent1.h \
248 linux/x86_64/signalent2.h \
249 linux/x86_64/syscallent.h \
250 linux/x86_64/syscallent1.h \
251 linux/x86_64/syscallent2.h \
Dmitry V. Levin0db34e72013-06-02 18:12:44 +0000252 linux/xtensa/ioctlent.h.in \
253 linux/xtensa/syscallent.h \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000254 signalent.sh \
255 strace-graph \
256 strace-log-merge \
257 strace.spec \
258 syscallent.sh \
Mike Frysinger761ed9b2014-02-16 01:59:20 -0500259 $(XLAT_INPUT_FILES) \
260 $(XLAT_HEADER_FILES) \
261 xlat/gen.sh \
Dmitry V. Levin7ae73a92013-04-30 23:34:51 +0000262 xlate.el
Roland McGrathbc44e402004-07-12 05:45:08 +0000263
Roland McGrath2b832df2009-10-06 17:46:56 -0700264.PHONY: srpm
Dmitry V. Levin525a39a2011-02-27 14:05:58 +0000265srpm: dist-xz
266 rpmbuild --define '%_srcrpmdir .' -ts $(distdir).tar.xz
Roland McGrath2b832df2009-10-06 17:46:56 -0700267
Dmitry V. Levindce75932013-04-30 23:52:12 +0000268BUILT_SOURCES = .version
269
270$(srcdir)/.version:
271 $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
272
273dist-hook:
274 $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
275
276today = $(shell date +%Y-%m-%d)
277version_regexp = $(subst .,\.,$(VERSION))
278news_check_regexp = 'Noteworthy changes in release $(version_regexp) ($(today))'
279
280news-check: NEWS
281 $(AM_V_GEN)if head -1 $< | \
282 grep -x $(news_check_regexp) >/dev/null; then \
283 :; \
284 else \
285 echo >&2 '$<: check failed'; \
286 exit 1; \
287 fi
Mike Frysinger9004e122011-02-20 23:24:22 -0500288
Dmitry V. Levin00119f62014-11-04 01:40:42 +0000289ioctlent_h = $(builddir)/$(OS)/ioctlent.h
290BUILT_SOURCES += $(ioctlent_h)
291CLEANFILES = $(ioctlent_h)
292ioctlent_h_deps = $(srcdir)/$(OS)/ioctlent.h.in $(srcdir)/$(OS)/$(ARCH)/ioctlent.h.in
293$(ioctlent_h): $(top_builddir)/config.status $(ioctlent_h_deps)
294 $(MKDIR_P) $(builddir)/$(OS)
295 cat $(ioctlent_h_deps) | \
296 $(COMPILE) -E -P - | \
297 sed 's/^\([[:space:]]*{\)"[^"]\+",[[:space:]]*/\1/' | \
298 LC_ALL=C sort -u -k2,2 -k1,1 > $@
299
Roland McGrathbc44e402004-07-12 05:45:08 +0000300if MAINTAINER_MODE
Roland McGratha478d742009-10-06 17:41:02 -0700301
302gen_changelog_start_date = 2009-07-08 20:00
Dmitry V. Levindce75932013-04-30 23:52:12 +0000303$(srcdir)/ChangeLog: $(srcdir)/gitlog-to-changelog $(srcdir)/Makefile.in \
304 $(srcdir)/.version
Roland McGratha478d742009-10-06 17:41:02 -0700305 @rm -f $@.new
Dmitry V. Levindce75932013-04-30 23:52:12 +0000306 (cd $(srcdir); \
Dmitry V. Levin594399d2011-11-05 13:32:27 +0000307 ./gitlog-to-changelog --append-dot \
308 --since='$(gen_changelog_start_date)'; \
Roland McGratha478d742009-10-06 17:41:02 -0700309 echo; echo; echo 'See ChangeLog-CVS for older changes.' \
310 ) > $@.new
311 chmod 444 $@.new
312 mv -f $@.new $@
313
Dmitry V. Levindce75932013-04-30 23:52:12 +0000314$(srcdir)/CREDITS: $(srcdir)/CREDITS.in $(srcdir)/.mailmap \
315 $(srcdir)/Makefile.in $(srcdir)/.version
Dmitry V. Levin59138a22011-02-24 01:51:15 +0000316 $(AM_V_GEN) \
Mike Frysinger67c4d432014-08-14 04:05:37 -0400317 ( \
Dmitry V. Levindce75932013-04-30 23:52:12 +0000318 cd $(srcdir); \
Dmitry V. Levin59138a22011-02-24 01:51:15 +0000319 sed '/^##/,$$d' CREDITS.in; \
320 { sed -n '1,/^##>/d; s/ \+/\t/; s/^./&/p' CREDITS.in; \
321 git log --pretty=format:'%aN %aE'; \
322 } | LC_ALL=C sort -u \
323 | awk -F'\t' '{printf("\t%s <%s>\n",$$1,$$2)}'; \
Mike Frysinger67c4d432014-08-14 04:05:37 -0400324 ) > $@-t && mv $@-t $@
Dmitry V. Levin59138a22011-02-24 01:51:15 +0000325
Dmitry V. Levin76ac37d2009-10-09 22:10:09 +0000326export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner --mode=go-w,go+rX
327
Lubomir Rintel544a8102014-10-16 12:05:43 +0200328INCLUDEDIR = /usr/include
329KERNEL_RELEASE = $(shell uname -r)
330# Candidates for the kernel headers tree.
331KERNEL_INCLUDE = \
332 /lib/modules/$(KERNEL_RELEASE)/build/include \
333 /usr/src/linux-$(KERNEL_RELEASE)/include \
334 $(INCLUDEDIR)
335IOCTLDIR = $(shell find $(KERNEL_INCLUDE) -maxdepth 0 -type d -print -quit 2>/dev/null)
336IOCTLASM = $(INCLUDEDIR)/asm
Roland McGrathbc44e402004-07-12 05:45:08 +0000337
Dmitry V. Levin00119f62014-11-04 01:40:42 +0000338noinst_PROGRAMS = ioctlsort
339ioctlsort_SOURCES = ioctlsort.c
340nodist_ioctlsort_SOURCES = ioctls.h ioctldefs.h
341CLEANFILES += $(nodist_ioctlsort_SOURCES)
342ioctlsort.$(OBJEXT): $(nodist_ioctlsort_SOURCES)
Roland McGrathbc44e402004-07-12 05:45:08 +0000343ioctls.h: $(srcdir)/linux/ioctlent.sh
Roland McGrathadc2b302004-07-12 06:11:03 +0000344 $(SHELL) $< $(IOCTLDIR) $(IOCTLASM)
Roland McGrathbc44e402004-07-12 05:45:08 +0000345ioctldefs.h: ioctls.h ;
346
Dmitry V. Levin00119f62014-11-04 01:40:42 +0000347ioctlent_h_in = linux/ioctlent.h.in
348BUILT_SOURCES += $(ioctlent_h_in)
349$(srcdir)/$(ioctlent_h_in): ioctlsort
350 $(<D)/$(<F) > $@
Mike Frysinger9004e122011-02-20 23:24:22 -0500351
Dmitry V. Levin00119f62014-11-04 01:40:42 +0000352endif