1 ## Process this file with automake to create Makefile.in
3 ## Copyright (C) 2002-2012 Red Hat, Inc.
4 ## This file is part of elfutils.
6 ## This file is free software; you can redistribute it and/or modify
7 ## it under the terms of either
9 ## * 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
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
19 ## or both in parallel, as here.
21 ## elfutils is distributed in the hope that it will be useful, but
22 ## 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.
26 ## 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/>.
30 include $(top_srcdir)/config/eu.am
31 INCLUDES += -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
32 -I$(srcdir)/../libdw -I$(srcdir)/../libasm
33 AM_CFLAGS += -fpic -fdollars-in-identifiers
34 LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) -P$(<F:lex.l=)
35 LEX_OUTPUT_ROOT = lex.$(<F:lex.l=)
36 AM_YFLAGS = -p$(<F:parse.y=)
38 noinst_LIBRARIES = libcpu_i386.a libcpu_x86_64.a
40 libcpu_i386_a_SOURCES = i386_disasm.c i386_dis.h
41 libcpu_x86_64_a_SOURCES = x86_64_disasm.c x86_64_dis.h
43 i386_gendis_SOURCES = i386_gendis.c i386_lex.l i386_parse.y
45 i386_disasm.o: i386.mnemonics $(srcdir)/i386_dis.h
46 x86_64_disasm.o: x86_64.mnemonics $(srcdir)/x86_64_dis.h
48 %_defs: $(srcdir)/defs/i386
49 m4 -D$* -DDISASSEMBLER $< > $@
52 noinst_HEADERS = memory-access.h i386_parse.h i386_data.h
54 noinst_PROGRAMS = i386_gendis
56 $(srcdir)/%_dis.h: %_defs i386_gendis
62 @echo '*** missing $@; configure with --enable-maintainer-mode'
68 sed '1,/^%%/d;/^#/d;/^[[:space:]]*$$/d;s/[^:]*:\([^[:space:]]*\).*/MNE(\1)/;s/{[^}]*}//g;/INVALID/d' \
71 i386_lex_no_Werror = yes
73 libeu = ../lib/libeu.a
75 i386_lex_CFLAGS = -Wno-unused-label -Wno-unused-function -Wno-sign-compare
76 i386_parse.o: i386_parse.c i386.mnemonics
77 i386_parse_CFLAGS = -DNMNES="`wc -l < i386.mnemonics`"
78 i386_lex.o: i386_parse.h
79 i386_gendis_LDADD = $(libeu) -lm $(libmudflap)
81 i386_parse.h: i386_parse.c ;
83 EXTRA_DIST = defs/i386
85 CLEANFILES += $(foreach P,i386 x86_64,$P_defs $P.mnemonics)
86 MAINTAINERCLEANFILES = $(foreach P,i386 x86_64, $P_dis.h)