diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-03-14 07:05:57 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2011-03-23 12:36:22 -0400 |
commit | 10635c8b71957449b4c53c5f6b9210cc1a7d984d (patch) | |
tree | 431bb1d5c2f159cf614db17115f95dc2c19416ac | |
parent | 6d1802539d218e24492c651bd0687ebfe7e14831 (diff) |
[SCSI] target: tcm_mod_builder.py generated Makefile cleanups
This patch converts the tcm_mod_builder.py generation script to
create a new drivers/target/$TCM_FABRIC_MOD/Makefile and update
drivers/target/Makefile, instead of creating+updating a 'Kbuild'
filename.
It also removes the remaining EXTRA_CFLAGS includes from
tcm_mod_build_kbuild(), and converts fabric module generated .c
code to us ""-style includes for $FABRIC_MOD_[base,fabric].h
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rwxr-xr-x | Documentation/target/tcm_mod_builder.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/Documentation/target/tcm_mod_builder.py b/Documentation/target/tcm_mod_builder.py index dbeb8a0d7175..89af6c7a7c8f 100755 --- a/Documentation/target/tcm_mod_builder.py +++ b/Documentation/target/tcm_mod_builder.py | |||
@@ -239,8 +239,8 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name): | |||
239 | buf += "#include <target/target_core_configfs.h>\n" | 239 | buf += "#include <target/target_core_configfs.h>\n" |
240 | buf += "#include <target/target_core_base.h>\n" | 240 | buf += "#include <target/target_core_base.h>\n" |
241 | buf += "#include <target/configfs_macros.h>\n\n" | 241 | buf += "#include <target/configfs_macros.h>\n\n" |
242 | buf += "#include <" + fabric_mod_name + "_base.h>\n" | 242 | buf += "#include \"" + fabric_mod_name + "_base.h\"\n" |
243 | buf += "#include <" + fabric_mod_name + "_fabric.h>\n\n" | 243 | buf += "#include \"" + fabric_mod_name + "_fabric.h\"\n\n" |
244 | 244 | ||
245 | buf += "/* Local pointer to allocated TCM configfs fabric module */\n" | 245 | buf += "/* Local pointer to allocated TCM configfs fabric module */\n" |
246 | buf += "struct target_fabric_configfs *" + fabric_mod_name + "_fabric_configfs;\n\n" | 246 | buf += "struct target_fabric_configfs *" + fabric_mod_name + "_fabric_configfs;\n\n" |
@@ -583,9 +583,9 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name): | |||
583 | buf += "#include <target/target_core_fabric_lib.h>\n" | 583 | buf += "#include <target/target_core_fabric_lib.h>\n" |
584 | buf += "#include <target/target_core_device.h>\n" | 584 | buf += "#include <target/target_core_device.h>\n" |
585 | buf += "#include <target/target_core_tpg.h>\n" | 585 | buf += "#include <target/target_core_tpg.h>\n" |
586 | buf += "#include <target/target_core_configfs.h>\n" | 586 | buf += "#include <target/target_core_configfs.h>\n\n" |
587 | buf += "#include <" + fabric_mod_name + "_base.h>\n" | 587 | buf += "#include \"" + fabric_mod_name + "_base.h\"\n" |
588 | buf += "#include <" + fabric_mod_name + "_fabric.h>\n\n" | 588 | buf += "#include \"" + fabric_mod_name + "_fabric.h\"\n\n" |
589 | 589 | ||
590 | buf += "int " + fabric_mod_name + "_check_true(struct se_portal_group *se_tpg)\n" | 590 | buf += "int " + fabric_mod_name + "_check_true(struct se_portal_group *se_tpg)\n" |
591 | buf += "{\n" | 591 | buf += "{\n" |
@@ -973,14 +973,13 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name): | |||
973 | def tcm_mod_build_kbuild(fabric_mod_dir_var, fabric_mod_name): | 973 | def tcm_mod_build_kbuild(fabric_mod_dir_var, fabric_mod_name): |
974 | 974 | ||
975 | buf = "" | 975 | buf = "" |
976 | f = fabric_mod_dir_var + "/Kbuild" | 976 | f = fabric_mod_dir_var + "/Makefile" |
977 | print "Writing file: " + f | 977 | print "Writing file: " + f |
978 | 978 | ||
979 | p = open(f, 'w') | 979 | p = open(f, 'w') |
980 | if not p: | 980 | if not p: |
981 | tcm_mod_err("Unable to open file: " + f) | 981 | tcm_mod_err("Unable to open file: " + f) |
982 | 982 | ||
983 | buf = "EXTRA_CFLAGS += -I$(srctree)/drivers/target/ -I$(srctree)/include/ -I$(srctree)/drivers/scsi/ -I$(srctree)/include/scsi/ -I$(srctree)/drivers/target/" + fabric_mod_name + "\n\n" | ||
984 | buf += fabric_mod_name + "-objs := " + fabric_mod_name + "_fabric.o \\\n" | 983 | buf += fabric_mod_name + "-objs := " + fabric_mod_name + "_fabric.o \\\n" |
985 | buf += " " + fabric_mod_name + "_configfs.o\n" | 984 | buf += " " + fabric_mod_name + "_configfs.o\n" |
986 | buf += "obj-$(CONFIG_" + fabric_mod_name.upper() + ") += " + fabric_mod_name + ".o\n" | 985 | buf += "obj-$(CONFIG_" + fabric_mod_name.upper() + ") += " + fabric_mod_name + ".o\n" |
@@ -1018,7 +1017,7 @@ def tcm_mod_build_kconfig(fabric_mod_dir_var, fabric_mod_name): | |||
1018 | 1017 | ||
1019 | def tcm_mod_add_kbuild(tcm_dir, fabric_mod_name): | 1018 | def tcm_mod_add_kbuild(tcm_dir, fabric_mod_name): |
1020 | buf = "obj-$(CONFIG_" + fabric_mod_name.upper() + ") += " + fabric_mod_name.lower() + "/\n" | 1019 | buf = "obj-$(CONFIG_" + fabric_mod_name.upper() + ") += " + fabric_mod_name.lower() + "/\n" |
1021 | kbuild = tcm_dir + "/drivers/target/Kbuild" | 1020 | kbuild = tcm_dir + "/drivers/target/Makefile" |
1022 | 1021 | ||
1023 | f = open(kbuild, 'a') | 1022 | f = open(kbuild, 'a') |
1024 | f.write(buf) | 1023 | f.write(buf) |
@@ -1064,7 +1063,7 @@ def main(modname, proto_ident): | |||
1064 | tcm_mod_build_kbuild(fabric_mod_dir, fabric_mod_name) | 1063 | tcm_mod_build_kbuild(fabric_mod_dir, fabric_mod_name) |
1065 | tcm_mod_build_kconfig(fabric_mod_dir, fabric_mod_name) | 1064 | tcm_mod_build_kconfig(fabric_mod_dir, fabric_mod_name) |
1066 | 1065 | ||
1067 | input = raw_input("Would you like to add " + fabric_mod_name + "to drivers/target/Kbuild..? [yes,no]: ") | 1066 | input = raw_input("Would you like to add " + fabric_mod_name + "to drivers/target/Makefile..? [yes,no]: ") |
1068 | if input == "yes" or input == "y": | 1067 | if input == "yes" or input == "y": |
1069 | tcm_mod_add_kbuild(tcm_dir, fabric_mod_name) | 1068 | tcm_mod_add_kbuild(tcm_dir, fabric_mod_name) |
1070 | 1069 | ||