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