expsyms(kdbmain.o kdb_io.o)
select(CONFIG_KDB kdb_bt.o kdb_bp.o kdb_id.o kdbsupport.o gen-kdb_cmds.o kdbmain.o kdb_io.o)
link_subdirs(modules)

user_command(gen-kdb_cmds.c
	($(srcfile kdb_cmds))
	($(AWK) "
		BEGIN {print \"#include <linux/init.h>\"}
		/^ *#/{next}
		/^[ \\t]*\$$/{next}
		{print \"static __initdata char kdb_cmd\" cmds++ \"[] = \\\"\" \$$0 \"\\\\n\\\";\"}
		END {
			print \"char __initdata *kdb_cmds[] = {\";
			for (i = 0; i < cmds; ++i) {print \"  kdb_cmd\" i \",\"};
			print(\"  0\\n};\");
		}" $< > $@)
	()
	)

extra_cflags_all($(src_includelist /arch/$(ARCH)/kdb))
extra_cflags_all(STRIP -pg)
