blob: efac857c55119f1252d0a32e956ea47f7d670b04 [file] [log] [blame]
Jason Wessel5d5314d2010-05-20 21:04:20 -05001# This file is subject to the terms and conditions of the GNU General Public
2# License. See the file "COPYING" in the main directory of this archive
3# for more details.
4#
5# Copyright (c) 1999-2004 Silicon Graphics, Inc. All Rights Reserved.
6# Copyright (c) 2009 Wind River Systems, Inc. All Rights Reserved.
7#
8
Jason Wessel5d5314d2010-05-20 21:04:20 -05009obj-y := kdb_io.o kdb_main.o kdb_support.o kdb_bt.o gen-kdb_cmds.o kdb_bp.o kdb_debugger.o
Jason Wesselada64e42010-05-20 21:04:24 -050010obj-$(CONFIG_KDB_KEYBOARD) += kdb_keyboard.o
Jason Wessel5d5314d2010-05-20 21:04:20 -050011
12clean-files := gen-kdb_cmds.c
13
14quiet_cmd_gen-kdb = GENKDB $@
15 cmd_gen-kdb = $(AWK) 'BEGIN {print "\#include <linux/stddef.h>"; print "\#include <linux/init.h>"} \
16 /^\#/{next} \
17 /^[ \t]*$$/{next} \
18 {gsub(/"/, "\\\"", $$0); \
19 print "static __initdata char kdb_cmd" cmds++ "[] = \"" $$0 "\\n\";"} \
20 END {print "extern char *kdb_cmds[]; char __initdata *kdb_cmds[] = {"; for (i = 0; i < cmds; ++i) {print " kdb_cmd" i ","}; print(" NULL\n};");}' \
21 $(filter-out %/Makefile,$^) > $@#
22
23$(obj)/gen-kdb_cmds.c: $(src)/kdb_cmds $(src)/Makefile
24 $(call cmd,gen-kdb)