䥪⨢ ᯮ짮 GNU make 1.2.1 
䥪⨢ ᯮ짮 GNU Make 
(C)  ⮢, 2000 
 
  0. ।᫮ 
  1.  ⮤ ᯮ짮 GNU Make 
    1.1. ਬ ஥ 
    1.2. "ࠤ樮" ᯮᮡ ஥ make-䠩 
    1.3. ⮬᪮ ஥ ᯨ᪠ ꥪ 䠩 
    1.4. ⮬᪮ ஥ ᨬ⥩   䠩 
    1.5. "ᥭ" 䠩  室묨 ⥪⠬  ४ 
    1.6. ઠ ணࠬ  ࠧ묨 ࠬࠬ 樨 
    1.7. "ᥭ" ࠧ ᨩ ணࠬ  ⤥ ४ 
  2. GNU Make 
    2.1.  ࠧ ६ 
    2.2. 㭪樨 樨  ⥪⮬ 
    2.3.  ᯮᮡ  蠡 ࠢ 
    2.4. ६ VPATH 
    2.5. ४⨢ override 
    2.6. ४⨢ include 
    2.7.  ⥪  ப 
    2.8. ⮬᪨ ६ 
    2.9. "஢" ࠢ 
    2.10. Make-䠩, ᯮ㥬  㬮砭 
    2.11. 樠쭠 楫 .PHONY 
  3. ⨫ make 
    3.1. ࠢ 
    3.2.  ࠡ make 
      3.2.1. 롮  楫 
      3.2.2. ⨦ 楫 
      3.2.3. ࠡ⪠ ࠢ 
      3.2.4. ࠡ⪠ ᨬ⥩ 
      3.2.5. ࠡ⪠  
    3.3. ࠪ 楫   䠩 
    3.4. ਬ ࠡ make 
    3.5.   ਬ ࠡ make 
    3.6. ६ 
    3.7. ⮬᪨ ६ 
    3.8.  ࠢ 
  ਫ A. ஢ make-䠩  ࠧ 樮 ⥬ 
  ਫ B. ࣠ 娨 ⠫  ᫮ ஥ 
  ਫ C.  GCC 
  ਫ D. "᪨" ஥ - ⥪⮢ । 
0. ।᫮ 
 ⮩   뢠 ᢮  ࠡ  ⨫⮩ GNU Make ,  ⭮,  
⮤ ⮢ make-䠩.   ᢮ ⮤ 쭮 㤮, 
᪮  ।: 
  ⮬᪮ ஥ ᯨ᪠ 䠩  室묨 ⥪⠬ 
  ⮬  ᨬ⥩  砥 䠩 (  
   GCC) 
  "ࠫ" ᡮ ⫠筮  ࠡ祩 ᨩ ணࠬ 
  ஥ ᪮쪮  ࠧ.  ࠢ,    
ਭ樯 " ⮣ -  ᫮".  窮  㤮,   맢 
㤭  ᨮ.  ணࠬ 㤥 㦤 "த" 
᪢ , ய᪠   ⭮  ଠ樥.  訫 ந 
  㣮 ਭ樯.  "ᥭ" ,  " ", 
ᮤন  ࢮ . ⠫      ⥫ 
ࠪ. 
 砫    ⪮ 뢠,  祬   㤥  ,  
 ﬨ 㦭 , ⮡ ᯥ譮 ਭ    
ਠ.  ,  ,  筮  ਥ  
। ࠧ,  㪠뢠  ⥫ ,  묨 ᫥ 
।⥫쭮 . 
 ࠡ  ᯮ짮 GNU Make ᨨ 3.79.1.   ᨨ GNU 
