int buffer_to_output(char *pBuffer, FILE *pOutput) { int iRetval = 0; macro_list *pMacros = NULL; /* Tokenize the macros and their corresponding values. */ pMacros = extract_macros(pBuffer); if(pMacros != NULL) { /* Perform forward to backslash conversion on those macros known to be * path information only. */ slash_convert(pMacros, "JBOOTDIRS"); slash_convert(pMacros, "JDIRS"); slash_convert(pMacros, "DEPTH"); slash_convert(pMacros, "PACKAGE"); slash_convert(pMacros, "JMC_GEN_DIR"); slash_convert(pMacros, "DIST_PUBLIC"); /* Process some of the macros, and convert them * into different macros with different data. */ morph_macro(&pMacros, "JMC_GEN", "JMC_HEADERS", "$(JMC_GEN_DIR)\\%s.h"); morph_macro(&pMacros, "JMC_GEN", "JMC_STUBS", "$(JMC_GEN_DIR)\\%s.c"); morph_macro(&pMacros, "JMC_GEN", "JMC_OBJS", ".\\$(OBJDIR)\\%s.obj"); morph_macro(&pMacros, "CSRCS", "C_OBJS", ".\\$(OBJDIR)\\%s.obj"); morph_macro(&pMacros, "CPPSRCS", "CPP_OBJS", ".\\$(OBJDIR)\\%s.obj"); morph_macro(&pMacros, "REQUIRES", "LINCS", "-I$(XPDIST)\\public\\%s"); create_classroot( &pMacros ); /* Output the Macros and the corresponding values. */ iRetval = write_macros(pMacros, pOutput); /* Output rule file inclusion */ if(iRetval == 0) { iRetval = output_rules(pOutput); } /* Output explicit build rules/dependencies for JMC_GEN. */ if(iRetval == 0) { iRetval = explicit_rules(pMacros, "JMC_GEN", pOutput); } if(iRetval == 0) { iRetval = output_end(pOutput); } /* Free off the macro list. */ free_macro_list(pMacros); pMacros = NULL; } return(iRetval); }
static char *tag_macro_reset (int argc, char *argv[]) { free_macro_list (macros_space[0]); macros_space[0] = new_macro_list (); return NULL; }
static void release_processing (void) { free_macro_list (macros_space[0]); nmacros_space = 0; }