? |
Definition at line 1687 of file cmt_generators.cxx.
References Application, cmt_string::c_str(), Document, Constituent::exclude_exprs, Constituent::generator, CmtGenerator::get_all_files(), Constituent::includes, Library, Constituent::modules, Constituent::name, Constituent::need_OS9, Constituent::no_share, reset(), Constituent::select_exprs, CmtGenerator::set_full_name(), cmt_vector< cmt_string >::size(), Constituent::suffix, CmtGenerator::terminate(), Constituent::type, Constituent::variables, and Constituent::windows.
Referenced by Generator::build_msdev().
01688 {
01689 reset ();
01690
01691 const cmt_string& package = Cmt::get_current_package ();
01692 static cmt_string file;
01693 static cmt_string full_name;
01694 static cmt_string suffix;
01695
01696 int i;
01697
01698 m_CONSTITUENT = constituent.name;
01699 m_CONSTITUENTSUFFIX = constituent.suffix;
01700
01701 for (i = 0; i < constituent.includes.size (); i++)
01702 {
01703 const cmt_string& include = constituent.includes[i];
01704 m_PACKINCLUDES += " -I" + include;
01705 }
01706
01707 switch (constituent.type)
01708 {
01709 case Application:
01710 is_application = true;
01711 m_TITLE = "Application";
01712 break;
01713 case Library:
01714 is_library = true;
01715 m_TITLE = "Library";
01716 break;
01717 case Document:
01718 m_GENERATOR = constituent.generator;
01719 m_TITLE = "Document";
01720 break;
01721 }
01722
01723 m_PACKOS9 = constituent.need_OS9;
01724
01725 const CmtSystem::cmt_string_vector& sources = constituent.modules;
01726 const cmt_vector& excludes = constituent.exclude_exprs;
01727 const cmt_vector& selects = constituent.select_exprs;
01728
01729
01730
01731 m_output_file_name = msdevdir + m_CONSTITUENT + ".dspnew";
01732 m_output_file = fopen (m_output_file_name.c_str (), "wb");
01733
01734 if (m_output_file == NULL) return (0);
01735
01736 m_PACKAGE = package;
01737
01738 if (is_library)
01739 {
01740 if (constituent.no_share)
01741 {
01742 m_LIBRARYSUFFIX = "lib";
01743 }
01744 else
01745 {
01746 m_LIBRARYSUFFIX = "arc";
01747 }
01748
01749 dsp_library_header_fragment.wincopy (m_output_file, constituent.variables, 4,
01750 &m_PACKAGE,
01751 &m_CONSTITUENT,
01752 &m_CONSTITUENTSUFFIX,
01753 &m_LIBRARYSUFFIX);
01754 }
01755 else
01756 {
01757 if (constituent.windows)
01758 {
01759 dsp_windows_header_fragment.wincopy (m_output_file, constituent.variables, 3,
01760 &m_PACKAGE,
01761 &m_CONSTITUENT,
01762 &m_CONSTITUENTSUFFIX);
01763 }
01764 else
01765 {
01766 dsp_application_header_fragment.wincopy (m_output_file, constituent.variables, 3,
01767 &m_PACKAGE,
01768 &m_CONSTITUENT,
01769 &m_CONSTITUENTSUFFIX);
01770 }
01771 }
01772
01773 for (i = 0; i < sources.size (); i++)
01774 {
01775 file = sources[i];
01776
01777 set_full_name (full_name, file);
01778 if (full_name == "") continue;
01779
01780 static CmtSystem::cmt_string_vector files;
01781
01782 get_all_files (full_name, excludes, selects, files);
01783
01784 for (int j = 0; j < files.size (); j++)
01785 {
01786 const cmt_string& name = files[j];
01787
01788 if (name != "")
01789 {
01790 m_FULLNAME = name;
01791
01792 if (m_output_file != NULL)
01793 {
01794 dsp_contents_fragment.wincopy (m_output_file, constituent.variables, 2,
01795 &m_PACKAGE,
01796 &m_FULLNAME);
01797 }
01798 }
01799 }
01800 }
01801
01802 if (m_output_file != NULL)
01803 {
01804 dsp_trailer_fragment.wincopy (m_output_file, constituent.variables, 3,
01805 &m_PACKAGE,
01806 &m_CONSTITUENT,
01807 &m_CONSTITUENTSUFFIX);
01808
01809 terminate ();
01810 }
01811
01812 return (0);
01813 }
|