Make (ਬ,  3.76.1  ਡ⨢ Slackware 3.5)  ࠢ쭮 
ࠡ  ਬ஬ "ࠤ樮" ஥ make-䠩 (-,  " 
ਭ"    蠡 ࠢ). 
1.  ⮤ ᯮ짮 GNU Make 
 ⮩   뢠 ᢮ ᯮᮡ ஥ make-䠩  ᡮન ஥⮢  
ᯮ짮 ணࠬ GNU Make   GCC (GNU Compiler Collection) . 
।,      ⨫⮩ GNU Make. ᫨   ⠪,  
 ᭠砫  2 - "GNU Make" . 
1.1. ਬ ஥ 
 ⢥ ਬ   ᯮ짮 "᪨" ஥ - ⥪⮢ 
।.  ⮨  ᪮쪨 䠩  室 ⥪⮬  몥 C++ 
(main.cpp, Editor.cpp, TextLine.cpp)  ᪮쪨 砥 䠩 
(main.h,Editor.h, TextLine.h). ᫨     ୥  "஭" 
ਠ ਢ   ਬ஢     譥 ࠭窥  
 www.geocities.com/SiliconValley/Office/6533 . ᫨ ୥   
㯥,   ਫ D ਢ ⨭ 䠩,  ᯮ  
ਬ. 
1.2. "ࠤ樮" ᯮᮡ ஥ make-䠩 
 ࢮ ਬ make-䠩 ஥ "ࠤ樮" ᯮᮡ.  室 䠩 
ᮡࠥ ணࠬ 室   ⠫: 
  example_1-traditional / 
    main.cpp 
    main.h 
    Editor.cpp 
    Editor.h 
    TextLine.cpp 
    TextLine.h 
    Makefile 
।,   樨 ணࠬ ᯮ  GCC,  
ꥪ 䠩  ७ ".o".  Makefile 룫廊 ⠪: 
    
    #
    #   example_1-traditional/Makefile
    #
    #   ਬ "ࠤ樮" ஥ make-䠩 
    #

    iEdit: main.o Editor.o TextLine.o 
        gcc $^ -o $@

    .cpp.o:
        gcc -c $<

    main.o:     main.h Editor.h TextLine.h
    Editor.o:   Editor.h TextLine.h
    TextLine.o: TextLine.h 
ࢮ ࠢ ⠢ make ४뢠 ணࠬ    
 ꥪ 䠩. ஥ ࠢ   ⮬,  ꥪ 䠩  
 ᮮ⢥ 室 䠩.   䠩  室 ⥪⮬ 
㤥 뢠  ४. 騥 ᪮쪮 ࠢ 㪠뢠,  
  䠩    ꥪ 䠩.  ᯮᮡ 
஥ make-䠩   㤮 ⮬ : 
  ॡ ""   ꥪ 䠩,    
  ணࠬ 
  ॡ "" ,     䠩   
    ꥪ 䠩 
  ᯮ塞 䠩 ணࠬ 頥  "⥪" ४. ᫨  㦭 
   ᪮쪮 ࠧ ਠ⮢ ணࠬ (ਬ, ⫠  
  ࠡ稩),   ࠧ  室   ਠ  㣮 ॡ 
   ४ ணࠬ   ⥫쭮 "ᬥ訢" 
  ࠧ ᨩ ꥪ 䠩. 
,  ࠤ樮 ᯮᮡ ஥ make-䠩   . 
⢥, 祬  ᯮᮡ   㤮 - ᢮ "ᮢ⨬". 
-,  ⠪ make-䠩  ଠ쭮 ࠡ  ᠬ "ॢ" 
 "᪨" ᨨ make (ਬ, nmake  Microsoft). ᫨  
"ᮢ⨬"  㦭,   ᨫ쭮  ᥡ , ᯮ짮 
ப ﬨ ⨫ GNU Make. ஡㥬   ⪮ 
"ࠤ樮" 室. 
1.3. ⮬᪮ ஥ ᯨ᪠ ꥪ 䠩 
"筮" ᫥  ꥪ 䠩, 室  ணࠬ - 筮 
㤭 ࠡ, ,  ,   ⮬⨧஢. 㬥 
"⮩ " த: 
    iEdit: *.o
        gcc $< -o $@
 ࠡ⠥, ⠪   ⥭ ⮫쪮 騥    ꥪ 
䠩.  ᯮ   ᫮ ᯮᮡ,  ᭮  ।, 
  䠩  室 ⥪⮬   ᪮஢  ᪮  
ᮡࠥ ணࠬ.  ⮤ ⮨   蠣: 
   ᯨ᮪  䠩  室 ⥪⮬ ணࠬ ( 䠩  
  ७ ".cpp").  ⮣  ᯮ짮 㭪 wildcard. 
  ८ࠧ ᯨ᮪ 室 䠩  ᯨ᮪ ꥪ 䠩 ( 
  ७ ".cpp"  ७ ".o").  ⮣  ᯮ짮 
  㭪樥 patsubst. 
騩 ਬ ᮤন ஢  make-䠩: 
  example_2-auto_obj / 
    main.cpp 
    main.h 
    Editor.cpp 
    Editor.h 
    TextLine.cpp 
    TextLine.h 
    Makefile 
 Makefile ⥯ 룫廊 ⠪: 
    #
    #   example_2-auto_obj/Makefile
    #
    #   ਬ ⮬᪮ ஥ ᯨ᪠ ꥪ 䠩
    #

    iEdit: $(patsubst %.cpp,%.o,$(wildcard *.cpp))
        gcc $^ -o $@ 

    %.o: %.cpp
        gcc -c $<

    main.o:     main.h Editor.h TextLine.h
    Editor.o:   Editor.h TextLine.h
    TextLine.o: TextLine.h 
᮪ ꥪ 䠩 ணࠬ ந ⮬᪨. 砫   
㭪樨 wildcard 砥 ᯨ᮪  䠩  ७ ".cpp", 室 
 ४ਨ ஥. ⥬,   㭪樨 patsubst, 祭 ⠪ 
ࠧ ᯨ᮪ 室 䠩, ८ࠧ  ᯨ᮪ ꥪ 䠩. 
Make-䠩 ⥯ ⠫  㭨ᠫ -  訬 ﬨ   
ᯮ짮  ᡮન ࠧ ணࠬ. 
1.4. ⮬᪮ ஥ ᨬ⥩   䠩 
"筮" ᫥ ᨬ⥩ ꥪ 䠩   䠩 - 
⨥   ⮬⥫쭮  ⭮, 祬 "筮" ᫥ ꥪ 
䠩. 뢠 ⠪ ᨬ 易⥫쭮 㦭 -   ࠧࠡ⪨ 
ணࠬ  䠩   쭮  (ᠭ ᮢ, 
ਬ, ࠤ樮 ࠧ   䠩). ᫨  㪠뢠 
ᨬ ꥪ 䠩  ᮮ⢥  䠩,   
᫮ ,  ࠧ ꥪ 䠩 ணࠬ  ᪮஢ 
 ᯮ짮 ࠧ ᨨ   ⮣  筮 䠩.  ,  
᢮ ।,  ਢ  筮    ࠡᯮᮡ 
ᮡ࠭ ணࠬ. 
᫥ ᨬ⥩ "" ॡ 쭮 ய⫨ ࠡ. 
筮   䠩  室 ⥪⮬  ᫨   
 䠩, 砥   #include.   ⮬,   
 䠩 ,  ᢮ ।,   ᥡ 㣨  
䠩, ⠪  ਤ ᫥  "楯" ᨬ⥩. 
⨫ GNU Make  ᬮ ᠬ⥫쭮 ந ᯨ᮪ ᨬ⥩, 
᪮  ⮣ ਤ "뢠"  䠩  室 ⥪⮬ -  
, ࠧ㬥,  㦥  ।  "⥭樨".  , 㤮 
 ஥ ᨬ⥩  ⮬⨧஢, ᫨ ᯮ짮 
  GCC.  ᮢ⭮ ࠡ  make  GCC  
᪮쪮 権: 
       樨 祭 
      -M   䠩  室 ⥪⮬ ९ 㤥 뤠  
      ⠭ 뢮 ᯨ᮪ ᨬ⥩   ࠢ  ணࠬ make.  
      ᯨ᮪ ᨬ⥩  ᠬ 室 䠩,  ⠪  䠩, 
      砥   ४⨢ #include <_䠩>  #include "_䠩". 
      ᫥ ᪠ ९  ⠭ ࠡ,  樨 
      ꥪ 䠩  ந室. 
      -MM 祭  -M,   ᯨ᮪ ᨬ⥩  ⮫쪮 ᠬ 
      室 䠩,  䠩, 砥   ४⨢ #include 
      "_䠩" 
      -MD 祭  -M,  ᯨ᮪ ᨬ⥩ 뤠   ⠭ 
      뢮,  뢠  ⤥ 䠩 ᨬ⥩.  ⮣ 䠩 
      ନ   室 䠩 ⥬   ७  ".d". 
      ਬ, 䠩 ᨬ⥩  䠩 main.cpp 㤥 뢠 main.d.  
      ⫨稥   -M,  室  ࠧ,   뢠 
      ᫥ 䠧 ᪠ ९. 
      -MMD 祭  -MD,   ᯨ᮪ ᨬ⥩  ⮫쪮 ᠬ 
      室 䠩,  䠩, 砥   ४⨢ #include 
      "_䠩" 

   ⠡   ࠡ  ᯮᮡ -   砥 
 뤠 ⮫쪮 ᯨ᮪ ᨬ⥩  稢 ࠡ (樨 -M  
-MM).  㣮 砥  ந室  筮, ⮫쪮    
ꥪ⭮ 䠩    䠩 ᨬ⥩ (樨 -MD  -MMD).  
। ᯮ짮 ன ਠ -     㤮  
 ⮬ : 
    -  室 䠩 㤥 ஥    
  ᮮ⢥騩  䠩 ᨬ⥩ 
  ஥ 䠩 ᨬ⥩ ந室 "ࠫ쭮"  ᭮ ࠡ⮩ 
    ࠪ᪨  ࠦ  ६ 樨 
   権 -MD  -MMD,  ।  ⮬ : 
    ४⨢ #include <_䠩>     ⮫쪮 
  "⠭",   ᢮ ᮡ⢥  䠩,    
   (ਬ,  䠩  ਪ ⥪ LIB). 
   뢠     ᯨ᮪ 砥   
   䠩,  ⮬ ᫥  "⠭". 
᫥ ⮣  䠩 ᨬ⥩ ନ஢, 㦭 ᤥ  㯭묨 
⨫ make. ⮣     ४⨢ include. 
    include $(wildcard *.d) 
   ᯮ짮 㭪樨 wildcard.  
    include *.d 
㤥 ࠢ쭮 ࠡ ⮫쪮  ⮬ 砥, ᫨  ⠫ 㤥 室 
   䠩  ७ ".d". ᫨ ⠪ 䠩 ,  make ਩ 
, ⠪  ௨ 㤠  ⪥ "ந"  䠩 (  
       権!). ᫨  ᯮ짮 㭪 
wildcard,   ⢨ ᪮ 䠩,  㭪  ୥  
ப. , ४⨢ include  㬥⮬   ⮩ ப, 㤥 
ந஢,  뢠 訡.   ⠢  ਠ 
make-䠩   "᪮" ஥: 
  example_3-auto_depend / 
    main.cpp 
    main.h 
    Editor.cpp 
    Editor.h 
    TextLine.cpp 
    TextLine.h 
    Makefile 
  룫廊 Makefile  ⮣ ਬ: 
    #
    #   example_3-auto_depend/Makefile
    # 
    #   ਬ ⮬᪮ ஥ ᨬ⥩   䠩
    #

    iEdit: $(patsubst %.cpp,%.o,$(wildcard *.cpp))
        gcc $^ -o $@ 

    %.o: %.cpp
        gcc -c -MD $<

    include $(wildcard *.d) 
᫥ 襭 ࠡ make ४ ஥ 㤥 룫拉 ⠪: 
  example_3-auto_depend / 
    iEdit 
    main.cpp 
    main.h 
    main.o 
    main.d 
    Editor.cpp 
    Editor.o 
    Editor.d 
    Editor.h 
    TextLine.cpp 
    TextLine.o 
    TextLine.d 
    TextLine.h 
    Makefile 
  ७ ".d" -  ᣥ஢ ஬ GCC 䠩 
ᨬ⥩. , ਬ,  룫廊 䠩 Editor.d,  ஬ ᫥ 
ᨬ  䠩 Editor.cpp: 
    Editor.o: Editor.cpp Editor.h TextLine.h 
     䠩 - Editor.cpp, Editor.h  TextLine.h, 
䠩 Editor.cpp 㤥 ४஢  祭  ᨨ 䠩 
Editor.o. 
  ᠭ ⮤ ⪨? ,  ᮦ,   
⮪.  ,   ,  ᫨誮 ⢥.   ⮬,  
⨫ make ࠡ뢠 make-䠩 "  ਥ". 砫 㤥 ࠡ⠭ 
४⨢ include   make-䠩  祭 䠩 ᨬ⥩,  ⥬,  
"஬ 室",  㦥 믮 室 ⢨  ᡮન ஥. 

砥   "⥪饩" ᡮન ᯮ 䠩 ᨬ⥩, 
ᣥ஢  ६ "।饩" ᡮન.  ࠢ,   뢠 
஡.     ⮬ 砥, ᫨ -  
 䠩  - 稭 ४⨫ ᢮ ⢮. 
ᬮਬ ⮩ ਬ. ।,    䠩 main.cpp  main.h: 
 main.cpp: 
    #include "main.h"

    void main()
    {
    } 
 main.h: 
    // main.h
 ⠪ 砥, ନ஢ ஬ 䠩 ᨬ⥩ main.d 㤥 
룫拉 ⠪: 
    main.o: main.cpp main.h
, ᫨  २ 䠩 main.h  main_2.h,  ᮮ⢥騬 ࠧ 
 䠩 main.cpp, 
 main.cpp: 
    #include "main_2.h"

    void main()
    {
    } 
 । ᡮઠ ஥  㤠祩, ᪮ 䠩 ᨬ⥩ 
main.d 㤥 뫠   騩   䠩 main.h. 
室  ⮩ 樨  㦨 㤠 䠩 ᨬ⥩ main.d.  
ᡮઠ ஥ ன ଠ쭮  㤥 ᮧ   ⮣ 䠩, 
뫠 㦥   䠩 main_2.h: 
    main.o: main.cpp main_2.h
 २  㤠 - "୮" 筮 䠩, 
   ᮡ ஥, 㤠 ।⥫쭮  ꥪ 
䠩  䠩 ᨬ⥩. 
1.5. "ᥭ" 䠩  室묨 ⥪⠬  ४ 
ਢ  ।饬 ࠣ make-䠩  ࠡᯮᮡ   ᯥ宬 
  ᯮ짮  ᡮન  ணࠬ. ,  㢥祭 
ࠧ ணࠬ, ⠭  祭 㤮 ࠭  䠩  室묨 
⥪⠬   ⠫.  ⠪ 砥  । "ࠧ"   ࠧ 
४, ࠦ騬   ஥.  ⮣ 㦭  
஢ make-䠩. ⮡  ࠢ 
   %.o: %.cpp
        gcc -c $< 
⠫ ࠡᯮᮡ,  ᯮ ६ VPATH,  ன  
 ४ਨ,   ᯮ 室 ⥪.  ᫥饬 ਬ  
⨫ 䠩 Editor.cpp  Editor.h  ⠫ Editor,  䠩 TextLine.cpp  
TextLine.h  ⠫ TextLine: 
  example_4-multidir / 
    main.cpp 
    main.h 
    Editor / 
      Editor.cpp 
      Editor.h 
    TextLine / 
      TextLine.cpp 
      TextLine.h 
    Makefile 
  룫廊 Makefile  ⮣ ਬ: 
    #
    #   example_4-multidir/Makefile
    # 
    #   ਬ "ࠧᥭ" 室 ⥪⮢  ࠧ ४
    #

    source_dirs := . Editor TextLine

    search_wildcards := $(addsuffix /*.cpp,$(source_dirs)) 

    iEdit: $(notdir $(patsubst %.cpp,%.o,$(wildcard $(search_wildcards))))
        gcc $^ -o $@ 

    VPATH := $(source_dirs)
     
    %.o: %.cpp
        gcc -c -MD $(addprefix -I,$(source_dirs)) $<

    include $(wildcard *.d) 
 ࠢ  ।騬 ਠ⮬ make-䠩  ௥ ᫥騥 : 

   ࠭ ᯨ᪠ ४਩  室묨 ⥪⠬   ⤥ 
  ६ source_dirs, ᪮  ᯨ᮪  㪠뢠  
  ᪮쪨 . 
   ᪠  㭪樨 wildcard (६ search_wildcards) ந 
  "᪨" 室  ᯨ᪠ ४਩ source_dirs 
  ᯮ ६ VPATH  ⮣, ⮡ 蠡 ࠢ  ᪠ 
  䠩 室 ⥪⮢  㪠 ᯨ᪥ ४਩ 
   ࠧ蠥 ᪠  䠩   ४  
  室묨 ⥪⠬.  ⮣ ᯮ 㭪 addprefix  䫠 -I 
   GCC. 
   ନ஢ ᯨ᪠ ꥪ 䠩,   室 䠩 "㡨ࠥ" 
   ⠫,   ᯮ (  㭪樨 notdir) 
1.6. ઠ ணࠬ  ࠧ묨 ࠬࠬ 樨 
  室  祭 ᪮쪨 ਠ⮢ ணࠬ, 
 뫨 ᪮஢ -ࠧ.  ਬ - ⫠筠  ࠡ 
ᨨ ணࠬ.  ⠪   ᯮ  ⮤: 
   ਠ ணࠬ ᮡ     ⮣  make-䠩. 
  室 ன  ""  make-䠩 १ ࠬ, 
  । ணࠬ make   ப. 
  䨣樨 ணࠬ   쪨  䠩,  
뢠 make  㦭묨 ࠬࠬ: 
  example_5-multiconfig / 
    main.cpp 
    main.h 
    Editor / 
      Editor.cpp 
      Editor.h 
    TextLine / 
      TextLine.cpp 
      TextLine.h 
    Makefile 
    make_debug 
    make_release 
 make_debug  make_release -   䠩, ᯮ㥬  ᡮન 
ᮮ⢥⢥ ⫠筮  ࠡ祩 ᨩ ணࠬ. , ਬ,  
룫廊  䠩 make_release: 
    make  compile_flags="-O3 -funroll-loops -fomit-frame-pointer" 
 ,  ப  祭 ६ compile_flags 祭  
窨, ⠪   ᮤন ஡.  䠩 make_debug 룫廊 
筮: 
    make  compile_flags="-O0 -g" 
  룫廊 Makefile  ⮣ ਬ: 
    #
    #   example_5-multiconfig/Makefile
    # 
    #   ਬ 祭 ᪮쪨 ᨩ ணࠬ    make-䠩 
    #

    source_dirs := . Editor TextLine

    search_wildcards       := $(addsuffix /*.cpp,$(source_dirs)) 
    override compile_flags += -pipe

    iEdit: $(notdir $(patsubst %.cpp,%.o,$(wildcard $(search_wildcards))))
        gcc $^ -o $@ 

    VPATH := $(source_dirs)
     
    %.o: %.cpp
        gcc -c -MD $(addprefix -I,$(source_dirs)) $(compile_flags) $<

    include $(wildcard *.d) 
६ compile_flags 砥 ᢮ 祭   ப , , 
ᯮ  樨 室 ⥪⮢.  ᪮७ ࠡ , 
 ࠬࠬ 樨  䫠 -pipe.    
室 ᯮ짮 ४⨢ override   ६ 
compile_flags  make-䠩. 
1.7. "ᥭ" ࠧ ᨩ ணࠬ  ⤥ ४ 
 ⮬ 砥 ᫨  ᮡ ᪮쪮 ਠ⮢   ⮩  ணࠬ 
(ਬ, ⫠  ࠡ ), ⠭ 㤮  
१ 樨      ⠫.  室   ਠ  
㣮 室  ४஢ ணࠬ   
⥫쭮 "ᬥ訢" ꥪ 䠩 ࠧ ᨩ. 
 襭 ⮩ ஡   १ 樨  ᨨ 
ணࠬ  ᢮ ⤥ ⠫. , ਬ, ⫠筠  ணࠬ 
(  ꥪ 䠩) 頥  ⠫ debug,  ࠡ  
ணࠬ -  ⠫ release: 
  example_6-multiconfig-multidir / 
    debug / 
    release / 
    main.cpp 
    main.h 
    Editor / 
      Editor.cpp 
      Editor.h 
    TextLine / 
      TextLine.cpp 
      TextLine.h 
    Makefile 
    make_debug 
    make_release 
 ᫮ 砫  ⮬, ⮡ ⠢ ணࠬ make  
१ ࠡ  ࠧ ४ਨ. ஡ ࠧ ਠ,  襫  
뢮,  ᠬ   - ᯮ짮 䫠 --directory  맮 
make.  䫠 ⠢ ⨫ । 砫 ࠡ⪨ make-䠩, ᤥ 
⠫, 㪠   ப, "⥪騬". 
, ਬ,  룫廊  䠩 make_release, ᮡ騩 ࠡ 
 ணࠬ (१ 樨 頥  ⠫ release): 
    mkdir  release
    make    compile_flags="-O3 -funroll-loops -fomit-frame-pointer" \
          --directory=release \
          --makefile=../Makefile 
 mkdir   㤮⢠ - ᫨ 㤠 ⠫ release,   
᫥饩 ᡮથ  㤥 ᮧ .  砥 "⠢"  ⠫ 
(ਬ, bin/release)  ⥫쭮 ᯮ짮 䫠 -p.  
--directory ⠢ make । 砫 ࠡ ᤥ 㪠 ४ 
release ⥪饩.  --makefile 㪠 ணࠬ make,  室 
make-䠩 ஥.  ⭮襭  "⥪饩" ४ਨ release,  㤥 
ᯮ  "த⥫᪮" ⠫. 
 䠩  ᡮન ⫠筮 ਠ ணࠬ (make_debug) 룫廊 
筮. 稥 ⮫쪮   ४ਨ, 㤠  १ 
樨 (debug)  㣮  䫠 樨: 
    mkdir   debug
    make    compile_flags="-O0 -g" \
          --directory=debug \
          --makefile=../Makefile 
 ⥫쭠  make-䠩  ᡮન "᪮" ஥ 
⥪⮢ ।: 
    #
    #   example_6-multiconfig-multidir/Makefile
    # 
    #   ਬ "ࠧᥭ" ࠧ ᨩ ணࠬ  ⤥ ४
    #

    program_name := iEdit 
    source_dirs  := . Editor TextLine

    source_dirs      := $(addprefix ../,$(source_dirs))
    search_wildcards := $(addsuffix /*.cpp,$(source_dirs))

    $(program_name): $(notdir $(patsubst %.cpp,%.o, $(wildcard $(search_wildcards) ) ) )
        gcc $^ -o $@ 

    VPATH := $(source_dirs) 

    %.o: %.cpp
        gcc -c -MD $(compile_flags) $(addprefix -I,$(source_dirs)) $<

    include $(wildcard *.d) 
 ⮬ ⥫쭮 ਠ  "뭥"  ᯮ塞 䠩 ணࠬ  
⤥ ६ program_name.   ⮣ ⮡ ஢  
make-䠩  ᡮન 㣮 ணࠬ,   筮  ᥣ  
᪮쪮  ப. 
᫥ ᪠  䠩 make_debug  make_release ४  ᫥ 
ਬ஬ 룫廊 ⠪: 
  example_6-multiconfig-multidir / 
    debug / 
      iEdit 
      main.o 
      main.d 
      Editor.o 
      Editor.d 
      TextLine.o 
      TextLine.d 
    release / 
      iEdit 
      main.o 
      main.d 
      Editor.o 
      Editor.d 
      TextLine.o 
      TextLine.d 
    main.cpp 
    main.h 
    Editor / 
      Editor.cpp 
      Editor.h 
    TextLine / 
      TextLine.cpp 
      TextLine.h 
    makefile 
    make_debug 
    make_release 
,  ꥪ 䠩  ࠡ祩  ⫠筮 䨣樨 ணࠬ 
  ࠧ ४ਨ. 㤠   ⮢ ᯮ塞 䠩  
䠩 ᨬ⥩. 
 ⮩    ᢮ ⮤ ࠡ  make-䠩. ⠫  
    "⥫" ࠪ. 
   ਫ A  뢠 ஡,     
  ।஢ make-䠩  ࠧ 樮 ⥬ 
   ਫ B  뢠 ᢮  ᯮᮡ ࣠樨 ॢ ⠫  
  ᫮ ஥⮢. 
   ਫ C   묨 ﬨ   ᯮ짮  
  GCC 
2. GNU Make 
 ⮩   ⪮    ணࠬ GNU Make, 묨  
  ᠭ ᢮ make-䠩,  ⠪ 㪠   ⫨  
"ࠤ樮" ᨩ make. ।,     ਭ樯 ࠡ 
 ணࠬ.  ⨢ 砥 ᭠砫   3 - ⨫ make . 
GNU Make -   ணࠬ make ࠭塞   
ணࠬ ᯥ祭 (Free Software Foundation - FSF)  ࠬ ஥ GNU ( 
www.gnu.org ).  ᠬ ᢥ  ணࠬ  㬥樨   
"譥 ࠭窥" ணࠬ www.gnu.org/software/make   ࠭窥 Paul 
D. Smith -   ஢ GNU Make ( www.paulandlesley.org/gmake). 
ணࠬ GNU Make  祭 ஡   ᠭ 㬥,  
ன  ⥫쭮 ४ . ᫨    㯠  
୥,   㬥樥  ଠ Info,     
⠢ 襣 ਡ⨢ Linux.  ஦  㬥樥  ଠ 
man-࠭窨 (man make) -  ࠢ,  ᮤন  뢮  ᨫ쭮 
ॢ ଠ. 
2.1.  ࠧ ६ 
GNU Make ন  ᯮᮡ  ६,  ᪮쪮 
ࠧ  .  ᯮᮡ - ࠤ樮,    '=': 
    compile_flags = -O3 -funroll-loops -fomit-frame-pointer 
 ᯮᮡ ন  ਠ ⨫ make.   ࠢ, 
ਬ,     몥 . 
    #define  compile_flags  "-O3 -funroll-loops -fomit-frame-pointer" 
祭 ६,     '=', 㤥 ᫥   
 ᯮ짮. ਬ,  ࠡ⪥ make-䠩: 
    var1 = one
    var2 = $(var1) two 
    var1 = three

    all: 
        @echo $(var2) 
 ࠭ 㤥 뤠 ப "three two". 祭 ६ var2 㤥 
᫥ ।⢥   믮  echo,  㤥 ।⠢ 
ᮡ ⥪饥 祭 ६ var1,  ஬  ப " two".  
᫥⢨ -     ६   ६ 䨣஢    
ࠢ  ࠦ, ⠪    ਢ  ᪮筮 ४ᨨ. GNU 
Make ᯮ  樨  뢠 ࠡ make-䠩. 騩 
ਬ 맮 訡: 
    compile_flags = -pipe $(compile_flags)
GNU Make ন ⠪  ன,  ᯮᮡ  ६ -  
  ':=': 
    compile_flags := -O3 -funroll-loops -fomit-frame-pointer 
 ⮬ 砥 ६ ࠡ⠥  "" ⥪⮢ ६  
-  몮 ணࠬ஢.  ਡ⥫  ⮣ 
ࠦ  몥 C++: 
    string   compile_flags = "-O3 -funroll-loops -fomit-frame-pointer"; 
祭 ६    ࠡ⪨  ᢠ. ᫨, 
ਬ,  
    var1 := one
    var2 := $(var1) two 
    var1 := three

    all:
        @echo $(var2) 
  ࠡ⪥ ⠪ make-䠩  ࠭ 㤥 뤠 ப "one two". 
६  "" ᢮   ᨬ  ⮣,   
஢ ᢠ    ਬ ᫥.     ६  
殮 ᢮     ᥡ   ""   "⥪⮢ 
६". 
 ᢮ make-䠩    ਬ  ':='.  ᯮᮡ   
 㤮  .    䥪⨢, ⠪  祭 
६     ࠧ   ᯮ짮. ஡  
 ᯮᮡ  ६    㬥樨  GNU Make  
ࠧ "The Two Flavors of Variables" . 
2.2. 㭪樨 樨  ⥪⮬ 
⨫ GNU Make ᮤন 讥 ᫮  㭪権, 㫨 
⥪⮢묨 ப   䠩.  ⭮  ᢮ make-䠩  
ᯮ 㭪樨 addprefix, addsuffix, wildcard, notdir  patsubst.  맮 
㭪権 ᯮ ᨭ⠪ 
 $(_㭪樨  ࠬ1, ࠬ2 ... ) 
㭪 addprefix ᬠਢ ன ࠬ  ᯨ᮪ ᫮ ࠧ 
஡.  砫  ᫮   ப, ।   ⢥ 
ࢮ ࠬ. ਬ,  १ 믮 make-䠩: 
    src_dirs := Editor TextLine
    src_dirs := $(addprefix ../../, $(src_dirs))

    all:
        @echo $(src_dirs)
 ࠭ 㤥 뢥 
    ../../Editor ../../TextLine 
,     ४ਨ  䨪 "../../". 㭪 
addprefix 㦤  ࠧ "Functions for File Names" 㪮⢠  GNU 
Make. 
㭪 addsuffix ࠡ⠥ 筮 㭪樨 addprefix, ⮫쪮  
㪠 ப    ᫮. ਬ,  १ 믮 
make-䠩: 
    source_dirs := Editor  TextLine
    search_wildcards := $(addsuffix /*.cpp, $(source_dirs))

    all:
        @echo $(search_wildcards)
 ࠭ 㤥 뢥 
    Editor/*.cpp  TextLine/*.cpp 
,     ४ਨ  䨪 "/*.cpp". 㭪 
addsuffix 㦤  ࠧ "Functions for File Names" 㪮⢠  GNU 
Make. 
㭪 wildcard "" ।  蠡  ᪮쪮 蠡  
ᯨ᮪ 䠩, 㤮⢮ ⨬ 蠡.   ४ਨ Editor 
室 䠩 Editor.cpp,   ४ਨ TextLine - 䠩 TextLine.cpp: 
  wildcard_example / 
    Editor / 
      Editor.cpp 
    TextLine / 
      TextLine.cpp 
    makefile 
  १ 믮 ⠪ make-䠩: 
    search_wildcards := Editor/*.cpp  TextLine/*.cpp
    source_files := $(wildcard $(search_wildcards))

    all:
        @echo $(source_files)
 ࠭ 㤥 뢥 
    Editor/Editor.cpp  TextLine/TextLine.cpp 
,  蠡 ८ࠧ  ᯨ᪨ 䠩. 㭪 wildcard ஡ 
㦤  ࠧ "The Function wildcard" 㪮⢠  GNU Make. 
㭪 notdir  ""   䠩  ४ਨ,   
室. ਬ,  १ 믮 make-䠩: 
    source_files := Editor/Editor.cpp  TextLine/TextLine.cpp
    source_files := $(notdir $(source_files))

    all:
        @echo $(source_files)
 ࠭ 㤥 뢥 
    Editor.cpp TextLine.cpp 
,    䠩 ࠭ ""  ⨬ 䠩. 㭪 notdir 
㦤  ࠧ "Functions for File Names" 㪮⢠  GNU Make. 
㭪 patsubst   㪠 ࠧ ᫮, 室騥  
蠡.  ਭ  ࠬ - 蠡,  ਠ ᫮  室 
ப. 室 ப ᬠਢ  ᯨ᮪ ᫮, ࠧ ஡. 
 ᫮, 室饥  㪠 蠡,   ਠ⮬ ᫮. 
 蠡  ᯮ짮 ᯥ樠 ᨬ '%',  砥 " 
⢮ ந ᨬ". ᫨ ᨬ '%' 砥   ਠ 
᫮ (஬ ࠬ),    ⥪⮬, ᮮ⢥騬 ᨬ '%' 
 蠡. ਬ,  १ 믮 make-䠩: 
    source_files := Editor.cpp  TextLine.cpp 
    object_files := $(patsubst %.cpp, %.o, $(source_files))

    all:
        @echo $(object_files) 
 ࠭ 㤥 뢥 
    Editor.o  TextLine.o 
,    ᫮ 砭 ".cpp"   ".o". 㭪 patsubst 
 ன,  ⪨ ਠ    砥,    
䨪 ᫮ (ਬ,  ७   䠩).  ⪨ 
ਠ 룫廊 ⠪: 
    $(_६:._䨪=._䨪) 
ਬ "⪨" ਠ  ।騩 ਬ   ⠪: 
    source_files := Editor.cpp  TextLine.cpp 
    object_files := $(source_files:.cpp=.o)

    all:
        @echo $(object_files)
㭪 patsubst 㦤  ࠧ "Functions for String Substitution and 
Analysis" 㪮⢠  GNU Make. 
2.3.  ᯮᮡ  蠡 ࠢ 
 "ࠤ樮" ਠ make 蠡 ࠢ    
権, : 
    .cpp.o:  
        gcc $^ -o $@ 
   ⢨ ࠢ  䠩  ।묨 ७ﬨ (".cpp" 
 ".o"   砥). 
GNU Make ন  㭨ᠫ 室 -  ᯮ짮 蠡 
 䠩.   蠡 ᯮ ᨬ '%',  砥 
"᫥⥫쭮  ᨬ ந쭮 ".  '%'  ࠢ 
 ࠢ  ⥪⮬,  ᮮ⢥ ᨬ '%'   
.   ମ , ਢ  ਬ   
⠪: 
    %.o: %.cpp
        gcc $^ -o $@
 ᢮ make-䠩    ମ  蠡 ࠢ, ⮬  
   㤮 (蠡  蠡 ࠢ ⥯  
 ᨭ⠪)  㭨ᠫ쭮 (   ⮫쪮 䠩, 
⫨騥 ᢮ ७ﬨ). 
2.4. ६ VPATH 
  ६ VPATH   ᯨ᮪ ⠫,  蠡 ࠢ 
 ᪠ ᨬ.  ᫥饬 ਬ: 
    VPATH := Editor TextLine
    
    %.o: %.cpp
        gcc -c $< 
make 㤥 ᪠ 䠩  ७ ".cpp" ᭠砫  ⥪饬 ⠫,  
⥬,  室,  ⠫ Editor  TextLine.   ᯮ 
 , ⠪  । ᯮ 室 ⥪  娨 
⠫, ࠦ   ணࠬ. 
६ VPATH 뢠   "VPATH: Search Path for All Dependencies" 
㪮⢠  GNU Make.  ࠭窥 Paul D. Smith     
"How Not to Use VPATH" ( paulandlesley.org/gmake/vpath.html),  ன 
㦤 "ࠢ" ⨫ ᯮ짮 ६ VPATH. 
2.5. ४⨢ override 
६  GNU Make  ᮧ   ᢮ 祭 ࠧ묨 
ᯮᮡ: 
    make-䠩 
  "⮬᪨" ᮧ ணࠬ make  ६ । 
   १  ப  맮 ணࠬ make 
᫥ 砩 ⠥ "ᯥ樠". ᫨ ६  १  
ப,   make-䠩    祭 "" ᯮᮡ. 
ᬮਬ ⮩ make-䠩: 
    compile_flags := -pipe $(compile_flags)
    
    all:
        echo $(compile_flags) 
।,  ६ compile_flags 뫠  १  ப  
᪥ ணࠬ make: 
    make  compile_flags="-O0 -g" 
 १ ࠡ⪨ make-䠩  ࠭ 㤥 뢥 ப: 
    -O0 -g 
  ⪠  祭 ६ compile_flags  make-䠩 
뫠 ந஢. ᫨ -⠪  室   
६,  뫠     ப, 㦭 ᯮ짮 
४⨢ override. ४⨢ 頥 ।  ६,   
 : 
    override compile_flags := -pipe $(compile_flags)

    all:
        echo $(compile_flags) 
  १ ࠡ⪨ make-䠩  ࠭ 㤥 뤠 ப: 
    -pipe -O0 -g 
2.6.  ⥪  ப 
  室  ⥪  饩 ६.  ⮩ 
楫 㦨  "+=". 塞 ⥪    ⥪⮢ 
⠭⮩, ⠪   뫪  㣨 ६: 
    compile_flags += -pipe
    compile_flags += $(flags) 
 ᯮ짮 ⮣ , "⨯" ६ (. ࠧ 2.1 " 
ࠧ ६")   - ""  "ᠬ",  
"⥪⮢ ६" -०  ⠪묨. 
᫨ ६     ப,  -०   
 祭  make-䠩 㦭 ᯮ짮 ४⨢ override.  ᫥饬 
ਬ ।,  ६ compile_flags    ப: 
    override compile_flags += -pipe
    override compile_flags += $(flags) 
2.7. ४⨢ include 
  ४⨢ include    ࠡ뢠 make-䠩 㣨 
䠩. ⠥  筮 ४⨢ #include  몠 C  C++.  
砥  ४⨢, ࠡ⪠ "⥪饣" make-䠩 ਮ⠭  
make ६ "४砥"  ࠡ 㪠  ४⨢ 䠩. 
४⨢ include     祭  make-䠩 - 
"",  ⮬᪨ ᣥ஢ 㣨 ணࠬ ࠣ⮢. 
 ४⨢ include   㪠   ᪮쪮  䠩, 
ࠧ ஡.  ⢥  䠩  ᯮ짮 蠡: 
    include common.mak

    include main.d Editor.d TextLine.d

    include *.d 
  ४⨢ 䠩  ⢮ -  make ।ਬ  
"ᮧ" ,    ⮣ ⨣, 뤠 ᮮ饭  訡. 
४⨢ include   ᯨ᪮ 䠩: 
    include 
 . 
2.8. ⮬᪨ ६ 
ணࠬ GNU Make ন 讥 ᫮ ⮬᪨ ६.  ᢮ 
make-䠩  ᯮ ᫥騥 ⮬᪨ ६: 
       ⮬᪮ ६ 祭 
      $@  楫 ࠡ뢠 ࠢ 
      $<  ࢮ ᨬ ࠡ뢠 ࠢ 
      $^ ᮪  ᨬ⥩ ࠡ뢠 ࠢ 

 ᯨ᮪ ⮬᪨ ६ ਢ  ࠧ "Automatic 
Variables" 㪮⢠  GNU Make. 
2.9. "஢" ࠢ 
 make-䠩   ᪮쪮 ࠢ,   楫.  
⠪ 砥    " ". ਬ, ᫥騥  ࠢ: 

    TextLine.o: TextLine.cpp
        gcc -c $<
    
    TextLine.o: TextLine.h 
 ࠢ: 
    TextLine.o: TextLine.cpp TextLine.h
        gcc -c $< 
  蠡 ࠢ ⠪  "஢": 
    %.o: %.cpp
        gcc -c $<
    
    TextLine.o: TextLine.h 
   ,    ਬ ⮫쪮    ࠢ 㪠 
ᯮ塞  -      室 믮.  
稨    ࠢ, make 뤠 ।०饥 ᮮ饭  " 
"  ਭ ⮫쪮   ᫥ ࠢ. 
2.10. Make-䠩, ᯮ㥬  㬮砭 
᫨  맮 ணࠬ GNU Make  㪠뢠 ,  make-䠩 ᫥ 
ࠡ뢠,   ⠥   ࠡ 䠩 GNUmakefile, makefile  
Makefile (  ⠪ 浪). 㪮⢮  GNU Make ४  
Makefile  make-䠩, ᯮ㥬  㬮砭.  "䠢⭮" ஢ 
 䠩  ४ਨ, ⠪  㤥 ᯮ   砫 ᯨ᪠. 
2.11. 樠쭠 楫 .PHONY 
 ࠤ樮 ॠ,  ணࠬ make   ᯮᮡ 㧭, 祬 
  楫, 㪠  ࠢ.      ⢨, 
⠪   䠩. 室 ⮫쪮  "譥 " ࠢ, ࠧ  
砨 . ⨫ make    ᪥ 䠩  , ஥ 
㪠  ⢥ 楫. ᫨ ⠪ 䠩 ,  楫 ⠥  
䠩. 
 楫,    ⢨, ⠪ 室  祭 . 
-,  ⠪ 楫  砩 ᮢ   - 䠩  
४ਨ. , -, make  樮쭮  ᢮ ६,  
᪮  䠩. 
 ⨫ GNU Make  ᯮᮡ   楫 ࠪ묨.  
⮣ ᯮ 堭 "ᯥ樠 楫". 樠쭠 楫 -  , 
஥  ᯥ樠쭮 祭,  ᯮ  ⢥ 楫.  
⮣, ਬ, ⮡  ᫥ 楫 ࠪ묨, 筮 
   ࠢ  ᯥ樠쭮 楫 .PHONY.  ᫥饬 ਬ 楫 
clean  ࠪ⭮: 
    .PHONY: clean
    
    clean:
        rm *.o *.d 
  ᯥ樠 楫 ᠭ   Special Built-in Target Names" 
㪮⢠  GNU Make. 
3. ⨫ make 
⨫ make, 室  ⠢ ࠪ᪨  Unix- 樮 
⥬ -  ࠤ樮 ।⢮, ਬ塞  ᡮન ணࠬ ஥⮢. 
  㭨ᠫ쭮 ணࠬ  襭 ப 㣠 ,   
䠩  ⮬᪨    㣨 䠩. 
 ᪥ ணࠬ make ⠥ 䠩  ᠭ ஥ (make-䠩) , 
  ᮤন, ।ਭ 室 ⢨.   
ᠭ ஥ ।⠢ ᮡ ⥪⮢ 䠩,  ᠭ ⭮襭  
䠩 ஥,  ⢨,  室 믮   ᡮન. 
3.1. ࠢ 
᭮ "ந⥫ ⮬" make-䠩  ࠢ (rules).  饬 
 ࠢ 룫廊 ⠪: 
    <楫_1> <楫_2> ... <楫_n>: <ᨬ_1> <ᨬ_2> ... <ᨬ_n> 
        <_1>
        <_2>
        ...
        <_n> 
 (target) -    १, ᯮᮡ ⨦ ண ᠭ 
 ࠢ.   ।⠢ ᮡ  䠩.  ⮬ 砥 ࠢ 
뢠,  ࠧ     ⮣ 䠩.  ᫥饬 
ਬ: 
    iEdit: main.o Editor.o TextLine.o 
        gcc  main.o Editor.o TextLine.o -o iEdit
楫  䠩 iEdit (ᯮ塞 䠩 ணࠬ). ࠢ 뢠,  
ࠧ     䠩 iEdit (᪮  ᫥ 
ꥪ 䠩). 
 ⠪    ண ⢨.  ⠪ 砥 ࠢ 
뢠,  ࠧ ᮢ蠥 㪠 ⢨.  ᫥饬 ਬ 
楫  ⢨ clean (⪠). 
    clean: 
        rm *.o iEdit
 த 楫 뢠 ᥢ楫 (pseudotargets)  ࠪ 楫 
(phony targets). 
ᨬ (dependency)-   "室 ", 室  
⨦ 㪠  ࠢ 楫.  ᪠  ᨬ -  
"।⥫쭮 ᫮"  ⨦ 楫. ᨬ  ।⠢ 
ᮡ  䠩.  䠩  ⢮,  ⮣ ⮡  뫮 
 㪠 楫.  ᫥饬 ࠢ: 
    iEdit: main.o Editor.o TextLine.o 
        gcc  main.o Editor.o TextLine.o -o iEdit
䠩 main.o, Editor.o  TextLine.o  ᨬﬨ.  䠩  
⢮  ⮣, ⮡ ⠫  ⨦ 楫 - ஥ 䠩 
iEdit. 
ᨬ ⠪    ண ⢨.  ⢨  
 ।⥫쭮 믮 । ⨦ 㪠  ࠢ 楫.  
᫥饬 ਬ ᨬ clean_obj   ⢨ (㤠 
ꥪ 䠩 ணࠬ): 
    clean_all:  clean_obj
        rm iEdit
        
    clean_obj:  
        rm *.o 
 ⮣ ⮡ 楫 clean_all 뫠 ⨣, 㦭 ᭠砫 믮 ⢨ 
(⨣ 楫) clean_obj. 
 -  ⢨,  室 믮    
⨦ 楫.  ᫥饬 ਬ: 
    iEdit: main.o Editor.o TextLine.o 
        gcc  main.o Editor.o TextLine.o -o iEdit
  맮  GCC. ⨫ make ⫨砥 ப, 
ᮤঠ騥 ,   ப make-䠩   ᨬ ⠡樨 
(ᨬ   9)  砫 ப.  ਢ  ਬ ப: 
    gcc  main.o Editor.o TextLine.o -o iEdit
 稭  ᨬ ⠡樨. 
3.2.  ࠡ make 
 make-䠩 ஥ ᮤন ᪮쪮 ࠢ.   ࠢ  
 楫   ᨬ. ᫮ ࠡ make  ⨦ 
楫,   ࠫ  ⢥  楫 (default goal). ᫨  
楫   ⢨ (  ࠪ⭮ 楫),   ࠡ make 
砥  믮 ᮮ⢥饣 ⢨. ᫨   楫 
  䠩,  ணࠬ make  ந ᠬ "ᢥ"  
㪠 䠩. 
3.2.1 롮  楫 
 楫   אַ 㪠   ப  ᪥ make.  
᫥饬 ਬ make 㤥 ६  楫 iEdit (  
 䠩 iEdit): 
    make iEdit
  ⮬ ਬ make   楫 clean ( ४  
ꥪ 䠩 ஥): 
    make clean
᫨  㪠뢠 - 楫   ப,  make 롨ࠥ  
⢥  , 祭  make-䠩 楫.  ᫥饬 ਬ: 
    iEdit: main.o Editor.o TextLine.o
        gcc  main.o Editor.o TextLine.o -o iEdit
    
    main.o: main.cpp
        gcc -c main.cpp 
            
    Editor.o: Editor.cpp
        gcc -c Editor.cpp

    TextLine.o: TextLine.cpp
        gcc -c TextLine.cpp

    clean:
        rm *.o
  ᫥  make-䠩 楫 (iEdit, main.o, Editor.o, 
TextLine.o, clean)  㬮砭  ⢥  㤥 ࠭ 楫 iEdit. 
奬筮, "孨 ஢" ⬠ ࠡ make  ।⠢ ⠪: 
    make()
    {
        _楫 = 샫()

        얥( _楫 )  
    }
3.2.2 ⨦ 楫 
᫥ ⮣   楫 ࠭, make ᪠ "⠭" 楤 
⨦ 楫. 砫  make-䠩  ࠢ, ஥ 뢠 ᯮᮡ 
⨦ ⮩ 楫 (㭪 ⨏ࠢ). ⥬,   ࠢ 
ਬ   ࠡ⪨ ࠢ (㭪 ࠡࠢ). 
    얥(  )
    {
        ࠢ = ⨏ࠢ(  )

        ࠡࠢ( ࠢ ) 
    }
3.2.3 ࠡ⪠ ࠢ 
ࠡ⪠ ࠢ ࠧ   ᭮ ⠯.  ࢮ ⠯ 
ࠡ뢠  ᨬ, ᫥  ࠢ (㭪 
ࠡ쇠ᨬ).  ஬ ⠯ ਭ 襭 - 㦭  믮 
㪠  ࠢ  (㭪 㦭믮슮).  室, 
᫥  ࠢ  믮 (㭪 믮슮). 
    ࠡࠢ( ࠢ )
    {
        ࠡ쇠ᨬ( ࠢ )
        
        ᫨ 㦭믮슮( ࠢ )
            {
            믮슮( ࠢ )
            } 
    }
3.2.4 ࠡ⪠ ᨬ⥩ 
㭪 ࠡ쇠ᨬ । ஢  ᫥  ࠢ 
ᨬ.      楫ﬨ - ࠢ.  
 ᨬ⥩ 믮 筠 楤 ⨦ 楫 (㭪 
얥).  ᨬ,    楫ﬨ,   
䠩.  ⠪ 䠩 ஢ 䠪  .   ⢨, make 
਩ 蠥 ࠡ  ᮮ饭  訡. 
    ࠡ쇠ᨬ( ࠢ )
    {
        横  i=1  ࠢ.᫮_ᨬ⥩
            {
            ᫨ 쒠( ࠢ.ᨬ[ i ] )
                {
                얥( ࠢ.ᨬ[ i ] ) 
                }
            
                {
                ஢썠稥( ࠢ.ᨬ[ i ] ) 
                } 
            } 
    }
3.2.5 ࠡ⪠  
 ⠤ ࠡ⪨  蠥  - 㦭  믮 ᠭ  
ࠢ   . ⠥,  㦭 믮  ᫨: 
     ⢨ (ࠪ⭮ 楫) 
     䠩  ⮣ 䠩   
  -  ᨬ⥩  ࠪ⭮ 楫 
     䠩  -  ᨬ⥩,   
  䠩,    ६ 䨪樨 祬 楫. 
 ⨢ 砥 (᫨    襯ਢ ᫮  믮) 
ᠭ  ࠢ   믮.  ਭ 襭  
믮  奬筮  ।⠢ ⠪: 
    㦭믮슮( ࠢ )
    {                                                       
        ᫨ ࠢ..ࠪ⭮()
            return  true 
       
        //  楫   䠩

        ᫨ ( ࠢ. )
            return  true 

        横  i=1  ࠢ.᫮_ᨬ⥩
            {
            ᫨ ࠢ.ᨬ[ i ].ࠪ⭮()
                return  true
            
                //  ᨬ   䠩
                {
                ᫨ ६䨪樨( ࠢ.ᨬ[ i ] )  >
                     ६䨪樨( ࠢ. )
                    return  true 
                }
            }

        return  false 
    }
3.3. ࠪ 楫   䠩 
 ࠧ make ⫨砥  ⢨   䠩? ࠤ樮 ਠ 
make 㯠 . 砫  䠩  ⠪ . ᫨ 䠩 ,  
⠥  楫  ᨬ   䠩. 
 ⨢ 砥 ⠥,       
饣 䠩,   ⢨.   ⨬  
ਠ⠬  , ᪮   ࠡ뢠 . 
 室  ᫨誮   ᫥騬 ᮮࠦ. -, ⨫ 
make  ᫨誮 樮쭮 室 ६,  ᪮  
 䠩,   ᠬ    ⢨. -,  
 室,  ⢨   ᮢ   - 䠩 
 ४਩.     ᡮ,  make-䠩 㤥 ࠡ 
ࠢ쭮. 
 ᨨ make । ᢮ ਠ 襭 ⮩ ஡. , 
ਬ,  ⨫ GNU Make  堭 (ᯥ樠쭠 楫 .PHONY),  
 ண  㪠,      ⢨. 
3.4. ਬ ࠡ make 
ᬮਬ,  ⨫ make 㤥 ࠡ뢠 ⠪ make-䠩: 
    iEdit: main.o Editor.o TextLine.o 
        gcc  main.o Editor.o TextLine.o -o iEdit
    
    main.o: main.cpp
        gcc -c main.cpp 
            
    Editor.o: Editor.cpp
        gcc -c Editor.cpp

    TextLine.o: TextLine.cpp
        gcc -c TextLine.cpp

    clean:
        rm *.o
।,   ४ਨ  ஥⮬ 室 ᫥騥 䠩: 
  main.cpp 
  Editor.cpp 
  TextLine.cpp 
। ⠪,  ணࠬ make 뫠 맢 ᫥騬 ࠧ: 
    make
  㪠   ப, ⮬ ᪠  롮 楫 
(㭪 샫).  楫 ⠭ 䠩 iEdit (ࢠ 楫 
 ࢮ ࠢ). 
 iEdit । 㭪樨 얥.  㭪  ࠢ, ஥ 
뢠 ࠡ뢠 楫.   砥,  ࢮ ࠢ make-䠩. 
  ࠢ ᪠ 楤 ࠡ⪨ (㭪 
ࠡࠢ). 
砫 । ࠡ뢠 ᠭ  ࠢ ᨬ (㭪 
ࠡ쇠ᨬ). ࢠ ᨬ - ꥪ 䠩 main.o. ᪮  
make-䠩  ࠢ  ⠪ 楫 (㭪 쒠 頥 true), 
  楫 main.o ᪠ 楤 얥. 
㭪 얥  ࠢ,  ᠭ 楫 main.o.  楫 ᠭ  
஬ ࠢ make-䠩.  ⮣ ࠢ ᪠ 㭪 
ࠡࠢ. 
㭪 ࠡࠢ ᪠  ࠡ⪨ ᨬ⥩ (㭪 
ࠡ쇠ᨬ).  ஬ ࠢ 㪠 ⢥ ᨬ - 
main.cpp.  楫  make-䠩  , ⮬ ⠥,  
ᨬ main.cpp   䠩. , ஢ 稥 ⮣ 
䠩  ᪥ (㭪 ஢썠稥) - ⠪ 䠩 .  ⮬ 
 ࠡ⪨ ᨬ⥩ 蠥. 
᫥ ࠡ⪨ ᨬ⥩, 㭪 ࠡࠢ ਭ 襭  ⮬, 
㦭  믮 㪠  ࠢ  (㭪 㦭믮슮). 
 ࠢ (䠩 main.o)  , ⮬  㦭 믮. 
㭪 믮슮 ᪠ 㪠  ࠢ  ( GCC), 
 १ 祣 ᮧ 䠩 main.o. 
 main.o ⨣ (ꥪ 䠩 main.o ஥).  make 
頥  ࠡ⪥ ⠫ ᨬ⥩ ࢮ ࠢ. ᨬ 
Editor.o  TextLine.o ࠡ뢠 筮.   믮   
⢨,    ᨬ main.o. 
᫥ ⮣,   ᨬ (main.o, Editor.o  TextLine.o) ࠡ⠭, 
蠥   室 믮 㪠  ࠢ  (㭪 
㦭믮슮). 
᪮ 楫 (iEdit)   䠩,      
,  ਭ 襭 믮 ᠭ  ࠢ  
(㭪 믮슮). 
ঠ  ࠢ  ᪠  GCC,  १ 祣 
ᮧ ᯮ塞 䠩 iEdit.  楫 (iEdit)⠪ ࠧ ⨣. 
 ⮬ ணࠬ make 蠥 ᢮ ࠡ. 
3.5.   ਬ ࠡ make 
ᬮਬ,  㤥 ⢮ ⨫ make, ᫨  ࠡ⪨ ᠭ  
।饩  make-䠩,  㤥 맢 ᫥騬 ࠧ: 
    make clean
  㪠   ப, ⮬  楫 ⠭ 
ࠪ⭠ 楫 clean.  clean । 㭪樨 얥.  㭪 
 ࠢ, ஥ 뢠 ࠡ뢠 楫.  㤥 ⮥ ࠢ 
make-䠩.   ࠢ ᪠ 楤 ࠡ⪨ (㭪 
ࠡࠢ). 
᪮  ࠢ  㪠 - ᨬ⥩, make ࠧ 室  
⠯ ࠡ⪨ 㪠  ࠢ .    ⢨, 
⮬  㦭 믮. 
  ࠢ  믮,  楫 clean, ⠪ ࠧ, ⠥ 
⨣⮩.  ⮬ ணࠬ make 蠥 ࠡ. 
3.6. ६ 
 ᯮ짮 ६  make-䠩 - 祭 㤮   
ᯮ㥬 ᢮⢮ make.  ࠤ樮  ⨫, ६  
ᥡ  ᠬ 몠 .   祭 ६ ᯮ 
 ᢠ. ਬ, ࠦ: 
    obj_list = main.o Editor.o TextLine.o
ᢠ ६ obj_list 祭 "main.o Editor.o TextLine.o" ( 
祪). ஡  ᨬ '='  砫 ࢮ ᫮ . 
騥  ᫥ ᫮ ஡ ⠪ . 祭 ६ 
 ᯮ짮   樨: 
    $(_६)
ਬ,  ࠡ⪥ ⠪ make-䠩: 
    dir_list = . .. src/include

    all:
        echo $(dir_list)
 ࠭ 㤥 뢥 ப: 
    . .. src/include
६   ⮫쪮 ᮤঠ ⥪⮢ ப,   "뫠"  
㣨 ६. ਬ,  १ ࠡ⪨ make-䠩: 
    optimize_flags = -O3
    compile_flags  = $(optimize_flags) -pipe
    
    all:
        echo $(compile_flags)
 ࠭ 㤥 뢥: 
    -O3 -pipe
   ᯮ짮 ६   make-䠩  
  來.  ⮣ ⮡  䨪 make-䠩,  
ࠧ "祢"   ᯨ᪨  ⤥ ६     
砫 make-䠩: 
    program_name = iEdit
    obj_list     = main.o Editor.o TextLine.o
    
    $(program_name): $(obj_list)
        gcc $(obj_list) -o $(program_name)  

    ... 
 ⠪ make-䠩  ᡮન 㣮 ணࠬ ᢥ   
᪮쪨 砫 ப. 
3.7. ⮬᪨ ६ 
⮬᪨ ६ -  ६  ᯥ樠묨 ,  
"⮬᪨" ਭ । 祭 । 믮 ᠭ  
ࠢ . ⮬᪨ ६  ᯮ짮  "饭" 
 ࠢ. , ਬ, ࠢ: 
  iEdit: main.o Editor.o TextLine.o
        gcc  main.o Editor.o TextLine.o -o iEdit
 ᯮ짮 ⮬᪨ ६   ᫥騬 ࠧ: 
  iEdit: main.o Editor.o TextLine.o
        gcc  $^  -o $@
 $^  $@  ⮬᪨ ६묨. ६ $^ 砥 
"ᯨ᮪ ᨬ⥩".   砥  맮  GCC  㤥 
뫠  ப "main.o Editor.o TextLine.o". ६ $@ 砥 " 
楫"  㤥  ⮬ ਬ 뫠   "iEdit". 
 ᯮ짮 ⮬᪨ ६ ᮢ襭 室 - ਬ, 
 蠡 ࠢ (     ᫥饩 ). 
3.8.  ࠢ 
 ࠢ (implicit rules  pattern rules) -  ࠢ,  
  ਬ  楫 㯯 䠩.  ⮬  ⫨稥   ࠢ 
- 뢠 ⭮襭  묨 䠩. 
ࠤ樮 ॠ樨 make ন ⠪ 뢠 "䨪"  
 蠡 ࠢ: 
    .<७_䠩_ᨬ⥩>.<७_䠩_楫>:
        <_1>
        <_2>
        ...
        <_n> 
ਬ, ᫥饥 ࠢ   ⮬,   䠩  ७ "o" 
  ᮮ⢥ 䠩  ७ "cpp": 
    .cpp.o:
        gcc -c $^ 
   ᯮ짮 ⮬᪮ ६ $^  । 
  䠩-ᨬ. ᪮ 蠡 ࠢ  
ਬ  ࠧ 䠩, ᯮ짮 ⮬᪨ ६ -  
⢥ ᯮᮡ 㧭   䠩 ᥩ  ࠢ. 
 ࠢ   make-䠩  ᤥ   
㭨ᠫ. ᬮਬ ⮩ ஥ 䠩: 
    iEdit: main.o Editor.o TextLine.o
        gcc $^ -o $@
         
    main.o: main.cpp
        gcc -c $^

    Editor.o: Editor.cpp
        gcc -c $^

    TextLine.o: TextLine.cpp
        gcc -c $^ 
 室 ⥪ ணࠬ ࠡ뢠  -   뢠 
 GCC.  ᯮ짮 蠡 ࠢ,  ਬ  ९ 
⠪: 
    iEdit: main.o Editor.o TextLine.o
        gcc $^ -o $@
         
    .cpp.o:
        gcc -c $^
 make   䠩 ஥ ࠢ, 뢠饥 ᯮᮡ ⨦ ᪮ 
楫 (.  3.2.2. "⨦ 楫", 㭪 ⨏ࠢ),    
ਭ  蠡 ࠢ.     ஢ -   
⢮  ࠢ  ⨦ ᪮ 楫. 
ਫ A. ஢ make-䠩  ࠧ 樮 ⥬ 
᫨,   樮 ⥬ Linux,  ࠡ⠥  樮묨 
⥬  Microsoft (DOS, Windows),   ।஢ make-䠩  
ࠧ ⥬   । 㤭. 
஡ ⮨  ⮬,  ਭ  Unix- 樮 ⥬ 
ଠ ࠭ ⥪⮢ 䠩, ᪮쪮 ⫨砥  ଠ DOS/Windows.  
Unix  ப ⥪⮢ 䠩 稢 ᨬ "ॢ ப" ( 
0x0A).  DOS  Windows ⥪⮢ ப ࠧ ன ᨬ - " 
⪨", "ॢ ப" (0x0D, 0x0A). 
Linux- ணࠬ GNU Make 㤥 ଠ쭮 ࠡ  make-䠩, 
ᠭ묨  । Linux.  ⨫ GNU Make  Windows ⠪ 㤥 
ଠ쭮 ࠡ  make-䠩, ⮢묨  । Windows. ஡ 
   ⮬ 砥, ᫨  ࠡ Linux-ᨥ ணࠬ 
GNU Make ⥪⮢ 䠩, ⮢  । DOS  Windows.  
   "ﭭ" - 筮  "࠭" make-䠩  
। Linux  ⥪⮢ । DOS/Windows, ⮡   "ᯮ祭". 
 ⫨稥   GCC,    ᨬ " 
⪨", GNU Make ᬠਢ   "" ᨬ,    
  .  १  ᫮, 室騥   ப, 
᪠, ⠪  ᧠     ᨬ " ⪨". 
 ᫥饬 ਬ  䠩 TextLine.o 㤥 ᪠ (  㤥 
⠢  ᨬ -  " ப"): 
    iEdit: main.o Editor.o TextLine.o
        gcc $^ -o $@ 
㬥,  ᪥   䠩  ⠪ "࠭"   make-䠩 
㤥 ࠡ ୮.  ᫮   ⥬,  뤠  ࠭ 
᪨ ᮮ饭 ⠪ ᪠ ( 뢮  ࠭ ᨬ " 
⪨" 頥   砫 ப)   ।⠢ ᮡ  
᫥ "뢪" ᫮. 
ᠭ ஡   ࠧ묨 ᯮᮡ. ࣠樮 ⮤ 襭 
-    ।஢ make-䠩, 室  "㦥த"   
।. 㣮  室 - "ਭ㤨⥫쭮" 㤠  make-䠩 ᨬ 
" ⪨" ( "" - ⥪⮢ ।஬,    
室饩 ணࠬ). 
ਫ B. ࣠ 娨 ⠫  ᫮ ஥ 
 ᫮ ஥⮢,   讣 ⢠ 䠩,  । 
 ᫮ ࣠ ⠫, 祬 ,  ਢ  ⢥ 
ਬ  ࠧ 1.7. "ᥭ ࠧ ᨩ ணࠬ  ⤥ 
४". ᭮  砥  ⮬, ⮡ 䠩  ࠧ 
"祭" 頫  ࠧ ⠫.   ஥ ॢ ⠫ 
룫廊 ਬ୮ ⠪: 
  _஥ / 
    bin / 
      linux_debug / 
      linux_release / 
      windows_debug / 
      windows_release / 
    doc / 
      README.txt 
    project / 
      Makefile 
      make_debug 
      make_release 
    src / 
 ⠫ bin  १ 樨 - ꥪ  ᯮ塞 䠩, 
⥪  ⮬ .  ⠫  "" 㤠 -  
᫥饩 樨  㤥 ⮬᪨ ᮧ .  ⮬ ⠫ 
   䨣権 ணࠬ  ᢮ ⤥ ४.  
ࠢ,    䨣樨 ணࠬ -     樮 
⥬ (Linux  Windows)  ⫠筠  ࠡ ᨨ ணࠬ. 
 ४ doc   ࠧ ⥪⮢ 䠩 - 㬥, 砭, 
ᯨ᮪ 訡  ⮬ .   ᯮ  䠩 README.txt. 
 ⠫ project 室 make-䠩 ஥   䠩, ᯮ㥬 
 ᡮન ணࠬ  ࠧ 䨣. 
 ⠫ src   室 ⥪ ணࠬ.  ४ਨ src  
᢮  ⠫, ࠦ   ணࠬ. 
 ਬ make-䠩,  ࠡ⠥   ன ४਩ 
஥: 
    #
    #   example_7-complex/project/Makefile 
    # 
    #   ਬ ஥  "᫮" ன ४਩ 
    #

    program_name := iEdit
    source_dirs  := . Editor TextLine 
    include_dirs := /c/aproj/lib  /c/aproj/lib/linux
    link_flags   := -static 
    
    source_dirs  := $(addprefix ../../src/, $(source_dirs) )
    source_files := $(wildcard $(addsuffix /*.cpp, $(source_dirs) ) )
    object_files := $(notdir $(source_files) )
    object_files := $(object_files:.cpp=.o)
    
    $(program_name): $(object_files)
        gcc $^ -o $@ $(link_flags) -pipe 
        
    VPATH := $(source_dirs)
    
    %.o: %.cpp 
        gcc $< -c $(compile_flags) $(addprefix -I, $(include_dirs)) $(addprefix -I, $(source_dirs)) -MD -pipe 2>log
    
    include $(wildcard *.d) 
᮪ ४਩,  ᯮ 䠩  室묨 ⥪⠬ (source_dirs), 
 ⭮⥫쭮 ⠫ src.   룫廊  䠩, ᮡ騩 
⫠  ணࠬ: 
    mkdir -p ../bin/linux_debug
    make  compile_flags="-O0 -g" \
          --directory=../bin/linux_debug \
          --makefile=../../project/Makefile
 䠩, ᮡ騩 ࠡ  ணࠬ 룫廊 筮: 
    mkdir -p ../bin/linux_release
    make  compile_flags="-O3 -funroll-loops -fomit-frame-pointer" \
          --directory=../bin/linux_release \
          --makefile=../../project/Makefile
ਫ C.  GCC 
GNU Compiler Collection (GCC) -  ᥬ⢮ ஢  몮 C, C++  
Object-C,  ꥤ 饩 孮  ࠭  ࠬ 
஥ GNU.  ࠭窠  室   
www.gnu.org/software/gcc/gcc.html 
   "⠭" ।⢮  樨  ணࠬ, 
室  ஥ GNU. GCC ⠪  ᭮ ஬ 樮 
⥬ Linux -      ⥬. 
ᨨ  
 GCC ࠧ 쬠 筮 - ணࠬ 蠥, ࠢ 
㦥 訡,   . ᥣ ⥫쭮   
 ᨥ      ࠡ⠥. ,    
  ন 㦭    ᮤন 訡,   
  ࠡᯮᮡ 㥬 ணࠬ.    
GCC     -v: 
    gcc -v 
⫠ 
"⠭" ।⢮  ⫠ ணࠬ, ᪮஢ ஬ GCC, 
 ⫠稪 GDB.  ⫠稪 ᢮ ࠭  ࠬ ஥ 
GNU.  ࠭窠 ⫠稪 室   
www.gnu.org/software/gdb/gdb.html. 
 ⮢ ⫠筮 ᨨ ணࠬ    GCC, 筮 
⪫ ⨬    ⫠筮 ଠ樨.  ⮣  
ᯮ ᫥騥 樨 樨: 
      -g ஢ ⫠ ଠ 
      -O0 ⪫ ⨬ 

⫠稪 GDB  ⥪⮢ 䥩  ப.   䥩 
  祭 㤮묨, ⮬   ᪮ 窮 
DataDisplayDebugger (DDD).  窠  ன  "⥪⮢묨" 
⫠稪, ॠ饩   㤮 ᪨ 䥩. ணࠬ DDD 
⠪ 室  ஥ GNU.   ࠭窠 室   
http://www.gnu.org/software/ddd. DataDisplayDebugger ࠡ⠥  । X-Windows. 

稩 ਠ 
 樨 ࠡ祣 ਠ ணࠬ,   ᨬ ⨬ 
 ᪮.   ਢ  ஬ 㢥祭 ࠧ ணࠬ,  
    ᫨誮 .   -  㢥祭 ࠧ 
ணࠬ  - .    ६ த⢨ ணࠬ 
ᥣ  墠⠥. 
 GCC  讥 ⢮ 権, ࠢ ᮬ 
樨  ⨬樨,  묨   ᯥਬ஢,  
ᨬ쭮 த⢨ ணࠬ.  ᢮ ஥⮢  ᯮ ᫥騥 
ன: 
       祭 
      -O3 ᨬ쭠 ⨬ 
      -fomit-frame-pointer  ᯮ짮 㪠⥫  ⥪ ३. 
       㤥 ᮢ ६  ⥪   ॣ ESP  
      ॣ EBP "᢮"  ᯮ짮  ⢥ ॣ 饣 
      祭. 
      -mcpu=pentium ⨬஢    Pentium ( ணࠬ 
       ० 㤥 ࠡ   i386) 

ࠡ⪠ ᪫祭 
᫨  ᯮ 堭 ᪫祭 (exceptions) 몠 C++,   
樨   祭 ᮮ⢥ : 
       樨 祭 
      -fexceptions  প 堭 ᪫⥫ 権 몠 
      C++ 

᪠  ᪠  
 㬮砭   ᮡ࠭ ணࠬ  ᪨ ﬨ 
⠭ ⥪.   ᥣ 㤮.  ⮣ ⮡ ⠭ 
⥪  ᪨, 㦭 ᯮ짮  --static.  ⮬ 
砥   "᪨" ,   ᢮ ࠡ  
ॡ  - 㦠 ⥪. 
祭 ⨭ 
 뢠   ᥬ ⨭ , 㥬 
஬.   ⠪ ⨭ : 
  ᬮ,     樨 ⨬樨 ࠦ  㥬  
  ᬮ,  ࠧ  ࠡ뢠    樨 
  몠 ணࠬ஢ 
   訡, 易  ࠢ쭮 ࠡ⮩ 樨   
  ,   筮 樨 뫨 祭  樨 ணࠬ 
 祭 ᥬ୮ ⨭,  ᯮ ᫥騥 樨  
GCC: 
       樨 祭 
      -S ⠭ ᫥ ⠤ 樨, । ⠤ ᥬ஢. 
      -fverbose-asm ஢ ⥫ ਨ  ᥬ୮ 
      ⨭.   "⥫ ਨ"  饭  ⥪ 
      ⨭,   ᨨ . 

   ,  㪠 䫠 -S  "⠭" 
 ᫥ 䠧 樨 ᥬ୮ ⨭,    
樨 뢠.  ᫥⢨ -  ᡮન ணࠬ   
樨 ᥬ ⨭ "ᮢ⨬"  ᮡ.    
⨭,  ᮡ ணࠬ,     㣮 ६.  祭 
⨭  筮 ᮧ ⤥  䠩,  ।  権 
樨 ᮤন 䫠 -S  -fverbose-asm. 
쬠    -   ⨭ ᯨ᮪  権 
樨,  뫨 祭   .   ⮬,  祭 
 権 (ਬ -O3)  "⮬᪨" ਢ  祭 㣨 
権,  㬥  GCC  ᥣ 筠  ᠭ  ᨬ⥩. 
 ᨨ GCC ᥣ   ⨭ ᯨ᮪ ᯮ㥬 権, 㣨 
ᨨ   ⮫쪮  稨 䫠 -fverbose-asm. 
७祭 訡  䠩 
 㬮砭,  GCC 뤠 訡  ⠭ ⮪ ᮮ饭  
訡 (䠩  ਯ஬ 2).    祭 㤮 - ᮮ饭  
訡   祭 묨  ஡묨,  "ப⪠" ࠭   
ᥣ 㯭. ⮬, , 筮, ७ࠢ ᮮ饭   䠩. 
 䠩 ⮬  ᬮ  ⠭ ।⢮. , ਬ, 
  룫拉 ࠢ  樨 室 ⥪⮢: 
    %.o: %.cpp
        gcc -c $< 2>log
 -pipe 
 GCC ࠡ뢠 ணࠬ  ᪮쪮 室,  
஬ १ 樨  ६ 䠩.    
᪮, ᫨ ᯮ짮 樥 -pipe.  祭 ⮩ 樨, ࠧ 
⠯ 樨 稭 ""  ᮡ  १ ६ 䠩,  
१   (pipes). 
  ᨬ " ⪨" 
 ⫨稥  ⨫ GNU Make,  GCC  "쭮" ⭮  
 ᨬ " ⪨"  㥬 ⥪ - ⠪ ᨬ 
 . ⮬, ஡  樨 室 ⥪⮢, 
⮢  । DOS/Windows,   . 
ਫ D. "᪨" ஥ - ⥪⮢ । 
 ࢮ  " ⮤ ᯮ짮 GNU Make"  ⢥ ਬ 
ᬠਢ "᪨" ஥ - ⥪⮢ ।.  ⮨   
䠩  室 ⥪⮬  몥 C++ (main.cpp, Editor.cpp  TextLine.cpp),  
⠪   䠩 (main.h, Editor.h, TextLine.h).  ਢ 
⨭  䠩. 
 main.cpp: 
    #include "main.h"

    void main()
    {
    } 
 main.h: 
    // main.h
 Editor.cpp: 
    #include "Editor.h" 
 Editor.h: 
    #include "TextLine.h" 
 TextLine.cpp: 
    #include "TextLine.h" 
 TextLine.h: 
    // TextLine.h
 
 // TextLine.h

 

 룫拉 ࠢ  樨 室 ⥪⮢: 

    %.o: %.cpp

        gcc -c $< 2>log

 -pipe 

 GCC ࠡ뢠 ணࠬ  ᪮쪮 室,  

஬ १ 樨  ६ 䠩.    

᪮, ᫨ ᯮ짮 樥 -pipe.  祭 ⮩ 樨, ࠧ 

⠯ 樨 稭 ""  ᮡ  १ ६ 䠩,  

१   (pipes). 

  ᨬ " ⪨" 

 ⫨稥  ⨫ GNU Make,  GCC  "쭮" ⭮  

 ᨬ " ⪨"  㥬 ⥪ - ⠪ ᨬ 

 . ⮬, ஡  樨 室 ⥪⮢, 

⮢  । DOS/Windows,   . 

ਫ D. "᪨" ஥ - ⥪⮢ । 

 ࢮ  " ⮤ ᯮ짮 GNU Make"  ⢥ ਬ 

ᬠਢ "᪨" ஥ - ⥪⮢ ।.  ⮨   

䠩  室 ⥪⮬  몥 C++ (main.cpp, Editor.cpp  TextLine.cpp),  

⠪  