Makefile.in 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860
  1. #
  2. # This file is part of the program psim.
  3. #
  4. # Copyright 1994, 1995, 1996, 1997, 2003 Andrew Cagney
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, see <http://www.gnu.org/licenses/>.
  18. #
  19. default: all
  20. VPATH = @srcdir@
  21. srcdir = @srcdir@
  22. srccom = $(srcdir)/../common
  23. srcroot = $(srcdir)/../..
  24. srcsim = $(srcdir)/..
  25. include $(srcroot)/gdb/silent-rules.mk
  26. # Helper code from gnulib.
  27. GNULIB_PARENT_DIR = ../..
  28. include $(GNULIB_PARENT_DIR)/gnulib/Makefile.gnulib.inc
  29. # Settings from top-level configure.
  30. include ../arch-subdir.mk
  31. prefix = @prefix@
  32. exec_prefix = @exec_prefix@
  33. bindir = @bindir@
  34. libdir = @libdir@
  35. tooldir = $(libdir)/$(target_alias)
  36. datarootdir = @datarootdir@
  37. datadir = @datadir@
  38. mandir = @mandir@
  39. man1dir = $(mandir)/man1
  40. man2dir = $(mandir)/man2
  41. man3dir = $(mandir)/man3
  42. man4dir = $(mandir)/man4
  43. man5dir = $(mandir)/man5
  44. man6dir = $(mandir)/man6
  45. man7dir = $(mandir)/man7
  46. man8dir = $(mandir)/man8
  47. man9dir = $(mandir)/man9
  48. infodir = @infodir@
  49. includedir = @includedir@
  50. # This can be referenced by the gettext configuration code.
  51. top_builddir = ..
  52. SHELL = /bin/sh
  53. BISON = bison
  54. MAKEINFO = makeinfo
  55. INLINE_CFLAGS = $(SIM_INLINE)
  56. SMP_CFLAGS = @sim_smp@
  57. XOR_ENDIAN_CFLAGS = @sim_xor_endian@
  58. BITSIZE_CFLAGS = @sim_bitsize@
  59. HOSTBITSIZE_CFLAGS = @sim_hostbitsize@
  60. TIMEBASE_CFLAGS = @sim_timebase@
  61. FLOAT_CFLAGS = @sim_float@
  62. MONITOR_CFLAGS = @sim_monitor@
  63. MODEL_CFLAGS = @sim_model@ @sim_default_model@ @sim_model_issue@
  64. TERMIO_CFLAGS = @sim_termio@
  65. DEVZERO_CFLAGS = @sim_devzero@
  66. CONFIG_CFLAGS = \
  67. $(SMP_CFLAGS) \
  68. $(XOR_ENDIAN_CFLAGS) \
  69. $(BITSIZE_CFLAGS) \
  70. $(HOSTBITSIZE_CFLAGS) \
  71. $(TIMEBASE_CFLAGS) \
  72. $(FLOAT_CFLAGS) \
  73. $(MONITOR_CFLAGS) \
  74. $(MODEL_CFLAGS) \
  75. $(TERMIO_CFLAGS) \
  76. $(DEVZERO_CFLAGS)
  77. SIM_FPU_CFLAGS = -DHAVE_COMMON_FPU -I../common -I${srcdir}/../common
  78. STD_CFLAGS = $(CFLAGS) $(WERROR_CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(INCGNU) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS)
  79. NOWARN_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(INCLUDES) $(SIM_FPU_CFLAGS)
  80. BUILD_CFLAGS = $(CFLAGS_FOR_BUILD) $(INCLUDES) $(WARN_CFLAGS)
  81. LIBS = $(COMMON_LIBS) @LIBS@ $(LIBGNU) $(LIBGNU_EXTRA_LIBS)
  82. COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS)
  83. LINK_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(LDFLAGS_FOR_BUILD) -o $@
  84. IGEN_OPCODE_RULES = @sim_opcode@
  85. IGEN_DECODE_MECHANISM = @sim_decode_mechanism@
  86. IGEN_DUPLICATE = @sim_dup@
  87. IGEN_JUMP = @sim_jump@
  88. IGEN_FILTER = @sim_filter@
  89. IGEN_ICACHE = @sim_icache@
  90. IGEN_SMP = @sim_igen_smp@
  91. IGEN_LINE_NR = @sim_line_nr@
  92. DGEN_FLAGS = @sim_switch@
  93. IGEN_FLAGS = \
  94. $(IGEN_DECODE_MECHANISM) \
  95. $(IGEN_DUPLICATE) \
  96. $(IGEN_JUMP) \
  97. $(IGEN_FILTER) \
  98. $(IGEN_ICACHE) \
  99. $(IGEN_SMP) \
  100. $(IGEN_LINE_NR)
  101. # igen/dgen leak memory, and therefore makes AddressSanitizer unhappy. Disable
  102. # leak detection while running them.
  103. IGEN = ASAN_OPTIONS=detect_leaks=0 ./igen
  104. DGEN = ASAN_OPTIONS=detect_leaks=0 ./dgen
  105. .NOEXPORT:
  106. MAKEOVERRIDES=
  107. LIB_INCLUDES = -I$(srcdir)/../../include
  108. BFD_INCLUDES = -I../../bfd -I$(srcdir)/../../bfd
  109. GDB_INCLUDES = -I../../gdb -I$(srcdir)/../../gdb -I$(srcdir)/../../gdb/config
  110. INCLUDES = -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) $(GDB_INCLUDES) -I../..
  111. LIBIBERTY_LIB = ../../libiberty/libiberty.a
  112. BFD_LIB = ../../bfd/libbfd.a
  113. ZLIB = $(zlibdir) -lz
  114. TARGETLIB = libsim.a
  115. all: run$(EXEEXT) $(TARGETLIB) $(GDB_OBJ)
  116. .c.o:
  117. $(ECHO_CC) $(CC) -c $(STD_CFLAGS) $<
  118. # Headers outside sim/ppc.
  119. ANSIDECL_H = $(srcroot)/include/ansidecl.h
  120. BFD_H = ../../bfd/bfd.h
  121. GDB_CALLBACK_H = $(srcroot)/include/sim/callback.h
  122. GDB_REMOTE_SIM_H = $(srcroot)/include/sim/sim.h
  123. GDB_SIM_PPC_H = $(srcroot)/include/gdb/sim-ppc.h
  124. COMMON_SIM_BASE_H = $(srcroot)/sim/common/sim-base.h
  125. COMMON_SIM_BASICS_H = $(srcroot)/sim/common/sim-basics.h
  126. COMMON_SIM_FPU_H = $(srcroot)/sim/common/sim-fpu.h
  127. COMMON_SIM_INLINE_H = $(srcroot)/sim/common/sim-inline.h
  128. COMMON_SIM_SIGNAL_H = $(srcroot)/sim/common/sim-signal.h
  129. # Headers in sim/ppc.
  130. ACCONFIG_H = \
  131. acconfig.h
  132. ALTIVEC_EXPRESSION_H = \
  133. altivec_expression.h
  134. ALTIVEC_REGISTERS_H = \
  135. altivec_registers.h
  136. BASICS_H = \
  137. basics.h \
  138. $(CONFIG_H) \
  139. $(INLINE_H) \
  140. $(SIM_CALLBACKS_H) \
  141. $(DEBUG_H) \
  142. $(WORDS_H) \
  143. $(BITS_H) \
  144. $(SIM_ENDIAN_H)
  145. BITS_H = \
  146. bits.h \
  147. bits.c
  148. CAP_H = \
  149. cap.h \
  150. $(BASICS_H)
  151. COREFILE_H = \
  152. corefile.h
  153. COREFILE_N_H = \
  154. corefile-n.h
  155. CPU_H = \
  156. cpu.h \
  157. $(BASICS_H) \
  158. $(REGISTERS_H) \
  159. $(DEVICE_H) \
  160. $(COREFILE_H) \
  161. $(VM_H) \
  162. $(EVENTS_H) \
  163. $(INTERRUPTS_H) \
  164. $(PSIM_H) \
  165. $(IDECODE_H) \
  166. $(ITABLE_H) \
  167. $(OS_EMUL_H) \
  168. $(MON_H) \
  169. $(MODEL_H) \
  170. cpu.c
  171. DEBUG_H = \
  172. debug.h \
  173. $(FILTER_FILENAME_H)
  174. DEVICE_H = \
  175. device.h
  176. DEVICE_TABLE_H = \
  177. device_table.h \
  178. $(BASICS_H) \
  179. $(DEVICE_H) \
  180. $(TREE_H) \
  181. $(HW_H)
  182. E500_EXPRESSION_H = \
  183. e500_expression.h
  184. E500_REGISTERS_H = \
  185. e500_registers.h
  186. EMUL_BUGAPI_H = \
  187. emul_bugapi.h
  188. EMUL_CHIRP_H = \
  189. emul_chirp.h
  190. EMUL_GENERIC_H = \
  191. emul_generic.h \
  192. $(CPU_H) \
  193. $(IDECODE_H) \
  194. $(OS_EMUL_H) \
  195. $(TREE_H) \
  196. $(BFD_H)
  197. EMUL_NETBSD_H = \
  198. emul_netbsd.h
  199. EMUL_UNIX_H = \
  200. emul_unix.h
  201. EVENTS_H = \
  202. events.h
  203. FILTER_FILENAME_H = \
  204. filter_filename.h
  205. FILTER_H = \
  206. filter.h
  207. GEN_ICACHE_H = \
  208. gen-icache.h
  209. GEN_IDECODE_H = \
  210. gen-idecode.h
  211. GEN_ITABLE_H = \
  212. gen-itable.h
  213. GEN_MODEL_H = \
  214. gen-model.h
  215. GEN_SEMANTICS_H = \
  216. gen-semantics.h
  217. GEN_SUPPORT_H = \
  218. gen-support.h
  219. HW_CPU_H = \
  220. hw_cpu.h
  221. HW_PHB_H = \
  222. hw_phb.h
  223. IDECODE_BRANCH_H = \
  224. idecode_branch.h
  225. IDECODE_EXPRESSION_H = \
  226. idecode_expression.h \
  227. $(ALTIVEC_EXPRESSION_H) \
  228. $(E500_EXPRESSION_H)
  229. IDECODE_FIELDS_H = \
  230. idecode_fields.h
  231. IGEN_H = \
  232. igen.h
  233. INLINE_H = \
  234. inline.h
  235. INTERRUPTS_H = \
  236. interrupts.h
  237. LD_CACHE_H = \
  238. ld-cache.h
  239. LD_DECODE_H = \
  240. ld-decode.h
  241. LD_INSN_H = \
  242. ld-insn.h
  243. LF_H = \
  244. lf.h
  245. MISC_H = \
  246. misc.h \
  247. $(CONFIG_H) \
  248. $(FILTER_FILENAME_H)
  249. MON_H = \
  250. mon.h \
  251. $(BASICS_H) \
  252. $(ITABLE_H)
  253. OPTIONS_H = \
  254. options.h
  255. OS_EMUL_H = \
  256. os_emul.h
  257. PSIM_H = \
  258. psim.h \
  259. $(BASICS_H)
  260. REGISTERS_H = \
  261. registers.h \
  262. $(E500_REGISTERS_H) \
  263. $(ALTIVEC_REGISTERS_H) \
  264. $(SPREG_H)
  265. SIM_CALLBACKS_H = \
  266. sim_callbacks.h
  267. SIM_ENDIAN_H = \
  268. sim-endian.h \
  269. sim-endian.c
  270. SIM_ENDIAN_N_H = \
  271. sim-endian-n.h
  272. SIM_MAIN_H = \
  273. sim-main.h \
  274. $(COMMON_SIM_BASICS_H) \
  275. $(COMMON_SIM_SIGNAL_H) \
  276. $(COMMON_SIM_BASE_H)
  277. STD_CONFIG_H = \
  278. std-config.h
  279. TABLE_H = \
  280. table.h
  281. TREE_H = \
  282. tree.h
  283. VM_H = \
  284. vm.h
  285. VM_N_H = \
  286. vm_n.h
  287. WORDS_H = \
  288. words.h
  289. # Generated headers.
  290. CONFIG_H = \
  291. config.h
  292. DEFINES_H = \
  293. defines.h
  294. HW_H = \
  295. hw.h
  296. ICACHE_H = \
  297. icache.h
  298. IDECODE_H = \
  299. idecode.h \
  300. $(IDECODE_EXPRESSION_H) \
  301. $(IDECODE_FIELDS_H) \
  302. $(IDECODE_BRANCH_H)
  303. ITABLE_H = \
  304. itable.h
  305. MODEL_H = \
  306. model.h
  307. PK_H = \
  308. pk.h
  309. SEMANTICS_H = \
  310. semantics.h
  311. SPREG_H = \
  312. spreg.h
  313. SUPPORT_H = \
  314. support.h \
  315. support.c
  316. INLINE = \
  317. inline.h \
  318. inline.c
  319. BUILT_SRC_WO_CONFIG = \
  320. icache.h icache.c \
  321. support.h support.c \
  322. idecode.h idecode.c \
  323. semantics.h semantics.c \
  324. itable.h itable.c \
  325. spreg.h spreg.c \
  326. model.h model.c \
  327. support.h support.c \
  328. pk.h \
  329. hw.h hw.c \
  330. filter_host.c
  331. BUILT_SRC = \
  332. $(BUILT_SRC_WO_CONFIG) \
  333. config.h
  334. LIB_INLINE_SRC = \
  335. psim.c \
  336. bits.c \
  337. debug.c \
  338. sim-endian.c \
  339. sim-endian.h \
  340. sim-endian-n.h \
  341. vm.c \
  342. vm_n.h \
  343. corefile.c \
  344. events.c \
  345. os_emul.c \
  346. registers.c \
  347. cpu.c \
  348. interrupts.c \
  349. device.c \
  350. tree.c \
  351. device_table.c \
  352. cap.c \
  353. mon.c \
  354. options.c
  355. LIB_SRC = \
  356. $(PACKAGE_SRC) \
  357. $(HW_SRC) \
  358. $(LIB_INLINE_SRC)
  359. MAIN_SRC = \
  360. main.c \
  361. gdb-sim.c \
  362. sim_calls.c
  363. COMMON_OBJS_NAMES = \
  364. callback.o \
  365. target-newlib-errno.o \
  366. target-newlib-open.o \
  367. target-newlib-signal.o \
  368. target-newlib-syscall.o \
  369. version.o
  370. COMMON_OBJS = $(COMMON_OBJS_NAMES:%=../common/common_libcommon_a-%)
  371. # NOTE: semantics, idecode and psim put last so smaller files are compiled
  372. # first
  373. LIB_OBJ = \
  374. debug.o \
  375. filter_filename.o \
  376. bits.o \
  377. sim-endian.o \
  378. os_emul.o \
  379. emul_generic.o \
  380. emul_bugapi.o \
  381. emul_chirp.o \
  382. emul_netbsd.o \
  383. emul_unix.o \
  384. registers.o \
  385. vm.o \
  386. corefile.o \
  387. model.o \
  388. spreg.o \
  389. cpu.o \
  390. interrupts.o \
  391. events.o \
  392. cap.o \
  393. device.o \
  394. tree.o \
  395. device_table.o \
  396. itable.o \
  397. mon.o \
  398. icache.o \
  399. semantics.o \
  400. idecode.o \
  401. support.o \
  402. sim-fpu.o \
  403. psim.o \
  404. $(COMMON_OBJS) \
  405. $(PACKAGE_OBJ) \
  406. $(HW_OBJ) \
  407. options.o
  408. GDB_OBJ = gdb-sim.o sim_calls.o
  409. HW_SRC = @sim_hw_src@
  410. HW_OBJ = @sim_hw_obj@
  411. PACKAGE_SRC = @sim_pk_src@
  412. PACKAGE_OBJ = @sim_pk_obj@
  413. psim$(EXEEXT): $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBINTL_DEP)
  414. $(ECHO_CCLD) $(CC) $(CFLAGS) $(LDFLAGS) -o psim$(EXEEXT) main.o $(TARGETLIB) $(BFD_LIB) $(ZLIB) $(LIBINTL) $(LIBIBERTY_LIB) $(LIBS)
  415. run$(EXEEXT): psim$(EXEEXT)
  416. $(SILENCE) rm -f $@
  417. $(ECHO_GEN) ln $< $@ 2>/dev/null || $(LN_S) $< $@ 2>/dev/null || cp -p $< $@
  418. $(TARGETLIB): tmp-igen tmp-dgen tmp-hw tmp-pk tmp-defines $(LIB_OBJ) $(GDB_OBJ)
  419. $(ECHO_AR) $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
  420. $(ECHO_RANLIB) $(RANLIB) $(TARGETLIB)
  421. psim.o: psim.c $(CPU_H) $(IDECODE_H) $(OPTIONS_H) $(TREE_H) $(BFD_H)
  422. bits.o: bits.c $(BASICS_H)
  423. debug.o: debug.c $(CONFIG_H) $(BASICS_H)
  424. filter_filename.o: filter_filename.c $(CONFIG_H) $(FILTER_FILENAME_H)
  425. sim-endian.o: sim-endian.c $(CONFIG_H) $(BASICS_H) $(SIM_ENDIAN_N_H)
  426. os_emul.o: os_emul.c $(CPU_H) $(IDECODE_H) $(OS_EMUL_H) $(EMUL_GENERIC_H) $(EMUL_NETBSD_H) $(EMUL_UNIX_H) $(EMUL_CHIRP_H) $(EMUL_BUGAPI_H)
  427. emul_generic.o: emul_generic.c $(EMUL_GENERIC_H)
  428. emul_bugapi.o: emul_bugapi.c $(EMUL_GENERIC_H) $(EMUL_BUGAPI_H)
  429. emul_chirp.o: emul_chirp.c $(EMUL_GENERIC_H) $(EMUL_CHIRP_H)
  430. emul_netbsd.o: emul_netbsd.c $(EMUL_GENERIC_H) $(EMUL_NETBSD_H)
  431. emul_unix.o: emul_unix.c $(EMUL_GENERIC_H) $(EMUL_UNIX_H)
  432. registers.o: registers.c $(BASICS_H) $(REGISTERS_H)
  433. cpu.o: cpu.c $(CPU_H) $(IDECODE_H)
  434. interrupts.o: interrupts.c $(CPU_H) $(IDECODE_H) $(OS_EMUL_H)
  435. # Given that inlines are turned on now, rebuild idecode whenever
  436. # anything changes.
  437. idecode.o: idecode.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(LIB_INLINE_SRC) $(BUILT_SRC)
  438. # double.o: double.c dp-bit.c
  439. vm.o: vm.c $(BASICS_H) $(REGISTERS_H) $(DEVICE_H) $(COREFILE_H) $(VM_H) $(INTERRUPTS_H) $(MON_H) $(CPU_H) $(VM_N_H)
  440. corefile.o: corefile.c $(BASICS_H) $(DEVICE_TABLE_H) $(COREFILE_H) $(COREFILE_N_H)
  441. model.o: model.c $(CPU_H) $(MON_H)
  442. events.o: events.c $(BASICS_H) $(EVENTS_H)
  443. sim_calls.o: sim_calls.c $(PSIM_H) $(OPTIONS_H) $(DEFS_H) $(BFD_H) $(GDB_CALLBACK_H) $(GDB_REMOTE_SIM_H)
  444. gdb-sim.o: gdb-sim.c $(PSIM_H) $(OPTIONS_H) $(REGISTERS_H) $(GDB_REMOTE_SIM_H) $(GDB_SIM_PPC_H) $(SIM_CALLBACK_H)
  445. spreg.o: spreg.c $(BASICS_H) $(SPREG_H)
  446. main.o: main.c $(PSIM_H) $(OPTIONS_H) $(DEVICE_H) $(EVENTS_H) $(BFD_H) $(GDB_CALLBACK_H) $(GDB_REMOTE_SIM_H)
  447. device.o: device.c $(DEVICE_TABLE_H) $(CAP_H) $(EVENTS_H) $(PSIM_H)
  448. tree.o: tree.c $(BASICS_H) $(DEVICE_H) $(TREE_H)
  449. device_table.o: device_table.c $(DEVICE_TABLE_H) hw.c
  450. cap.o: cap.c $(CAP_H)
  451. semantics.o: semantics.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(COMMON_SIM_INLINE_H) $(COMMON_SIM_FPU_H) $(SUPPORT_H)
  452. icache.o: icache.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(ICACHE_H) $(COMMON_SIM_INLINE_H) $(COMMON_SIM_FPU_H) $(SUPPORT_H)
  453. support.o: support.c $(CPU_H) $(IDECODE_H) $(COMMON_SIM_INLINE_H) $(COMMON_SIM_FPU_H) $(SUPPORT_H)
  454. itable.o: itable.c $(ITABLE_H)
  455. mon.o: mon.c $(BASICS_H) $(CPU_H) $(MON_H)
  456. sim-fpu.o: $(srcdir)/../common/sim-fpu.c $(CONFIG_H)
  457. $(ECHO_CC) $(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $(srcdir)/../common/sim-fpu.c
  458. # Rebuild options whenever something changes so the date/time is up to date.
  459. options.o: options.c $(CPU_H) $(OPTIONS_H) $(DEFINES_H) $(BASICS_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) config.status Makefile
  460. $(ECHO_CC) $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_opcode@"' '-DIGEN_FLAGS="$(IGEN_FLAGS)"' '-DDGEN_FLAGS="$(DGEN_FLAGS)"' $(srcdir)/options.c
  461. defines.h: tmp-defines; @true
  462. tmp-defines: config.h Makefile
  463. $(ECHO_GEN) sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < config.h > tmp-defines.h
  464. $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-defines.h defines.h
  465. $(SILENCE) touch $@
  466. #
  467. # Rules to create the built c source code files
  468. #
  469. tmp-dgen: dgen ppc-spr-table $(srcroot)/move-if-change
  470. $(ECHO_GEN) $(DGEN) $(DGEN_FLAGS) \
  471. -r $(srcdir)/ppc-spr-table \
  472. -n spreg.h -hp tmp-spreg.h \
  473. -n spreg.c -p tmp-spreg.c
  474. $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-spreg.h spreg.h
  475. $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-spreg.c spreg.c
  476. $(SILENCE) touch $@
  477. tmp-igen: igen $(srcdir)/ppc-instructions $(srcdir)/altivec.igen $(srcdir)/e500.igen $(IGEN_OPCODE_RULES) $(srcroot)/move-if-change tmp-ld-decode tmp-ld-cache tmp-ld-insn tmp-filter
  478. $(ECHO_GEN) $(IGEN) $(IGEN_FLAGS) \
  479. -o $(srcdir)/$(IGEN_OPCODE_RULES) \
  480. -I $(srcdir) -i $(srcdir)/ppc-instructions \
  481. -n icache.h -hc tmp-icache.h \
  482. -n icache.c -c tmp-icache.c \
  483. -n semantics.h -hs tmp-semantics.h \
  484. -n semantics.c -s tmp-semantics.c \
  485. -n idecode.h -hd tmp-idecode.h \
  486. -n idecode.c -d tmp-idecode.c \
  487. -n itable.h -ht tmp-itable.h \
  488. -n itable.c -t tmp-itable.c \
  489. -n model.h -hm tmp-model.h \
  490. -n model.c -m tmp-model.c \
  491. -n support.h -hf tmp-support.h \
  492. -n support.c -f tmp-support.c
  493. $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-icache.h icache.h
  494. $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-icache.c icache.c
  495. $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-idecode.h idecode.h
  496. $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-idecode.c idecode.c
  497. $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-semantics.h semantics.h
  498. $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-semantics.c semantics.c
  499. $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-itable.h itable.h
  500. $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-itable.c itable.c
  501. $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-model.h model.h
  502. $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-model.c model.c
  503. $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-support.h support.h
  504. $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-support.c support.c
  505. $(SILENCE) touch $@
  506. # NOTE: Some versions of make don't handle files created as side-effects
  507. # uncomment the below if that is the case.
  508. $(TARGETLIB): tmp-igen tmp-dgen
  509. itable.h itable.c icache.h icache.c idecode.h idecode.c semantics.h semantics.c model.h model.c support.h support.c: tmp-igen
  510. spreg.h spreg.c: tmp-dgen
  511. dgen: dgen.o table.o lf.o misc.o filter_host.o
  512. $(ECHO_CCLD) $(LINK_FOR_BUILD) dgen.o table.o lf.o misc.o filter_host.o
  513. igen: igen.o table.o lf.o misc.o filter_host.o ld-decode.o ld-cache.o filter.o ld-insn.o gen-model.o gen-itable.o gen-icache.o gen-semantics.o gen-idecode.o gen-support.o
  514. $(ECHO_CCLD) $(LINK_FOR_BUILD) igen.o table.o lf.o misc.o filter_host.o ld-decode.o ld-cache.o filter.o ld-insn.o gen-model.o gen-itable.o gen-icache.o gen-semantics.o gen-idecode.o gen-support.o
  515. filter_host.c: filter_filename.c
  516. $(ECHO_GEN) cat $(srcdir)/filter_filename.c > filter_host.c
  517. filter_host.o: filter_host.c $(CONFIG_H) $(FILTER_FILENAME_H)
  518. $(ECHO_CC) $(COMPILE_FOR_BUILD) -c filter_host.c
  519. table.o: table.c $(CONFIG_H) $(MISC_H) $(LF_H) $(TABLE_H)
  520. $(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/table.c
  521. lf.o: lf.c $(CONFIG_H) $(MISC_H) $(LF_H)
  522. $(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/lf.c
  523. filter.o: filter.c $(CONFIG_H) $(MISC_H) $(FILTER_H)
  524. $(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/filter.c
  525. tmp-filter: filter.c $(MISC_H) misc.o
  526. $(ECHO_CCLD) $(LINK_FOR_BUILD) -DMAIN $(srcdir)/filter.c misc.o
  527. ld-decode.o: ld-decode.c $(MISC_H) $(LF_H) $(TABLE_H) $(LD_DECODE_H)
  528. $(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/ld-decode.c
  529. tmp-ld-decode: ld-decode.c misc.o lf.o table.o filter_host.o
  530. $(ECHO_CCLD) $(LINK_FOR_BUILD) -DMAIN $(srcdir)/ld-decode.c misc.o lf.o table.o filter_host.o
  531. ld-cache.o: ld-cache.c $(MISC_H) $(LF_H) $(TABLE_H) $(LD_CACHE_H)
  532. $(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/ld-cache.c
  533. tmp-ld-cache: ld-cache.c misc.o lf.o table.o filter_host.o
  534. $(ECHO_CCLD) $(LINK_FOR_BUILD) -DMAIN $(srcdir)/ld-cache.c misc.o lf.o table.o filter_host.o
  535. ld-insn.o: ld-insn.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H)
  536. $(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/ld-insn.c
  537. tmp-ld-insn: ld-insn.c ld-cache.o misc.o lf.o table.o ld-decode.o filter_host.o filter.o
  538. $(ECHO_CCLD) $(LINK_FOR_BUILD) -DMAIN $(srcdir)/ld-insn.c ld-cache.o misc.o lf.o table.o ld-decode.o filter_host.o filter.o
  539. gen-model.o: gen-model.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_CACHE_H) $(LD_DECODE_H) $(LD_INSN_H) $(GEN_MODEL_H)
  540. $(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/gen-model.c
  541. gen-itable.o: gen-itable.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_CACHE_H) $(LD_DECODE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_ITABLE_H)
  542. $(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/gen-itable.c
  543. gen-icache.o: gen-icache.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_SEMANTICS_H) $(GEN_IDECODE_H) $(GEN_ICACHE_H)
  544. $(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/gen-icache.c
  545. gen-semantics.o: gen-semantics.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_SEMANTICS_H) $(GEN_ICACHE_H) $(GEN_IDECODE_H)
  546. $(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/gen-semantics.c
  547. gen-idecode.o: gen-idecode.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_IDECODE_H) $(GEN_ICACHE_H) $(GEN_SEMANTICS_H)
  548. $(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/gen-idecode.c
  549. gen-support.o: gen-support.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_SEMANTICS_H) $(GEN_SUPPORT_H)
  550. $(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/gen-support.c
  551. dgen.o: dgen.c $(CONFIG_H) $(MISC_H) $(LF_H) $(TABLE_H)
  552. $(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/dgen.c
  553. igen.o: igen.c $(MISC_H) $(LF_H) $(TABLE_H) $(CONFIG_H) $(FILTER_H) $(LD_CACHE_H) $(LD_DECODE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_MODEL_H) $(GEN_ICACHE_H) $(GEN_ITABLE_H) $(GEN_IDECODE_H) $(GEN_SEMANTICS_H) $(GEN_SUPPORT_H)
  554. $(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/igen.c
  555. misc.o: misc.c $(CONFIG_H) $(MISC_H)
  556. $(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/misc.c
  557. # real hardware
  558. hw.c hw.h: tmp-hw; @true
  559. tmp-hw: Makefile $(HW_SRC) $(srcroot)/move-if-change
  560. $(ECHO_GEN)# The first for loop is to remove duplicates.
  561. $(SILENCE) f=""; \
  562. for i in $(HW_SRC) ; do \
  563. case " $$f " in \
  564. *" $$i "*) ;; \
  565. *) f="$$f $$i" ;; \
  566. esac ; \
  567. done ; \
  568. for hw in $$f ; do echo $$hw ; done \
  569. | sed -e 's/^.*\(hw_.*\)\.c/\1/' \
  570. -e 's/^/extern const device_descriptor /' \
  571. -e 's/$$/_device_descriptor\[\];/' \
  572. > tmp-hw.h
  573. $(SILENCE) f=""; \
  574. for i in $(HW_SRC) ; do \
  575. case " $$f " in \
  576. *" $$i "*) ;; \
  577. *) f="$$f $$i" ;; \
  578. esac ; \
  579. done ; \
  580. for hw in $$f ; do echo $$hw ; done \
  581. | sed -e 's/^.*\(hw_.*\)\.c/\1/' \
  582. -e 's/^/ /' \
  583. -e 's/$$/_device_descriptor,/' \
  584. > tmp-hw.c
  585. $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-hw.h hw.h
  586. $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-hw.c hw.c
  587. $(SILENCE) touch $@
  588. hw_cpu.o: hw_cpu.c $(DEVICE_TABLE_H) $(HW_CPU_H) $(INTERRUPTS_H) $(CPU_H)
  589. hw_com.o: hw_com.c $(DEVICE_TABLE_H)
  590. hw_core.o: hw_core.c $(DEVICE_TABLE_H) $(COREFILE_H)
  591. hw_disk.o: hw_disk.c $(DEVICE_TABLE_H) $(PK_H)
  592. hw_eeprom.o: hw_eeprom.c $(DEVICE_TABLE_H)
  593. hw_glue.o: hw_glue.c $(DEVICE_TABLE_H)
  594. hw_htab.o: hw_htab.c $(DEVICE_TABLE_H) $(BFD_H)
  595. hw_ide.o: hw_ide.c $(DEVICE_TABLE_H)
  596. hw_init.o: hw_init.c $(DEVICE_TABLE_H) $(BFD_H) $(PSIM_H)
  597. hw_iobus.o: hw_iobus.c $(DEVICE_TABLE_H)
  598. hw_memory.o: hw_memory.c $(DEVICE_TABLE_H)
  599. hw_nvram.o: hw_nvram.c $(DEVICE_TABLE_H)
  600. hw_opic.o: hw_opic.c $(DEVICE_TABLE_H)
  601. hw_pal.o: hw_pal.c $(DEVICE_TABLE_H) $(CPU_H)
  602. hw_phb.o: hw_phb.c $(DEVICE_TABLE_H) $(HW_PHB_H) $(COREFILE_H)
  603. hw_register.o: hw_register.c $(DEVICE_TABLE_H) $(PSIM_H)
  604. hw_sem.o: hw_sem.c $(DEVICE_TABLE_H) $(PSIM_H)
  605. hw_shm.o: hw_shm.c $(DEVICE_TABLE_H) $(PSIM_H)
  606. hw_trace.o: hw_trace.c $(DEVICE_TABLE_H)
  607. hw_vm.o: hw_vm.c $(DEVICE_TABLE_H) $(CPU_H)
  608. # ignore this line, it stops make from getting confused
  609. # real packages
  610. pk.h: tmp-pk; @true
  611. tmp-pk: Makefile $(PACKAGE_SRC) $(srcroot)/move-if-change
  612. $(ECHO_GEN)# The first for loop is to remove duplicates.
  613. $(SILENCE) f=""; \
  614. for i in $(PACKAGE_SRC) ; do \
  615. case " $$f " in \
  616. *" $$i "*) ;; \
  617. *) f="$$f $$i" ;; \
  618. esac ; \
  619. done ; \
  620. for pk in $$f ; do echo $$pk ; done \
  621. | sed -e 's/^.*pk_\(.*\)\.c/\1/' \
  622. -e 's/^/extern package_create_instance_callback pk_/' \
  623. -e 's/$$/_create_instance;/' \
  624. > tmp-pk.h
  625. $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-pk.h pk.h
  626. $(SILENCE) touch $@
  627. pk_disklabel.o: pk_disklabel.c $(DEVICE_TABLE_H) $(PK_H)
  628. # ignore this line, it stops make from getting confused
  629. tags etags: TAGS
  630. TAGS: $(BUILT_SRC)
  631. etags $(srcdir)/*.h $(srcdir)/*.c $(BUILT_SRC)
  632. clean mostlyclean:
  633. rm -f tmp-* *.[oasi] core psim$(EXEEXT) run$(EXEEXT) igen dgen $(BUILT_SRC_WO_CONFIG)
  634. distclean realclean: clean
  635. rm -f TAGS Makefile config.cache config.status config.h defines.h stamp-h config.log
  636. maintainer-clean: distclean
  637. rm -f *~ *.log core *.core
  638. Makefile: Makefile.in config.status
  639. CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
  640. config.h: stamp-h ; @true
  641. stamp-h: config.in config.status
  642. CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
  643. config.status: configure
  644. $(SHELL) ./config.status --recheck
  645. check:
  646. html:
  647. clean-html:
  648. install-html:
  649. info:
  650. clean-info:
  651. install-info:
  652. pdf:
  653. clean-pdf:
  654. install-pdf:
  655. install: installdirs
  656. a=`basename "$$(pwd)"`; \
  657. n=`echo run | sed '$(program_transform_name)'`; \
  658. [ "$(SIM_PRIMARY_TARGET)" = "$$a" ] || n="$$n-$$a"; \
  659. $(INSTALL_PROGRAM) run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
  660. install-strip: installdirs
  661. a=`basename "$$(pwd)"`; \
  662. n=`echo run | sed '$(program_transform_name)'`; \
  663. [ "$(SIM_PRIMARY_TARGET)" = "$$a" ] || n="$$n-$$a"; \
  664. $(INSTALL_PROGRAM) run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
  665. $(STRIP) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
  666. installdirs:
  667. $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir)