blob: 43844ecfede636c031782b89f46b16dd03587a99 [file] [log] [blame]
Ulrich Drepperb08d5a82005-07-26 05:00:05 +00001## Process this file with automake to create Makefile.in
2##
Roland McGrathb2589ff2012-06-26 18:09:10 -07003## Copyright (C) 2002-2012 Red Hat, Inc.
Mark Wielaardde2ed972012-06-05 17:15:16 +02004## This file is part of elfutils.
Ulrich Drepperb08d5a82005-07-26 05:00:05 +00005##
Mark Wielaardde2ed972012-06-05 17:15:16 +02006## This file is free software; you can redistribute it and/or modify
7## it under the terms of either
Ulrich Drepperb08d5a82005-07-26 05:00:05 +00008##
Mark Wielaardde2ed972012-06-05 17:15:16 +02009## * the GNU Lesser General Public License as published by the Free
10## Software Foundation; either version 3 of the License, or (at
11## your option) any later version
12##
13## or
14##
15## * the GNU General Public License as published by the Free
16## Software Foundation; either version 2 of the License, or (at
17## your option) any later version
18##
19## or both in parallel, as here.
20##
21## elfutils is distributed in the hope that it will be useful, but
Ulrich Drepper361df7d2006-04-04 21:38:57 +000022## WITHOUT ANY WARRANTY; without even the implied warranty of
23## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24## General Public License for more details.
25##
Mark Wielaardde2ed972012-06-05 17:15:16 +020026## You should have received copies of the GNU General Public License and
27## the GNU Lesser General Public License along with this program. If
28## not, see <http://www.gnu.org/licenses/>.
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000029##
Roland McGrath22359e22010-02-15 15:57:03 -080030include $(top_srcdir)/config/eu.am
Mark Wielaardcdaaf212013-04-25 16:50:11 -040031AM_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
Roland McGrath22359e22010-02-15 15:57:03 -080032 -I$(srcdir)/../libdw -I$(srcdir)/../libasm
Omar Sandoval823ee0c2019-08-26 10:51:45 -070033if BUILD_STATIC
34AM_CFLAGS += $(fpic_CFLAGS)
35endif
36AM_CFLAGS += -fdollars-in-identifiers
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000037LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) -P$(<F:lex.l=)
38LEX_OUTPUT_ROOT = lex.$(<F:lex.l=)
39AM_YFLAGS = -p$(<F:parse.y=)
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000040
Omar Sandoval823ee0c2019-08-26 10:51:45 -070041noinst_LIBRARIES = libcpu.a libcpu_pic.a
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000042
Omar Sandoval823ee0c2019-08-26 10:51:45 -070043noinst_HEADERS = i386_dis.h x86_64_dis.h
44
Ulrich Drepperfcab4f62019-09-06 23:49:54 +020045libcpu_a_SOURCES = i386_disasm.c x86_64_disasm.c bpf_disasm.c riscv_disasm.c
Omar Sandoval823ee0c2019-08-26 10:51:45 -070046
47libcpu_pic_a_SOURCES =
48am_libcpu_pic_a_OBJECTS = $(libcpu_a_SOURCES:.c=.os)
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000049
50i386_gendis_SOURCES = i386_gendis.c i386_lex.l i386_parse.y
51
Roland McGratha9cefae2011-10-16 09:23:00 -070052i386_disasm.o: i386.mnemonics $(srcdir)/i386_dis.h
53x86_64_disasm.o: x86_64.mnemonics $(srcdir)/x86_64_dis.h
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000054
Roland McGrath10eb76b2010-08-16 22:48:48 -070055%_defs: $(srcdir)/defs/i386
Josh Stonedaee4712015-10-05 11:04:15 -070056 $(AM_V_GEN)m4 -D$* -DDISASSEMBLER $< > $@T
57 $(AM_V_at)mv -f $@T $@
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000058
Roland McGratha9cefae2011-10-16 09:23:00 -070059if MAINTAINER_MODE
Omar Sandoval823ee0c2019-08-26 10:51:45 -070060noinst_HEADERS += memory-access.h i386_parse.h i386_data.h
Roland McGratha9cefae2011-10-16 09:23:00 -070061
Ulf Hermann28149ca2017-04-20 17:02:42 +020062noinst_PROGRAMS = i386_gendis$(EXEEXT)
Roland McGratha9cefae2011-10-16 09:23:00 -070063
Ulf Hermann28149ca2017-04-20 17:02:42 +020064$(srcdir)/%_dis.h: %_defs i386_gendis$(EXEEXT)
65 $(AM_V_GEN)./i386_gendis$(EXEEXT) $< > $@T
Josh Stonedaee4712015-10-05 11:04:15 -070066 $(AM_V_at)mv -f $@T $@
Roland McGrathb2589ff2012-06-26 18:09:10 -070067
68else
69
70$(srcdir)/%_dis.h:
71 @echo '*** missing $@; configure with --enable-maintainer-mode'
72 @false
73
Roland McGratha9cefae2011-10-16 09:23:00 -070074endif
Roland McGrath10eb76b2010-08-16 22:48:48 -070075
76%.mnemonics: %_defs
Josh Stonedaee4712015-10-05 11:04:15 -070077 $(AM_V_GEN)sed '1,/^%%/d;/^#/d;/^[[:space:]]*$$/d;s/[^:]*:\([^[:space:]]*\).*/MNE(\1)/;s/{[^}]*}//g;/INVALID/d' \
Roland McGrath10eb76b2010-08-16 22:48:48 -070078 $< | sort -u > $@
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000079
Ulrich Drepperf231e272008-01-02 18:07:17 +000080i386_lex_no_Werror = yes
81
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000082libeu = ../lib/libeu.a
83
Omar Sandoval277c2c52019-12-11 16:23:28 -080084i386_lex_CFLAGS = -Wno-unused-label -Wno-unused-function -Wno-sign-compare \
85 -Wno-implicit-fallthrough
Ulrich Drepperc911d5c2008-01-22 05:59:26 +000086i386_parse.o: i386_parse.c i386.mnemonics
Roland McGrath78df7962009-01-23 16:39:42 -080087i386_parse_CFLAGS = -DNMNES="`wc -l < i386.mnemonics`"
Ulrich Drepperc911d5c2008-01-22 05:59:26 +000088i386_lex.o: i386_parse.h
Érico Rolim47516d42020-12-16 15:56:14 -030089i386_gendis_LDADD = $(libeu) -lm $(obstack_LIBS)
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000090
Ulrich Drepperc911d5c2008-01-22 05:59:26 +000091i386_parse.h: i386_parse.c ;
92
Omar Sandoval4fcb7ec2019-08-26 10:51:44 -070093bpf_disasm_CFLAGS = -Wno-format-nonliteral
94
Ulrich Drepper93490002008-01-21 18:48:06 +000095EXTRA_DIST = defs/i386
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000096
Omar Sandoval823ee0c2019-08-26 10:51:45 -070097MOSTLYCLEANFILES = $(am_libcpu_pic_a_OBJECTS)
Mark Wielaard5e56a1e2012-02-24 23:41:53 +010098CLEANFILES += $(foreach P,i386 x86_64,$P_defs $P.mnemonics)
99MAINTAINERCLEANFILES = $(foreach P,i386 x86_64, $P_dis.h)