Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Crash Makefile

By: a guest on Jan 29th, 2011  |  syntax: Make  |  size: 24.12 KB  |  views: 54  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Makefile for core analysis suite
  2. #
  3. # Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
  4. #       www.missioncriticallinux.com, info@missioncriticallinux.com
  5. #
  6. # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 David Anderson
  7. # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Red Hat, Inc. All rights reserved.
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation; either version 2 of the License, or
  12. # (at your option) any later version.
  13. #
  14. # This program is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. # GNU General Public License for more details.
  18. #
  19. # BitKeeper ID: @(#)Makefile 1.13
  20. #
  21.  
  22. PROGRAM=crash
  23.  
  24. #
  25. # Supported targets: X86 ALPHA PPC IA64 PPC64
  26. # TARGET will be configured automatically by configure
  27. #
  28. TARGET=X86
  29.  
  30. ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
  31. ifeq ($(ARCH), ppc64)
  32. CONF_FLAGS = -m64
  33. endif
  34.  
  35. ifeq ($(TARGET), ARM)
  36. ifeq ($(ARCH), i386)
  37. GDB_CONF_FLAGS = --target=arm-elf-linux
  38. endif
  39. ifeq ($(ARCH), x86_64)
  40. GDB_CONF_FLAGS = --target=arm-elf-linux CFLAGS=-m32
  41. endif
  42. endif
  43.  
  44. ifeq ($(TARGET), X86)
  45. ifeq ($(ARCH), x86_64)
  46. GDB_CONF_FLAGS = --target=i686-pc-linux-gnu CFLAGS=-m32
  47. endif
  48. endif
  49.  
  50. #
  51. # GDB, GDB_FILES, GDB_OFILES and GDB_PATCH_FILES will be configured automatically by configure
  52. #
  53. GDB=gdb-7.0
  54. GDB_FILES=${GDB_7.0_FILES}
  55. GDB_OFILES=${GDB_7.0_OFILES}
  56. GDB_PATCH_FILES=gdb-7.0.patch
  57.  
  58. #
  59. # Default installation directory
  60. #
  61. INSTALLDIR=${DESTDIR}/usr/bin
  62.  
  63. #
  64. # Install program location
  65. #
  66. INSTALL=$(shell which install)
  67.  
  68. #
  69. # The executable is dynamically linked by default.  To build a statically
  70. # linked version for X86, ALPHA or PPC, perform either of the following options:
  71. #
  72. # (1) Invoke make like so:  make LDFLAGS=-static
  73. # (2) Or uncomment the "LDFLAGS=-static" definition below:
  74.  
  75. #LDFLAGS=-static
  76.  
  77. # For IA64, perform either of the following options:
  78. #
  79. # (1) Uncomment "LDFLAGS=-static" above and then invoke make like so:
  80. #    make NAT_CLIBS="-lc -lresolv" GDBSERVER_LIBS="-lc -lresolv"
  81. # (2) Or invoke make like so:
  82. #    make LDFLAGS=-static NAT_CLIBS="-lc -lresolv" GDBSERVER_LIBS="-lc -lresolv"
  83.  
  84. GENERIC_HFILES=defs.h xen_hyper_defs.h
  85. MCORE_HFILES=va_server.h vas_crash.h
  86. REDHAT_HFILES=netdump.h diskdump.h xendump.h kvmdump.h qemu-load.h
  87. LKCD_DUMP_HFILES=lkcd_vmdump_v1.h lkcd_vmdump_v2_v3.h lkcd_dump_v5.h \
  88.         lkcd_dump_v7.h lkcd_dump_v8.h
  89. LKCD_OBSOLETE_HFILES=lkcd_fix_mem.h
  90. LKCD_TRACE_HFILES=lkcd_x86_trace.h
  91. IBM_HFILES=ibm_common.h
  92. UNWIND_HFILES=unwind.h unwind_i.h rse.h unwind_x86.h unwind_x86_64.h
  93.  
  94. CFILES=main.c tools.c global_data.c memory.c filesys.c help.c task.c \
  95.         kernel.c test.c gdb_interface.c configure.c net.c dev.c \
  96.         alpha.c x86.c ppc.c ia64.c s390.c s390x.c s390dbf.c ppc64.c x86_64.c \
  97.         arm.c \
  98.         extensions.c remote.c va_server.c va_server_v1.c symbols.c cmdline.c \
  99.         lkcd_common.c lkcd_v1.c lkcd_v2_v3.c lkcd_v5.c lkcd_v7.c lkcd_v8.c\
  100.         lkcd_fix_mem.c s390_dump.c lkcd_x86_trace.c \
  101.         netdump.c diskdump.c xendump.c unwind.c unwind_decoder.c \
  102.         unwind_x86_32_64.c unwind_arm.c \
  103.         xen_hyper.c xen_hyper_command.c xen_hyper_global_data.c \
  104.         xen_hyper_dump_tables.c kvmdump.c qemu.c qemu-load.c
  105. SOURCE_FILES=${CFILES} ${GENERIC_HFILES} ${MCORE_HFILES} \
  106.         ${REDHAT_CFILES} ${REDHAT_HFILES} ${UNWIND_HFILES} \
  107.         ${LKCD_DUMP_HFILES} ${LKCD_TRACE_HFILES} ${LKCD_OBSOLETE_HFILES}\
  108.         ${IBM_HFILES}
  109.  
  110. OBJECT_FILES=main.o tools.o global_data.o memory.o filesys.o help.o task.o \
  111.         build_data.o kernel.o test.o gdb_interface.o net.o dev.o \
  112.         alpha.o x86.o ppc.o ia64.o s390.o s390x.o s390dbf.o ppc64.o x86_64.o \
  113.         arm.o \
  114.         extensions.o remote.o va_server.o va_server_v1.o symbols.o cmdline.o \
  115.         lkcd_common.o lkcd_v1.o lkcd_v2_v3.o lkcd_v5.o lkcd_v7.o lkcd_v8.o \
  116.         lkcd_fix_mem.o s390_dump.o netdump.o diskdump.o xendump.o \
  117.         lkcd_x86_trace.o unwind_v1.o unwind_v2.o unwind_v3.o \
  118.         unwind_x86_32_64.o unwind_arm.o \
  119.         xen_hyper.o xen_hyper_command.o xen_hyper_global_data.o \
  120.         xen_hyper_dump_tables.o kvmdump.o qemu.o qemu-load.o
  121.  
  122. # These are the current set of crash extensions sources.  They are not built
  123. # by default unless the third command line of the "all:" stanza is uncommented.
  124. # Alternatively, they can be built by entering "make extensions" from this
  125. # directory.
  126.  
  127. EXTENSIONS=extensions
  128. EXTENSION_SOURCE_FILES=${EXTENSIONS}/Makefile ${EXTENSIONS}/echo.c ${EXTENSIONS}/dminfo.c \
  129.         ${EXTENSIONS}/snap.c ${EXTENSIONS}/snap.mk \
  130.         ${EXTENSIONS}/trace.c \
  131.         ${EXTENSIONS}/libsial/Makefile \
  132.         ${EXTENSIONS}/libsial/mkbaseop.c \
  133.         ${EXTENSIONS}/libsial/README \
  134.         ${EXTENSIONS}/libsial/README.sial \
  135.         ${EXTENSIONS}/libsial/sial_alloc.c \
  136.         ${EXTENSIONS}/libsial/sial_api.c \
  137.         ${EXTENSIONS}/libsial/sial_api.h \
  138.         ${EXTENSIONS}/libsial/sial_builtin.c \
  139.         ${EXTENSIONS}/libsial/sial_case.c \
  140.         ${EXTENSIONS}/libsial/sial_define.c \
  141.         ${EXTENSIONS}/libsial/sial_func.c \
  142.         ${EXTENSIONS}/libsial/sial.h \
  143.         ${EXTENSIONS}/libsial/sial_input.c \
  144.         ${EXTENSIONS}/libsial/sial.l \
  145.         ${EXTENSIONS}/libsial/sial-lsed \
  146.         ${EXTENSIONS}/libsial/sial_member.c \
  147.         ${EXTENSIONS}/libsial/sial_node.c \
  148.         ${EXTENSIONS}/libsial/sial_num.c \
  149.         ${EXTENSIONS}/libsial/sial_op.c \
  150.         ${EXTENSIONS}/libsial/sialpp.l \
  151.         ${EXTENSIONS}/libsial/sialpp-lsed \
  152.         ${EXTENSIONS}/libsial/sialpp.y \
  153.         ${EXTENSIONS}/libsial/sial_print.c \
  154.         ${EXTENSIONS}/libsial/sial_stat.c \
  155.         ${EXTENSIONS}/libsial/sial_str.c \
  156.         ${EXTENSIONS}/libsial/sial_type.c \
  157.         ${EXTENSIONS}/libsial/sial_util.c \
  158.         ${EXTENSIONS}/libsial/sial_var.c \
  159.         ${EXTENSIONS}/libsial/sial.y \
  160.         ${EXTENSIONS}/sial.c \
  161.         ${EXTENSIONS}/sial.mk
  162.  
  163. DAEMON_OBJECT_FILES=remote_daemon.o va_server.o va_server_v1.o \
  164.         lkcd_common.o lkcd_v1.o lkcd_v2_v3.o lkcd_v5.o lkcd_v7.o lkcd_v8.o \
  165.         s390_dump.o netdump_daemon.o
  166.  
  167. GDB_5.0_FILES=${GDB}/gdb/Makefile.in \
  168.           ${GDB}/gdb/main.c ${GDB}/gdb/symtab.c ${GDB}/gdb/target.c \
  169.           ${GDB}/gdb/blockframe.c ${GDB}/gdb/alpha-tdep.c \
  170.           ${GDB}/gdb/symfile.c ${GDB}/gdb/elfread.c \
  171.           ${GDB}/gdb/ui-file.c ${GDB}/gdb/utils.c ${GDB}/gdb/gnu-regex.c \
  172.           ${GDB}/gdb/ppc-linux-nat.c
  173. GDB_5.0_OFILES=${GDB}/gdb/main.o ${GDB}/gdb/symtab.o ${GDB}/gdb/target.o \
  174.           ${GDB}/gdb/blockframe.o ${GDB}/gdb/alpha-tdep.o \
  175.           ${GDB}/gdb/symfile.o ${GDB}/gdb/elfread.o \
  176.           ${GDB}/gdb/ui-file.o ${GDB}/gdb/utils.o ${GDB}/gdb/gnu-regex.o \
  177.           ${GDB}/gdb/ppc-linux-nat.o
  178.  
  179. GDB_5.1_FILES=${GDB}/gdb/Makefile.in \
  180.           ${GDB}/gdb/main.c ${GDB}/gdb/symtab.c ${GDB}/gdb/target.c \
  181.           ${GDB}/gdb/blockframe.c ${GDB}/gdb/alpha-tdep.c \
  182.           ${GDB}/gdb/symfile.c ${GDB}/gdb/elfread.c \
  183.           ${GDB}/gdb/ui-file.c ${GDB}/gdb/utils.c  ${GDB}/gdb/gnu-regex.c
  184. GDB_5.1_OFILES=${GDB}/gdb/main.o ${GDB}/gdb/symtab.o ${GDB}/gdb/target.o \
  185.           ${GDB}/gdb/blockframe.o ${GDB}/gdb/alpha-tdep.o \
  186.           ${GDB}/gdb/symfile.o ${GDB}/gdb/elfread.o \
  187.           ${GDB}/gdb/ui-file.o ${GDB}/gdb/utils.o ${GDB}/gdb/gnu-regex.o
  188.  
  189. GDB_5.2.1_FILES=${GDB}/gdb/Makefile.in \
  190.           ${GDB}/gdb/main.c ${GDB}/gdb/symtab.c ${GDB}/gdb/target.c \
  191.           ${GDB}/gdb/blockframe.c ${GDB}/gdb/alpha-tdep.c \
  192.           ${GDB}/gdb/symfile.c ${GDB}/gdb/elfread.c \
  193.           ${GDB}/gdb/ui-file.c ${GDB}/gdb/utils.c
  194. GDB_5.2.1_OFILES=${GDB}/gdb/main.o ${GDB}/gdb/symtab.o ${GDB}/gdb/target.o \
  195.           ${GDB}/gdb/blockframe.o ${GDB}/gdb/alpha-tdep.o \
  196.           ${GDB}/gdb/symfile.o ${GDB}/gdb/elfread.o \
  197.           ${GDB}/gdb/ui-file.o ${GDB}/gdb/utils.o
  198.  
  199. GDB_5.3post-0.20021129.36rh_FILES=${GDB}/gdb/Makefile.in \
  200.           ${GDB}/gdb/main.c ${GDB}/gdb/symtab.c ${GDB}/gdb/target.c \
  201.           ${GDB}/gdb/frame.c ${GDB}/gdb/alpha-tdep.c \
  202.           ${GDB}/gdb/symfile.c ${GDB}/gdb/elfread.c \
  203.           ${GDB}/gdb/ui-file.c ${GDB}/gdb/utils.c ${GDB}/gdb/dwarf2read.c
  204. GDB_5.3post-0.20021129.36rh_OFILES=${GDB}/gdb/main.o ${GDB}/gdb/symtab.o \
  205.           ${GDB}/gdb/target.o ${GDB}/gdb/frame.o ${GDB}/gdb/alpha-tdep.o \
  206.           ${GDB}/gdb/symfile.o ${GDB}/gdb/elfread.o ${GDB}/gdb/ui-file.o \
  207.           ${GDB}/gdb/utils.o ${GDB}/gdb/dwarf2read.o
  208.  
  209. GDB_6.0_FILES=${GDB}/gdb/Makefile.in ${GDB}/Makefile.in \
  210.           ${GDB}/gdb/main.c ${GDB}/gdb/symtab.c ${GDB}/gdb/target.c \
  211.           ${GDB}/gdb/symfile.c ${GDB}/gdb/elfread.c \
  212.           ${GDB}/gdb/ui-file.c ${GDB}/gdb/utils.c \
  213.           ${GDB}/gdb/ppc-linux-tdep.c ${GDB}/sim/ppc/ppc-instructions \
  214.           ${GDB}/bfd/simple.c ${GDB}/include/obstack.h
  215. GDB_6.0_OFILES=${GDB}/gdb/main.o ${GDB}/gdb/symtab.o \
  216.           ${GDB}/gdb/target.o ${GDB}/gdb/symfile.o ${GDB}/gdb/elfread.o \
  217.           ${GDB}/gdb/ui-file.o ${GDB}/gdb/utils.o \
  218.           ${GDB}/gdb/ppc-linux-tdep.o ${GDB}/bfd/simple.o
  219.  
  220. GDB_6.1_FILES=${GDB}/gdb/Makefile.in ${GDB}/Makefile.in \
  221.           ${GDB}/gdb/main.c ${GDB}/gdb/symtab.c ${GDB}/gdb/target.c \
  222.           ${GDB}/gdb/symfile.c ${GDB}/gdb/elfread.c \
  223.           ${GDB}/gdb/ui-file.c ${GDB}/gdb/utils.c ${GDB}/gdb/dwarf2read.c \
  224.           ${GDB}/include/obstack.h ${GDB}/gdb/ppc-linux-tdep.c
  225. GDB_6.1_OFILES=${GDB}/gdb/main.o ${GDB}/gdb/symtab.o \
  226.           ${GDB}/gdb/target.o ${GDB}/gdb/symfile.o ${GDB}/gdb/elfread.o \
  227.           ${GDB}/gdb/ui-file.o ${GDB}/gdb/utils.o ${GDB}/gdb/dwarf2read.o \
  228.           ${GDB}/gdb/ppc-linux-tdep.o
  229.  
  230. GDB_7.0_FILES=
  231. GDB_7.0_OFILES=${GDB}/gdb/symtab.o
  232.  
  233. #
  234. # GDB_FLAGS is passed up from the gdb Makefile.
  235. #
  236. GDB_FLAGS=-DGDB_7_0
  237.  
  238. #
  239. # WARNING_OPTIONS and WARNING_ERROR are both applied on a per-file basis.
  240. # WARNING_ERROR is NOT used on files including "dirty" gdb headers so that
  241. # successful compilations can be achieved with acceptable warnings; its
  242. # usefulness is also dependent upon the processor's compiler -- your mileage
  243. # may vary.
  244. #
  245. #WARNING_OPTIONS=-Wall -O2 -Wstrict-prototypes -Wmissing-prototypes -fstack-protector -Wp,-D_FORTIFY_SOURCE=2
  246. #WARNING_ERROR=-Werror
  247.  
  248. # TARGET_CFLAGS will be configured automatically by configure
  249. TARGET_CFLAGS=-D_FILE_OFFSET_BITS=64
  250.  
  251. CRASH_CFLAGS=-g -D${TARGET} ${TARGET_CFLAGS} ${CFLAGS}
  252.  
  253. GPL_FILES=COPYING3
  254. TAR_FILES=${SOURCE_FILES} Makefile ${GPL_FILES} README .rh_rpm_package crash.8 \
  255.         ${EXTENSION_SOURCE_FILES}
  256. CSCOPE_FILES=${SOURCE_FILES}
  257.  
  258. READLINE_DIRECTORY=./${GDB}/readline
  259. BFD_DIRECTORY=./${GDB}/bfd
  260. GDB_INCLUDE_DIRECTORY=./${GDB}/include
  261.  
  262. REDHATFLAGS=-DREDHAT
  263.  
  264. # target could be set on command line when invoking make. Like: make target=ARM
  265. # otherwise target will be the same as the host
  266. ifneq ($(target),)
  267. CONF_TARGET_FLAG="-t$(target)"
  268. endif
  269. # To build the extensions library by default, uncomment the third command
  270. # line below.  Otherwise they can be built by entering "make extensions".
  271.  
  272. all: make_configure
  273.         @./configure ${CONF_TARGET_FLAG} -p "RPMPKG=${RPMPKG}" -b
  274.         @make --no-print-directory gdb_merge
  275. #       @make --no-print-directory extensions
  276.  
  277. gdb_merge: force
  278.         @if [ ! -f ${GDB}/README ]; then \
  279.           make --no-print-directory gdb_unzip; fi
  280.         @echo "${LDFLAGS} -lz -ldl -rdynamic" > ${GDB}/gdb/mergelibs
  281.         @echo "../../${PROGRAM} ../../${PROGRAM}lib.a" > ${GDB}/gdb/mergeobj
  282.         @if [ ! -f ${GDB}/config.status ]; then \
  283.           (cd ${GDB}; ./configure ${GDB_CONF_FLAGS} --with-separate-debug-dir=/usr/lib/debug \
  284.             --with-bugurl="" --with-expat=no --with-python=no; \
  285.           make --no-print-directory; echo ${TARGET} > crash.target) \
  286.         else (cd ${GDB}/gdb; make --no-print-directory;); fi
  287.         @if [ ! -f ${GDB}/gdb/libgdb.a ]; then \
  288.           echo; echo "gdb build failed: ${GDB}/gdb/libgdb.a does not exist"; \
  289.           echo; exit 1; fi
  290.  
  291. gdb_unzip:
  292.         @rm -f gdb.files
  293.         @for FILE in ${GDB_FILES} dummy; do\
  294.           echo $$FILE >> gdb.files; done
  295.         @tar --exclude-from gdb.files -xvzmf ${GDB}.tar.gz
  296.         @make --no-print-directory gdb_patch
  297.  
  298. gdb_patch:
  299.         if [ -f ${GDB}.patch ] && [ -s ${GDB}.patch ]; then \
  300.                 patch -p0 < ${GDB}.patch; fi
  301.  
  302. library: make_build_data ${OBJECT_FILES}
  303.         ar -rs ${PROGRAM}lib.a ${OBJECT_FILES}
  304.  
  305. gdb: force
  306.         rm -f ${GDB_OFILES}
  307.         @make --no-print-directory all
  308.  
  309. force:
  310.        
  311.  
  312. make_configure: force
  313.         @rm -f configure
  314.         @cc ${CONF_FLAGS} -o configure configure.c ${WARNING_ERROR} ${WARNING_OPTIONS}
  315.  
  316. clean: make_configure
  317.         @./configure ${CONF_TARGET_FLAG} -q -b
  318.         @make --no-print-directory do_clean
  319.  
  320. do_clean:
  321.         rm -f ${OBJECT_FILES} ${DAEMON_OBJECT_FILES} ${PROGRAM} ${PROGRAM}lib.a ${GDB_OFILES}
  322.         @(cd extensions; make --no-print-directory -i clean)
  323.  
  324. make_build_data: force
  325.         cc -c ${CRASH_CFLAGS} build_data.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  326.  
  327. install:
  328.         ${INSTALL} -d ${INSTALLDIR}
  329.         ${INSTALL} ${PROGRAM} ${INSTALLDIR}
  330. #       /usr/bin/install ${PROGRAM}d ${INSTALLDIR}
  331.  
  332. unconfig: make_configure
  333.         @./configure -u
  334.  
  335. warn: make_configure
  336.         @./configure ${CONF_TARGET_FLAG} -w -b
  337.         @make --no-print-directory gdb_merge
  338.  
  339. Warn: make_configure
  340.         @./configure ${CONF_TARGET_FLAG} -W -b
  341.         @make --no-print-directory gdb_merge
  342.  
  343. nowarn: make_configure
  344.         @./configure ${CONF_TARGET_FLAG} -n -b
  345.         @make --no-print-directory gdb_merge
  346.  
  347. main.o: ${GENERIC_HFILES} main.c
  348.         cc -c ${CRASH_CFLAGS} main.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  349.  
  350. cmdline.o: ${GENERIC_HFILES} cmdline.c
  351.         cc -c ${CRASH_CFLAGS} cmdline.c ${GDB_FLAGS} -I${READLINE_DIRECTORY} ${WARNING_OPTIONS} ${WARNING_ERROR}
  352.  
  353. tools.o: ${GENERIC_HFILES} tools.c
  354.         cc -c ${CRASH_CFLAGS} tools.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  355.  
  356. global_data.o: ${GENERIC_HFILES} global_data.c
  357.         cc -c ${CRASH_CFLAGS} global_data.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  358.  
  359. symbols.o: ${GENERIC_HFILES} symbols.c
  360.         cc -c ${CRASH_CFLAGS} symbols.c ${GDB_FLAGS} -I${BFD_DIRECTORY} -I${GDB_INCLUDE_DIRECTORY} ${WARNING_OPTIONS} ${WARNING_ERROR}
  361.  
  362. filesys.o: ${GENERIC_HFILES} filesys.c
  363.         cc -c ${CRASH_CFLAGS} filesys.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  364.  
  365. help.o: ${GENERIC_HFILES} help.c
  366.         cc -c ${CRASH_CFLAGS} help.c ${GDB_FLAGS} ${WARNING_OPTIONS} ${WARNING_ERROR}
  367.  
  368. memory.o: ${GENERIC_HFILES} memory.c
  369.         cc -c ${CRASH_CFLAGS} memory.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  370.  
  371. test.o: ${GENERIC_HFILES} test.c
  372.         cc -c ${CRASH_CFLAGS} test.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  373.  
  374. task.o: ${GENERIC_HFILES} task.c
  375.         cc -c ${CRASH_CFLAGS} task.c ${GDB_FLAGS} ${WARNING_OPTIONS} ${WARNING_ERROR}
  376.  
  377. kernel.o: ${GENERIC_HFILES} kernel.c
  378.         cc -c ${CRASH_CFLAGS} kernel.c ${GDB_FLAGS} ${WARNING_OPTIONS} ${WARNING_ERROR}
  379.  
  380. gdb_interface.o: ${GENERIC_HFILES} gdb_interface.c
  381.         cc -c ${CRASH_CFLAGS} gdb_interface.c ${GDB_FLAGS} ${WARNING_OPTIONS} ${WARNING_ERROR}
  382.  
  383. va_server.o: ${MCORE_HFILES} va_server.c
  384.         cc -c ${CRASH_CFLAGS} va_server.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  385.  
  386. va_server_v1.o: ${MCORE_HFILES} va_server_v1.c
  387.         cc -c ${CRASH_CFLAGS} va_server_v1.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  388.  
  389. lkcd_common.o: ${GENERIC_HFILES} ${LKCD_DUMP_HFILES} lkcd_common.c
  390.         cc -c ${CRASH_CFLAGS} lkcd_common.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  391.  
  392. lkcd_v1.o: ${GENERIC_HFILES} ${LKCD_DUMP_HFILES} lkcd_v1.c
  393.         cc -c ${CRASH_CFLAGS} lkcd_v1.c -DMCLX ${WARNING_OPTIONS} ${WARNING_ERROR}
  394.  
  395. lkcd_v2_v3.o: ${GENERIC_HFILES} ${LKCD_DUMP_HFILES} lkcd_v2_v3.c
  396.         cc -c ${CRASH_CFLAGS} lkcd_v2_v3.c -DMCLX ${WARNING_OPTIONS} ${WARNING_ERROR}
  397.  
  398. lkcd_v5.o: ${GENERIC_HFILES} ${LKCD_DUMP_HFILES} lkcd_v5.c
  399.         cc -c ${CRASH_CFLAGS} lkcd_v5.c -DMCLX ${WARNING_OPTIONS} ${WARNING_ERROR}
  400.  
  401. lkcd_v7.o: ${GENERIC_HFILES} ${LKCD_DUMP_HFILES} lkcd_v7.c
  402.         cc -c ${CRASH_CFLAGS} lkcd_v7.c -DMCLX ${WARNING_OPTIONS} ${WARNING_ERROR}
  403.  
  404. lkcd_v8.o: ${GENERIC_HFILES} ${LKCD_DUMP_HFILES} lkcd_v8.c
  405.         cc -c ${CRASH_CFLAGS} lkcd_v8.c -DMCLX ${WARNING_OPTIONS} ${WARNING_ERROR}
  406.  
  407. net.o: ${GENERIC_HFILES} net.c
  408.         cc -c ${CRASH_CFLAGS} net.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  409.  
  410. dev.o: ${GENERIC_HFILES} dev.c
  411.         cc -c ${CRASH_CFLAGS} dev.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  412.  
  413. # remote.c functionality has been deprecated
  414. remote.o: ${GENERIC_HFILES} remote.c
  415.         @cc -c ${CRASH_CFLAGS} remote.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  416. remote_daemon.o: ${GENERIC_HFILES} remote.c
  417.         cc -c ${CRASH_CFLAGS} -DDAEMON remote.c -o remote_daemon.o ${WARNING_OPTIONS} ${WARNING_ERROR}
  418.  
  419. x86.o: ${GENERIC_HFILES} ${REDHAT_HFILES} x86.c
  420.         cc -c ${CRASH_CFLAGS} x86.c -DMCLX ${WARNING_OPTIONS} ${WARNING_ERROR}
  421.  
  422. alpha.o: ${GENERIC_HFILES} alpha.c
  423.         cc -c ${CRASH_CFLAGS} alpha.c ${GDB_FLAGS} ${WARNING_OPTIONS} ${WARNING_ERROR}
  424.  
  425. ppc.o: ${GENERIC_HFILES} ppc.c
  426.         cc -c ${CRASH_CFLAGS} ppc.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  427.  
  428. ia64.o: ${GENERIC_HFILES} ${REDHAT_HFILES} ia64.c
  429.         cc -c ${CRASH_CFLAGS} ia64.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  430.  
  431. ppc64.o: ${GENERIC_HFILES} ppc64.c
  432.         cc -c ${CRASH_CFLAGS} ppc64.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  433.  
  434. x86_64.o: ${GENERIC_HFILES} ${REDHAT_HFILES} x86_64.c
  435.         cc -c ${CRASH_CFLAGS} x86_64.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  436.  
  437. arm.o: ${GENERIC_HFILES} ${REDHAT_HFILES} arm.c
  438.         cc -c ${CRASH_CFLAGS} arm.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  439.  
  440. s390.o: ${GENERIC_HFILES} ${IBM_HFILES} s390.c
  441.         cc -c ${CRASH_CFLAGS} s390.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  442.  
  443. s390x.o: ${GENERIC_HFILES} ${IBM_HFILES} s390x.c
  444.         cc -c ${CRASH_CFLAGS} s390x.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  445.  
  446. s390dbf.o: ${GENERIC_HFILES} ${IBM_HFILES} s390dbf.c
  447.         cc -c ${CRASH_CFLAGS} s390dbf.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  448.  
  449. s390_dump.o: ${GENERIC_HFILES} ${IBM_HFILES} s390_dump.c
  450.         cc -c ${CRASH_CFLAGS} s390_dump.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  451.  
  452. netdump.o: ${GENERIC_HFILES} ${REDHAT_HFILES} netdump.c
  453.         cc -c ${CRASH_CFLAGS} netdump.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  454. netdump_daemon.o: ${GENERIC_HFILES} ${REDHAT_HFILES} netdump.c
  455.         cc -c ${CRASH_CFLAGS} -DDAEMON netdump.c -o netdump_daemon.o ${WARNING_OPTIONS} ${WARNING_ERROR}
  456.  
  457. diskdump.o: ${GENERIC_HFILES} ${REDHAT_HFILES} diskdump.c
  458.         cc -c ${CRASH_CFLAGS} diskdump.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  459.  
  460. xendump.o: ${GENERIC_HFILES} ${REDHAT_HFILES} xendump.c
  461.         cc -c ${CRASH_CFLAGS} xendump.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  462.  
  463. kvmdump.o: ${GENERIC_HFILES} ${REDHAT_HFILES} kvmdump.c
  464.         cc -c ${CRASH_CFLAGS} kvmdump.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  465.  
  466. qemu.o: ${GENERIC_HFILES} ${REDHAT_HFILES} qemu.c
  467.         cc -c ${CRASH_CFLAGS} qemu.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  468.  
  469. qemu-load.o: ${GENERIC_HFILES} ${REDHAT_HFILES} qemu-load.c
  470.         cc -c ${CRASH_CFLAGS} qemu-load.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  471.  
  472. extensions.o: ${GENERIC_HFILES} extensions.c
  473.         cc -c ${CRASH_CFLAGS} extensions.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  474.  
  475. lkcd_x86_trace.o: ${GENERIC_HFILES} ${LKCD_TRACE_HFILES} lkcd_x86_trace.c
  476.         cc -c ${CRASH_CFLAGS} lkcd_x86_trace.c -DREDHAT ${WARNING_OPTIONS} ${WARNING_ERROR}
  477.  
  478. unwind_x86_32_64.o: ${GENERIC_HFILES} ${UNWIND_HFILES} unwind_x86_32_64.c
  479.         cc -c ${CRASH_CFLAGS} unwind_x86_32_64.c -o unwind_x86_32_64.o ${WARNING_OPTIONS} ${WARNING_ERROR}
  480.  
  481. unwind_arm.o: ${GENERIC_HFILES} ${UNWIND_HFILES} unwind_arm.c
  482.         cc -c ${CRASH_CFLAGS} unwind_arm.c -o unwind_arm.o ${WARNING_OPTIONS} ${WARNING_ERROR}
  483.  
  484. unwind_v1.o: ${GENERIC_HFILES} ${UNWIND_HFILES} unwind.c unwind_decoder.c
  485.         cc -c ${CRASH_CFLAGS} unwind.c -DREDHAT -DUNWIND_V1 -o unwind_v1.o ${WARNING_OPTIONS} ${WARNING_ERROR}
  486.  
  487. unwind_v2.o: ${GENERIC_HFILES} ${UNWIND_HFILES} unwind.c unwind_decoder.c
  488.         cc -c ${CRASH_CFLAGS} unwind.c -DREDHAT -DUNWIND_V2 -o unwind_v2.o ${WARNING_OPTIONS} ${WARNING_ERROR}
  489.  
  490. unwind_v3.o: ${GENERIC_HFILES} ${UNWIND_HFILES} unwind.c unwind_decoder.c
  491.         cc -c ${CRASH_CFLAGS} unwind.c -DREDHAT -DUNWIND_V3 -o unwind_v3.o ${WARNING_OPTIONS} ${WARNING_ERROR}
  492.  
  493. lkcd_fix_mem.o: ${GENERIC_HFILES} ${LKCD_HFILES} lkcd_fix_mem.c
  494.         cc -c ${CRASH_CFLAGS} lkcd_fix_mem.c -DMCLX ${WARNING_OPTIONS} ${WARNING_ERROR}
  495.  
  496. xen_hyper.o: ${GENERIC_HFILES} xen_hyper.c
  497.         cc -c ${CRASH_CFLAGS} xen_hyper.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  498.  
  499. xen_hyper_command.o: ${GENERIC_HFILES} xen_hyper_command.c
  500.         cc -c ${CRASH_CFLAGS} xen_hyper_command.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  501.  
  502. xen_hyper_global_data.o: ${GENERIC_HFILES} xen_hyper_global_data.c
  503.         cc -c ${CRASH_CFLAGS} xen_hyper_global_data.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  504.  
  505. xen_hyper_dump_tables.o: ${GENERIC_HFILES} xen_hyper_dump_tables.c
  506.         cc -c ${CRASH_CFLAGS} xen_hyper_dump_tables.c ${WARNING_OPTIONS} ${WARNING_ERROR}
  507.  
  508. ${PROGRAM}: force
  509.         @make --no-print-directory all
  510.  
  511. # Remote daemon functionality has been deprecated.
  512. daemon_deprecated: force
  513.         @echo "WARNING: remote daemon functionality has been deprecated"
  514.         @echo
  515.  
  516. ${PROGRAM}d: daemon_deprecated make_configure
  517.         @./configure -d
  518.         @make --no-print-directory make_build_data
  519.         @make --no-print-directory daemon
  520.  
  521. daemon: ${DAEMON_OBJECT_FILES}
  522.         cc ${LDFLAGS} -o ${PROGRAM}d ${DAEMON_OBJECT_FILES} build_data.o -lz
  523.  
  524. files: make_configure
  525.         @./configure -q -b
  526.         @make --no-print-directory show_files
  527.  
  528. gdb_files: make_configure
  529.         @./configure -q -b
  530.         @echo ${GDB_FILES} ${GDB_PATCH_FILES}
  531.  
  532. show_files:
  533.         @if [ -f ${PROGRAM}  ]; then \
  534.                 ./${PROGRAM} --no_scroll --no_crashrc -h README > README; fi
  535.         @echo ${SOURCE_FILES} Makefile ${GDB_FILES} ${GDB_PATCH_FILES} ${GPL_FILES} README \
  536.         .rh_rpm_package crash.8 ${EXTENSION_SOURCE_FILES}
  537.  
  538. ctags:
  539.         ctags ${SOURCE_FILES}
  540.  
  541. tar: make_configure
  542.         @./configure -q -b
  543.         @make --no-print-directory do_tar
  544.  
  545. do_tar:
  546.         @if [ -f ${PROGRAM}  ]; then \
  547.                 ./${PROGRAM} --no_scroll --no_crashrc -h README > README; fi
  548.         tar cvzf ${PROGRAM}.tar.gz ${TAR_FILES} ${GDB_FILES} ${GDB_PATCH_FILES}
  549.         @echo; ls -l ${PROGRAM}.tar.gz
  550.  
  551. VERSION=5.1.1
  552. RELEASE=0
  553.  
  554. release: make_configure
  555.         @if [ "`id --user`" != "0" ]; then \
  556.                 echo "make release: must be super-user"; exit 1; fi
  557.         @./configure -P "RPMPKG=${RPMPKG}" -u -g
  558.         @make --no-print-directory release_configure
  559.         @echo
  560.         @echo "cvs tag this release if necessary"
  561.  
  562. release_configure: make_configure
  563.         @if [ "${GDB}" = "" ] ; then \
  564.                 echo "make release: GDB not defined: append GDB=gdb-x.x to make command line"; echo; exit 1; fi
  565.         @./configure -r ${GDB}
  566.         @make --no-print-directory do_release
  567.  
  568. do_release:
  569.         @echo "CRASH VERSION: ${VERSION}  GDB VERSION: ${GDB}"
  570.         @if [ ! -f .rh_rpm_package  ]; then \
  571.                 echo "no .rh_rpm_package exists!"; exit 1; fi
  572.         @chmod 666 .rh_rpm_package
  573.         @rm -rf ./RELDIR; mkdir ./RELDIR; mkdir ./RELDIR/${PROGRAM}-${VERSION}
  574.         @rm -f ${PROGRAM}-${VERSION}.tar.gz
  575.         @rm -f ${PROGRAM}-${VERSION}-${RELEASE}.src.rpm
  576.         @chown root ./RELDIR/${PROGRAM}-${VERSION}
  577.         @tar cf - ${SOURCE_FILES} Makefile ${GDB_FILES} ${GDB_PATCH_FILES} ${GPL_FILES} \
  578.         .rh_rpm_package crash.8 ${EXTENSION_SOURCE_FILES} | (cd ./RELDIR/${PROGRAM}-${VERSION}; tar xf -)
  579.         @cp ${GDB}.tar.gz ./RELDIR/${PROGRAM}-${VERSION}
  580.         @./${PROGRAM} --no_scroll --no_crashrc -h README > ./RELDIR/${PROGRAM}-${VERSION}/README
  581.         @(cd ./RELDIR; find . -exec chown root {} ";")
  582.         @(cd ./RELDIR; find . -exec chgrp root {} ";")
  583.         @(cd ./RELDIR; find . -exec touch {} ";")
  584.         @(cd ./RELDIR; \
  585.                 tar czvf ../${PROGRAM}-${VERSION}.tar.gz ${PROGRAM}-${VERSION})
  586.         @chgrp root ${PROGRAM}-${VERSION}.tar.gz
  587.         @rm -rf ./RELDIR
  588.         @echo
  589.         @ls -l ${PROGRAM}-${VERSION}.tar.gz
  590.         @./configure -s -u > ${PROGRAM}.spec
  591.         @if [ -s ${PROGRAM}.spec ]; then \
  592.           rm -rf ./RPMBUILD; \
  593.           mkdir -p ./RPMBUILD/SOURCES ./RPMBUILD/SPECS ./RPMBUILD/SRPMS; \
  594.           cp ${PROGRAM}-${VERSION}.tar.gz ./RPMBUILD/SOURCES; \
  595.           cp ${PROGRAM}.spec ./RPMBUILD/SPECS; \
  596.           rpmbuild --define "_sourcedir ./RPMBUILD/SOURCES" \
  597.             --define "_srcrpmdir ./RPMBUILD/SRPMS" \
  598.             --define "_specdir ./RPMBUILD/SPECS" \
  599.             --nodeps -bs ./RPMBUILD/SPECS/${PROGRAM}.spec > /dev/null; \
  600.            mv ./RPMBUILD/SRPMS/${PROGRAM}-${VERSION}-${RELEASE}.src.rpm . ; \
  601.            rm -rf ./RPMBUILD; \
  602.            ls -l ${PROGRAM}-${VERSION}-${RELEASE}.src.rpm; \
  603.         fi
  604.  
  605. ref:
  606.         make ctags cscope
  607.  
  608. cscope:
  609.         rm -f cscope.files cscope_out
  610.         for FILE in ${SOURCE_FILES}; do \
  611.         echo $$FILE >> cscope.files; done
  612.         cscope
  613.  
  614. glink: make_configure
  615.         @./configure -q -b
  616.         rm -f gdb
  617.         ln -s ${GDB}/gdb gdb
  618.         (cd ${GDB}/gdb; rm -f ${PROGRAM}; ln -s ../../${PROGRAM} ${PROGRAM})
  619.  
  620. name:
  621.         @echo ${PROGRAM}
  622.  
  623. dis:
  624.         objdump --disassemble --line-numbers ${PROGRAM} > ${PROGRAM}.dis
  625.  
  626. extensions: make_configure
  627.         @./configure ${CONF_TARGET_FLAG} -q -b
  628.         @make --no-print-directory do_extensions
  629.  
  630. do_extensions:
  631.         @(cd extensions; make -i TARGET=$(TARGET) TARGET_CFLAGS="$(TARGET_CFLAGS)" GDB=$(GDB) GDB_FLAGS=$(GDB_FLAGS))