• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## Process this file with automake to create Makefile.in
2##
3## Copyright (C) 2002-2012 Red Hat, Inc.
4## This file is part of elfutils.
5##
6## This file is free software; you can redistribute it and/or modify
7## it under the terms of either
8##
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
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
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.
25##
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/>.
29##
30include $(top_srcdir)/config/eu.am
31AM_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
32	    -I$(srcdir)/../libdw -I$(srcdir)/../libasm
33AM_CFLAGS += $(fpic_CFLAGS) -fdollars-in-identifiers
34LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) -P$(<F:lex.l=)
35LEX_OUTPUT_ROOT = lex.$(<F:lex.l=)
36AM_YFLAGS = -p$(<F:parse.y=)
37
38noinst_LIBRARIES = libcpu_i386.a libcpu_x86_64.a
39
40libcpu_i386_a_SOURCES = i386_disasm.c i386_dis.h
41libcpu_x86_64_a_SOURCES = x86_64_disasm.c x86_64_dis.h
42
43i386_gendis_SOURCES = i386_gendis.c i386_lex.l i386_parse.y
44
45i386_disasm.o: i386.mnemonics $(srcdir)/i386_dis.h
46x86_64_disasm.o: x86_64.mnemonics $(srcdir)/x86_64_dis.h
47
48noinst_LIBRARIES += libcpu_bpf.a
49libcpu_bpf_a_SOURCES = bpf_disasm.c
50libcpu_bpf_a_CFLAGS = $(AM_CFLAGS) -Wno-format-nonliteral
51
52%_defs: $(srcdir)/defs/i386
53	$(AM_V_GEN)m4 -D$* -DDISASSEMBLER $< > $@T
54	$(AM_V_at)mv -f $@T $@
55
56if MAINTAINER_MODE
57noinst_HEADERS = memory-access.h i386_parse.h i386_data.h
58
59noinst_PROGRAMS = i386_gendis$(EXEEXT)
60
61$(srcdir)/%_dis.h: %_defs i386_gendis$(EXEEXT)
62	$(AM_V_GEN)./i386_gendis$(EXEEXT) $< > $@T
63	$(AM_V_at)mv -f $@T $@
64
65else
66
67$(srcdir)/%_dis.h:
68	@echo '*** missing $@; configure with --enable-maintainer-mode'
69	@false
70
71endif
72
73%.mnemonics: %_defs
74	$(AM_V_GEN)sed '1,/^%%/d;/^#/d;/^[[:space:]]*$$/d;s/[^:]*:\([^[:space:]]*\).*/MNE(\1)/;s/{[^}]*}//g;/INVALID/d' \
75	  $< | sort -u > $@
76
77i386_lex_no_Werror = yes
78
79libeu = ../lib/libeu.a
80
81i386_lex_CFLAGS = -Wno-unused-label -Wno-unused-function -Wno-sign-compare
82i386_parse.o: i386_parse.c i386.mnemonics
83i386_parse_CFLAGS = -DNMNES="`wc -l < i386.mnemonics`"
84i386_lex.o: i386_parse.h
85i386_gendis_LDADD = $(libeu) -lm
86
87i386_parse.h: i386_parse.c ;
88
89EXTRA_DIST = defs/i386
90
91CLEANFILES += $(foreach P,i386 x86_64,$P_defs $P.mnemonics)
92MAINTAINERCLEANFILES = $(foreach P,i386 x86_64, $P_dis.h)
93