blob: 3beccf349c52e3755461d41c83ae59c58adb7d64 [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
33AM_CFLAGS += -fpic -fdollars-in-identifiers
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000034LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) -P$(<F:lex.l=)
35LEX_OUTPUT_ROOT = lex.$(<F:lex.l=)
36AM_YFLAGS = -p$(<F:parse.y=)
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000037
Ulrich Drepperff993222008-01-09 05:39:28 +000038noinst_LIBRARIES = libcpu_i386.a libcpu_x86_64.a
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000039
Roland McGratha9cefae2011-10-16 09:23:00 -070040libcpu_i386_a_SOURCES = i386_disasm.c i386_dis.h
41libcpu_x86_64_a_SOURCES = x86_64_disasm.c x86_64_dis.h
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000042
43i386_gendis_SOURCES = i386_gendis.c i386_lex.l i386_parse.y
44
Roland McGratha9cefae2011-10-16 09:23:00 -070045i386_disasm.o: i386.mnemonics $(srcdir)/i386_dis.h
46x86_64_disasm.o: x86_64.mnemonics $(srcdir)/x86_64_dis.h
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000047
Roland McGrath10eb76b2010-08-16 22:48:48 -070048%_defs: $(srcdir)/defs/i386
Roland McGrath960a6af2012-10-10 09:31:42 -070049 m4 -D$* -DDISASSEMBLER $< > $@T
50 mv -f $@T $@
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000051
Roland McGratha9cefae2011-10-16 09:23:00 -070052if MAINTAINER_MODE
53noinst_HEADERS = memory-access.h i386_parse.h i386_data.h
54
55noinst_PROGRAMS = i386_gendis
56
57$(srcdir)/%_dis.h: %_defs i386_gendis
Roland McGrath960a6af2012-10-10 09:31:42 -070058 ./i386_gendis $< > $@T
59 mv -f $@T $@
Roland McGrathb2589ff2012-06-26 18:09:10 -070060
61else
62
63$(srcdir)/%_dis.h:
64 @echo '*** missing $@; configure with --enable-maintainer-mode'
65 @false
66
Roland McGratha9cefae2011-10-16 09:23:00 -070067endif
Roland McGrath10eb76b2010-08-16 22:48:48 -070068
69%.mnemonics: %_defs
70 sed '1,/^%%/d;/^#/d;/^[[:space:]]*$$/d;s/[^:]*:\([^[:space:]]*\).*/MNE(\1)/;s/{[^}]*}//g;/INVALID/d' \
71 $< | sort -u > $@
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000072
Ulrich Drepperf231e272008-01-02 18:07:17 +000073i386_lex_no_Werror = yes
74
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000075libeu = ../lib/libeu.a
76
77i386_lex_CFLAGS = -Wno-unused-label -Wno-unused-function -Wno-sign-compare
Ulrich Drepperc911d5c2008-01-22 05:59:26 +000078i386_parse.o: i386_parse.c i386.mnemonics
Roland McGrath78df7962009-01-23 16:39:42 -080079i386_parse_CFLAGS = -DNMNES="`wc -l < i386.mnemonics`"
Ulrich Drepperc911d5c2008-01-22 05:59:26 +000080i386_lex.o: i386_parse.h
Mark Wielaard32324792014-04-13 17:39:57 +020081i386_gendis_LDADD = $(libeu) -lm
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000082
Ulrich Drepperc911d5c2008-01-22 05:59:26 +000083i386_parse.h: i386_parse.c ;
84
Ulrich Drepper93490002008-01-21 18:48:06 +000085EXTRA_DIST = defs/i386
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000086
Mark Wielaard5e56a1e2012-02-24 23:41:53 +010087CLEANFILES += $(foreach P,i386 x86_64,$P_defs $P.mnemonics)
88MAINTAINERCLEANFILES = $(foreach P,i386 x86_64, $P_dis.h)