1#########################################################################
2# Copyright (C) 2001-2021  The Bochs Project
3#
4# This library is free software; you can redistribute it and/or
5# modify it under the terms of the GNU Lesser General Public
6# License as published by the Free Software Foundation; either
7# version 2 of the License, or (at your option) any later version.
8#
9# This library is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12# Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public
15# License along with this library; if not, write to the Free Software
16# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
17#########################################################################
18
19@SUFFIX_LINE@
20
21srcdir = @srcdir@
22VPATH = @srcdir@
23top_builddir    = ..
24top_srcdir      = @top_srcdir@
25
26SHELL = @SHELL@
27
28@SET_MAKE@
29
30CC = @CC@
31CFLAGS = @CFLAGS@ @GUI_CFLAGS@ @CPPFLAGS@
32CXX = @CXX@
33CXXFLAGS = @CXXFLAGS@ @GUI_CXXFLAGS@ @CPPFLAGS@
34
35LDFLAGS = @LDFLAGS@
36LIBS = @LIBS@
37RANLIB = @RANLIB@
38
39# Definitely use flex.  Use flex version >= 2.5.4
40# Flex version 2.5.2 was reported not to work
41LEX    = flex
42YACC   = yacc
43
44
45# ===========================================================
46# end of configurable options
47# ===========================================================
48
49
50BX_OBJS = \
51  dbg_main.o \
52  dbg_breakpoints.o \
53  symbols.o \
54  linux.o \
55
56BX_PARSER_OBJS = \
57  parser.o \
58  lexer.o
59
60BX_INCLUDES = debug.h
61
62BX_INCDIRS = -I.. -I$(srcdir)/.. -I../@INSTRUMENT_DIR@ -I$(srcdir)/../@INSTRUMENT_DIR@ -I. -I$(srcdir)/.
63
64all: libdebug.a
65
66.@CPP_SUFFIX@.o:
67	$(CXX) @DASH@c $(BX_INCDIRS) $(CXXFLAGS) @CXXFP@$< @OFP@$@
68
69
70.c.o:
71	$(CC) @DASH@c $(BX_INCDIRS) $(CFLAGS) @CFP@$< @OFP@$@
72
73
74
75libdebug.a: $(BX_OBJS) $(BX_PARSER_OBJS)
76	@RMCOMMAND@ libdebug.a
77	@MAKELIB@ $(BX_OBJS) $(BX_PARSER_OBJS)
78	$(RANLIB) libdebug.a
79
80$(BX_OBJS): $(BX_INCLUDES)
81
82
83clean:
84	@RMCOMMAND@ *.o
85	@RMCOMMAND@ libdebug.a
86
87dist-clean: clean
88	@RMCOMMAND@ Makefile
89
90parse-clean:
91	@RMCOMMAND@ -f  lexer.c
92	@RMCOMMAND@ -f  parser.cc
93	@RMCOMMAND@ -f  parser.h
94
95dbg_main.o: debug.h
96
97@NO_FLEX_YACC@parser.cc: parser.y
98@NO_FLEX_YACC@	@/bin/rm -f y.tab.c parser.cc
99@NO_FLEX_YACC@	@/bin/rm -f y.tab.h parser.h
100@NO_FLEX_YACC@	$(YACC) -p bx -d $<
101@NO_FLEX_YACC@	@/bin/mv -f y.tab.c parser.cc
102@NO_FLEX_YACC@	@/bin/mv -f y.tab.h parser.h
103@NO_FLEX_YACC@	@sed -i s/extern\ YYSTYPE/extern\ \"C\"\ YYSTYPE/ parser.cc
104@NO_FLEX_YACC@	@echo '#endif  /* if BX_DEBUGGER */' >> parser.cc
105@NO_FLEX_YACC@	@echo '/* The #endif is appended by the makefile after running yacc. */' >> parser.cc
106
107@NO_FLEX_YACC@lexer.c: lexer.l
108@NO_FLEX_YACC@	$(LEX) -Pbx -t $< > lexer.c
109
110###########################################
111# dependencies generated by
112#  gcc -MM -I. -I.. -I../instrument/stubs *.c  *.cc | sed 's/\.cc/.@CPP_SUFFIX@/g'
113###########################################
114lexer.o: lexer.c debug.h ../config.h ../osdep.h ../cpu/decoder/decoder.h \
115 parser.h
116parser.o: parser.cc debug.h ../config.h ../osdep.h \
117 ../cpu/decoder/decoder.h
118dbg_breakpoints.o: dbg_breakpoints.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h \
119 ../bx_debug/debug.h ../config.h ../osdep.h ../cpu/decoder/decoder.h \
120 ../gui/paramtree.h ../logio.h \
121 ../instrument/stubs/instrument.h
122dbg_main.o: dbg_main.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h \
123 ../bx_debug/debug.h ../config.h ../osdep.h ../cpu/decoder/decoder.h \
124 ../gui/paramtree.h ../logio.h \
125 ../instrument/stubs/instrument.h ../param_names.h ../cpu/cpu.h \
126 ../cpu/decoder/decoder.h ../cpu/i387.h ../cpu/fpu/softfloat.h \
127 ../cpu/fpu/tag_w.h ../cpu/fpu/status_w.h ../cpu/fpu/control_w.h \
128 ../cpu/crregs.h ../cpu/descriptor.h ../cpu/decoder/instr.h \
129 ../cpu/lazy_flags.h ../cpu/tlb.h ../cpu/icache.h ../cpu/apic.h \
130 ../cpu/xmm.h ../cpu/vmx.h ../cpu/svm.h ../cpu/cpuid.h ../cpu/access.h \
131 ../cpu/decoder/ia_opcodes.h ../cpu/decoder/ia_opcodes.def \
132 ../iodev/iodev.h ../plugin.h ../extplugin.h ../pc_system.h \
133 ../memory/memory-bochs.h ../gui/siminterface.h ../gui/paramtree.h \
134 ../gui/gui.h
135linux.o: linux.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
136 ../config.h ../osdep.h ../cpu/decoder/decoder.h ../gui/paramtree.h \
137 ../logio.h ../instrument/stubs/instrument.h ../cpu/cpu.h \
138 ../cpu/decoder/decoder.h ../cpu/i387.h ../cpu/fpu/softfloat.h \
139 ../cpu/fpu/tag_w.h ../cpu/fpu/status_w.h ../cpu/fpu/control_w.h \
140 ../cpu/crregs.h ../cpu/descriptor.h ../cpu/decoder/instr.h \
141 ../cpu/lazy_flags.h ../cpu/tlb.h ../cpu/icache.h ../cpu/apic.h \
142 ../cpu/xmm.h ../cpu/vmx.h ../cpu/svm.h ../cpu/cpuid.h ../cpu/access.h \
143 syscalls-linux.h
144symbols.o: symbols.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h \
145 ../bx_debug/debug.h ../config.h ../osdep.h ../cpu/decoder/decoder.h \
146 ../gui/paramtree.h ../logio.h \
147 ../instrument/stubs/instrument.h ../cpu/cpu.h ../cpu/decoder/decoder.h \
148 ../cpu/i387.h ../cpu/fpu/softfloat.h ../cpu/fpu/tag_w.h \
149 ../cpu/fpu/status_w.h ../cpu/fpu/control_w.h ../cpu/crregs.h \
150 ../cpu/descriptor.h ../cpu/decoder/instr.h ../cpu/lazy_flags.h \
151 ../cpu/tlb.h ../cpu/icache.h ../cpu/apic.h ../cpu/xmm.h ../cpu/vmx.h \
152 ../cpu/svm.h ../cpu/cpuid.h ../cpu/access.h
153