#include <cmt_generators.h>
Inheritance diagram for MSDEVGenerator:
Public Member Functions | |
MSDEVGenerator () | |
int | build_workspace (const Constituent::ConstituentVector &constituents) |
int | build_project (const Constituent &constituent) |
Private Member Functions | |
void | reset () |
Private Attributes | |
cmt_string | msdevdir |
FragmentHandle | dsw_header_fragment |
FragmentHandle | dsw_project_fragment |
FragmentHandle | dsw_all_project_header_fragment |
FragmentHandle | dsw_all_project_dependency_fragment |
FragmentHandle | dsw_all_project_trailer_fragment |
FragmentHandle | dsw_trailer_fragment |
FragmentHandle | dsp_all_fragment |
FragmentHandle | dsp_library_header_fragment |
FragmentHandle | dsp_application_header_fragment |
FragmentHandle | dsp_windows_header_fragment |
FragmentHandle | dsp_contents_fragment |
FragmentHandle | dsp_trailer_fragment |
|
|
Definition at line 1688 of file cmt_generators.cxx. References Application, CmtSystem::cmt_string_vector, 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< T >::size(), Constituent::suffix, CmtGenerator::terminate(), Constituent::type, Constituent::variables, and Constituent::windows. Referenced by Generator::build_msdev().
01689 { 01690 reset (); 01691 01692 const cmt_string& package = Cmt::get_current_package (); 01693 static cmt_string file; 01694 static cmt_string full_name; 01695 static cmt_string suffix; 01696 01697 int i; 01698 01699 m_CONSTITUENT = constituent.name; 01700 m_CONSTITUENTSUFFIX = constituent.suffix; 01701 01702 for (i = 0; i < constituent.includes.size (); i++) 01703 { 01704 const cmt_string& include = constituent.includes[i]; 01705 m_PACKINCLUDES += " -I" + include; 01706 } 01707 01708 switch (constituent.type) 01709 { 01710 case Application: 01711 is_application = true; 01712 m_TITLE = "Application"; 01713 break; 01714 case Library: 01715 is_library = true; 01716 m_TITLE = "Library"; 01717 break; 01718 case Document: 01719 m_GENERATOR = constituent.generator; 01720 m_TITLE = "Document"; 01721 break; 01722 } 01723 01724 m_PACKOS9 = constituent.need_OS9; 01725 01726 const CmtSystem::cmt_string_vector& sources = constituent.modules; 01727 const cmt_vector<cmt_regexp>& excludes = constituent.exclude_exprs; 01728 const cmt_vector<cmt_regexp>& selects = constituent.select_exprs; 01729 01730 //--- Build the constituents fragment ----- 01731 01732 m_output_file_name = msdevdir + m_CONSTITUENT + ".dspnew"; 01733 m_output_file = fopen (m_output_file_name.c_str (), "wb"); 01734 01735 if (m_output_file == NULL) return (0); 01736 01737 m_PACKAGE = package; 01738 01739 if (is_library) 01740 { 01741 if (constituent.no_share) 01742 { 01743 m_LIBRARYSUFFIX = "lib"; 01744 } 01745 else 01746 { 01747 m_LIBRARYSUFFIX = "arc"; 01748 } 01749 01750 dsp_library_header_fragment.wincopy (m_output_file, constituent.variables, 4, 01751 &m_PACKAGE, 01752 &m_CONSTITUENT, 01753 &m_CONSTITUENTSUFFIX, 01754 &m_LIBRARYSUFFIX); 01755 } 01756 else 01757 { 01758 if (constituent.windows) 01759 { 01760 dsp_windows_header_fragment.wincopy (m_output_file, constituent.variables, 3, 01761 &m_PACKAGE, 01762 &m_CONSTITUENT, 01763 &m_CONSTITUENTSUFFIX); 01764 } 01765 else 01766 { 01767 dsp_application_header_fragment.wincopy (m_output_file, constituent.variables, 3, 01768 &m_PACKAGE, 01769 &m_CONSTITUENT, 01770 &m_CONSTITUENTSUFFIX); 01771 } 01772 } 01773 01774 for (i = 0; i < sources.size (); i++) 01775 { 01776 file = sources[i]; 01777 01778 set_full_name (full_name, file); 01779 if (full_name == "") continue; 01780 01781 static CmtSystem::cmt_string_vector files; 01782 01783 get_all_files (full_name, excludes, selects, files); 01784 01785 for (int j = 0; j < files.size (); j++) 01786 { 01787 const cmt_string& name = files[j]; 01788 01789 if (name != "") 01790 { 01791 m_FULLNAME = name; 01792 01793 if (m_output_file != NULL) 01794 { 01795 dsp_contents_fragment.wincopy (m_output_file, constituent.variables, 2, 01796 &m_PACKAGE, 01797 &m_FULLNAME); 01798 } 01799 } 01800 } 01801 } 01802 01803 if (m_output_file != NULL) 01804 { 01805 dsp_trailer_fragment.wincopy (m_output_file, constituent.variables, 3, 01806 &m_PACKAGE, 01807 &m_CONSTITUENT, 01808 &m_CONSTITUENTSUFFIX); 01809 01810 terminate (); 01811 } 01812 01813 return (0); 01814 } |
|
Definition at line 1597 of file cmt_generators.cxx. References Constituent::ConstituentVector, Library, Constituent::name, reset(), cmt_vector< T >::size(), Constituent::suffix, CmtGenerator::terminate(), Constituent::type, and Constituent::variables. Referenced by Generator::build_msdev_workspace().
01598 { 01599 reset (); 01600 01601 const cmt_string& package = Cmt::get_current_package (); 01602 01603 m_output_file_name = msdevdir + package + ".dswnew"; 01604 01605 m_output_file = fopen (m_output_file_name.c_str (), "wb"); 01606 if (m_output_file != NULL) 01607 { 01608 m_PACKAGE = package; 01609 dsw_header_fragment.wincopy (m_output_file, 1, 01610 &m_PACKAGE); 01611 01612 int i; 01613 01614 dsw_all_project_header_fragment.wincopy (m_output_file, 1, 01615 &m_PACKAGE); 01616 01617 for (i = 0; i < constituents.size (); i++) 01618 { 01619 const Constituent& constituent = constituents[i]; 01620 01621 if (constituent.type == Library) 01622 { 01623 m_CONSTITUENT = constituent.name; 01624 m_CONSTITUENTSUFFIX = constituent.suffix; 01625 dsw_all_project_dependency_fragment.wincopy (m_output_file, constituent.variables, 3, 01626 &m_PACKAGE, 01627 &m_CONSTITUENT, 01628 &m_CONSTITUENTSUFFIX); 01629 } 01630 else 01631 { 01632 m_CONSTITUENT = constituent.name; 01633 m_CONSTITUENTSUFFIX = constituent.suffix; 01634 dsw_all_project_dependency_fragment.wincopy (m_output_file, constituent.variables, 3, 01635 &m_PACKAGE, 01636 &m_CONSTITUENT, 01637 &m_CONSTITUENTSUFFIX); 01638 } 01639 01640 } 01641 01642 dsw_all_project_trailer_fragment.wincopy (m_output_file, 01643 1, &m_PACKAGE); 01644 01645 for (i = 0; i < constituents.size (); i++) 01646 { 01647 const Constituent& constituent = constituents[i]; 01648 01649 if (constituent.type == Library) 01650 { 01651 m_CONSTITUENT = constituent.name; 01652 m_CONSTITUENTSUFFIX = constituent.suffix; 01653 dsw_project_fragment.wincopy (m_output_file, 01654 constituent.variables, 3, 01655 &m_PACKAGE, 01656 &m_CONSTITUENT, 01657 &m_CONSTITUENTSUFFIX); 01658 } 01659 else 01660 { 01661 m_CONSTITUENT = constituent.name; 01662 m_CONSTITUENTSUFFIX = constituent.suffix; 01663 dsw_project_fragment.wincopy (m_output_file, constituent.variables, 3, 01664 &m_PACKAGE, 01665 &m_CONSTITUENT, 01666 &m_CONSTITUENTSUFFIX); 01667 } 01668 } 01669 01670 dsw_trailer_fragment.wincopy (m_output_file, 1, &m_PACKAGE); 01671 01672 terminate (); 01673 } 01674 01675 m_output_file_name = msdevdir + "all.dspnew"; 01676 01677 m_output_file = fopen (m_output_file_name.c_str (), "wb"); 01678 if (m_output_file != NULL) 01679 { 01680 dsp_all_fragment.wincopy (m_output_file, 1, &m_PACKAGE); 01681 terminate (); 01682 } 01683 01684 return (0); 01685 } |
|
|
Definition at line 135 of file cmt_generators.h. Referenced by MSDEVGenerator(), and reset(). |
|
Definition at line 137 of file cmt_generators.h. Referenced by MSDEVGenerator(), and reset(). |
|
Definition at line 139 of file cmt_generators.h. Referenced by MSDEVGenerator(), and reset(). |
|
Definition at line 136 of file cmt_generators.h. Referenced by MSDEVGenerator(), and reset(). |
|
Definition at line 140 of file cmt_generators.h. Referenced by MSDEVGenerator(), and reset(). |
|
Definition at line 138 of file cmt_generators.h. Referenced by MSDEVGenerator(), and reset(). |
|
Definition at line 131 of file cmt_generators.h. Referenced by MSDEVGenerator(), and reset(). |
|
Definition at line 130 of file cmt_generators.h. Referenced by MSDEVGenerator(), and reset(). |
|
Definition at line 132 of file cmt_generators.h. Referenced by MSDEVGenerator(), and reset(). |
|
Definition at line 128 of file cmt_generators.h. Referenced by MSDEVGenerator(), and reset(). |
|
Definition at line 129 of file cmt_generators.h. Referenced by MSDEVGenerator(), and reset(). |
|
Definition at line 133 of file cmt_generators.h. Referenced by MSDEVGenerator(), and reset(). |
|
Definition at line 126 of file cmt_generators.h. Referenced by reset(). |