diff options
Diffstat (limited to 'src/usr/errl/parser/genErrlParsers.pl')
-rwxr-xr-x | src/usr/errl/parser/genErrlParsers.pl | 55 |
1 files changed, 54 insertions, 1 deletions
diff --git a/src/usr/errl/parser/genErrlParsers.pl b/src/usr/errl/parser/genErrlParsers.pl index ff9bb8461..1d3af664d 100755 --- a/src/usr/errl/parser/genErrlParsers.pl +++ b/src/usr/errl/parser/genErrlParsers.pl @@ -979,6 +979,59 @@ foreach my $dir(@pluginDirsToParse) } #------------------------------------------------------------------------------ +# Generate the makefile that builds the Hostboot error log parsers for errltool +#------------------------------------------------------------------------------ +$outputFileName = $outputDir . "/Makefile"; +open(OFILE, ">", $outputFileName) or die("Cannot open: $outputFileName: $!"); + +print OFILE "\# Automatically generated by Hostboot's $0\n"; +print OFILE "\# Do not modify this file in the errltool tree, it is provided by\n"; +print OFILE "\# Hostboot and will be overwritten\n"; +print OFILE "\#\n"; + +print OFILE "CXXFLAGS += -D__HOSTBOOT_MODULE -DLOGPARSER \n\n"; +print OFILE "CXXFLAGS += -I. -I../ -I../targeting -I../../include -I../../include/util -I../../include/extras -I../../include/genfiles\n\n"; + +print OFILE "LDFLAGS += -static\n\n"; + +print OFILE "\#-------------------------------------------------------------\n"; +print OFILE "\# Call PRD makefile for prdf plugins\n"; +print OFILE "\#-------------------------------------------------------------\n"; +print OFILE "SUBDIRS = prdf\n\n"; + +print OFILE "CMDS = libhbplugins.a\n\n"; + +print OFILE "\#-------------------------------------------------------------\n"; +print OFILE "\# SRC Parsers\n"; +print OFILE "\#-------------------------------------------------------------\n"; + +print OFILE "HB_PLUGIN_SRC_OBJS = "; +foreach my $compValue (keys %compValueToParseHash) +{ + print OFILE "\\\n"; + print OFILE " hbfwSrcParse$compValue.o "; +} + +print OFILE "\n\n"; +print OFILE "all: \$(CMDS)\n"; +print OFILE "\t\@\$(MAKE) -C prdf\n\n"; +print OFILE "libhbplugins.a: \$(HB_PLUGIN_SRC_OBJS)\n"; +print OFILE "\t\@echo \"LD \$(WORK_DIR)/\$\@\"\n"; +print OFILE "\tar rvs \$\@ \$(HB_PLUGIN_SRC_OBJS)\n\n"; + +print OFILE "\$(HB_PLUGIN_SRC_OBJS):%.o: %.C\n"; +print OFILE "\t\@echo \"\$(CC) \$(CXXFLAGS) \$(WORK_DIR)/\$\@\"\n"; +print OFILE "\t\$(CC) \$(CXXFLAGS) -c \$<\n\n"; + +print OFILE "clean:\n"; +print OFILE "\t\@echo \"Cleaning up \$(WORK_DIR) files...\"\n"; +print OFILE "\trm -rf \$(CMDS) \$(HB_PLUGIN_SRC_OBJS)\n"; +print OFILE "\t\@\$(foreach d,\$(SUBDIRS), \$(MAKE) -C \$d clean;)\n\n"; + +print OFILE "\n\ninclude ../../rules.mk\n"; + +close(OFILE); +#------------------------------------------------------------------------------ # Generate the FSP makefile that builds the Hostboot error log parsers #------------------------------------------------------------------------------ $outputFileName = $outputDir . "/makefile"; @@ -989,7 +1042,7 @@ print OFILE "\# Do not modify this file in the FSP tree, it is provided by\n"; print OFILE "\# Hostboot and will be overwritten\n"; print OFILE "\#\n"; -print OFILE "CFLAGS += -DPARSER\n\n"; +print OFILE "CFLAGS += -DPARSER \n\n"; print OFILE "EXPLIBS =\n\n"; print OFILE "\#-------------------------------------------------------------\n"; |