Annotation of mstools/mfc/src/makefile, revision 1.1.1.3

1.1       root        1: # Makefile : Builds a Foundation class library variant.
                      2: #
                      3: # Usage: NMAKE CLEAN        (removes all intermediary files)
                      4: #    or: NMAKE options      (builds one library variant (see below))
                      5: # Note that an NMAKE CLEAN should be performed before building a new variant.
                      6: #
                      7: # 'Options' are one of each of:
                      8: #   "MODEL=M"            (defaults to M)
                      9: #           Any of the following models are accepted: S (small), M (medium),
1.1.1.3 ! root       10: #           C (compact), L (large) or N (Windows NT).
        !            11: #   "TARGET=W"           (defaults to W)
1.1       root       12: #           Any of the following platforms are accepted: R (real-mode DOS),
1.1.1.3 ! root       13: #           or W (windows).
1.1       root       14: #   "DLL"              (defaults to 0)
                     15: #           If this item is 1, a DLL version of the library is generated.
                     16: #           If this item is 0, then a normal library is generated.
                     17: #           Only Large model versions of DLLs are supported.
                     18: #   "DEBUG"             (defaults to 1)
                     19: #           If this item is 1, debugging support is compiled into
                     20: #           the library.  If this item is 0, then debugging support
                     21: #           is disabled.  Debug support does not include CodeView information.
                     22: #   "CODEVIEW=0"           (defaults to 2, always)
                     23: #           If this item is 1 CodeView information is compiled into
                     24: #           the library.  You must use the /CODEVIEW link option
                     25: #           in addition, when linking your executable.  If this item
                     26: #           is 2, then only selected modules will be compiled with
                     27: #           CodeView information.  You must use the link option /CODEVIEW.
                     28: #           A value of 0 indicates that no CodeView information is to be
                     29: #           generated.
                     30: #   "OBJ=.\obj"          (defaults to '$$(MODEL)$(TARGET)$(DEBUG)'
                     31: #           This optional specification specifies where temporary OBJ files
                     32: #           are stored during the build process.  The directory is created or
                     33: #           removed as necessary.
                     34: #   "OPT="               (no default value)
                     35: #           This allows additional compiler options to be added to the build.
                     36: #           If more than one switch is desired, put double-quotes around the
                     37: #           whole OPT= argument, e.g., "OPT=/J /W3".
                     38: #   "NO_PCH=1" 
                     39: #           Set this item to override the default use of precompiled headers
                     40: #
                     41: #   The default is to build MODEL=M TARGET=W DEBUG=1
                     42: #
                     43: #
                     44: #############################################################################
                     45: # Standard tools
                     46: 
                     47: CPP=cl
                     48: CC=cl
1.1.1.3 ! root       49: CV=/Zi
        !            50: 
        !            51: !if "$(MODEL)"=="n" || "$(MODEL)"=="N"
        !            52: _NTWIN=1
        !            53: !else
        !            54: !if "$(OS)"=="Windows_NT"
        !            55: !error MODEL=N required for Windows NT
        !            56: !endif
1.1       root       57: !endif
                     58: 
                     59: #############################################################################
                     60: # Parse these options:
                     61: 
                     62: !ifndef DEBUG
                     63: DEBUG=1
                     64: !endif
                     65: 
                     66: !ifndef DLL
                     67: DLL=0
                     68: !else
1.1.1.3 ! root       69: !ifndef _NTWIN
1.1.1.2   root       70: # DLL must be large model, except under Windows/NT.
1.1       root       71: MODEL=l
                     72: !endif
1.1.1.2   root       73: !endif
1.1       root       74: 
                     75: !ifndef TARGET
                     76: TARGET=W
                     77: !endif
                     78: 
                     79: !ifndef MODEL
                     80: MODEL=M
                     81: !endif
                     82: 
                     83: !ifndef CODEVIEW
                     84: CODEVIEW=2
                     85: !endif
                     86: 
                     87: !if "$(DEBUG)" != "0"
                     88: DEBUGSUF=D
                     89: DEBDEFS=/D_DEBUG
1.1.1.3 ! root       90: !ifndef _NTWIN
1.1       root       91: DEBOPTS=/Odr /f
1.1.1.3 ! root       92: !else
        !            93: DEBOPTS=/Od
1.1       root       94: !endif
                     95: !else
                     96: DEBUGSUF=
                     97: DEBDEFS=
                     98: DEBOPTS=/Oxt
                     99: !endif
                    100: 
                    101: !if "$(CODEVIEW)" == "1"
1.1.1.3 ! root      102: DEBOPTS=$(DEBOPTS) $(CV)
1.1       root      103: !endif
                    104: 
                    105: # CVEXTRA used for select CodeView information (main files only)
                    106: !if "$(CODEVIEW)" == "2"
1.1.1.3 ! root      107: CVEXTRA=$(CV)
1.1       root      108: !endif
                    109: 
                    110: !if "$(MODEL)"=="s" || "$(MODEL)"=="S"
                    111: CL_MODEL=/AS
                    112: !else
                    113: !if "$(MODEL)"=="m" || "$(MODEL)"=="M"
                    114: CL_MODEL=/AM
                    115: !else
                    116: !if "$(MODEL)"=="c" || "$(MODEL)"=="C"
                    117: CL_MODEL=/AC
                    118: !else
                    119: !if "$(MODEL)"=="l" || "$(MODEL)"=="L"
                    120: CL_MODEL=/AL
                    121: !else
                    122: !if "$(MODEL)"=="n" || "$(MODEL)"=="N"
                    123: # Windows NT
1.1.1.3 ! root      124: CL_MODEL=/D_NTWIN
1.1       root      125: !else
                    126: !error MODEL must be one of S, M, L, or N
                    127: 
                    128: !endif
                    129: !endif
                    130: !endif
                    131: !endif
                    132: !endif
                    133: 
                    134: !if "$(TARGET)"=="r" || "$(TARGET)"=="R"
1.1.1.3 ! root      135: !ifndef _NTWIN
        !           136: TARGDEFS=/D_DOS
1.1       root      137: TARGOPTS=
                    138: EXPFLAG=
                    139: !else
1.1.1.3 ! root      140: !if "$(CPU)" == "MIPS"
        !           141: TARGDEFS=/D_MIPS_=1
        !           142: !else
        !           143: TARGDEFS=/D_X86_=1
        !           144: !endif
1.1       root      145: TARGOPTS=
                    146: EXPFLAG=
                    147: !endif
                    148: !else
                    149: 
                    150: !if "$(TARGET)"=="w" || "$(TARGET)"=="W"
                    151: MKWIN=1
1.1.1.3 ! root      152: !ifndef _NTWIN
1.1       root      153: TARGDEFS=/D_WINDOWS
                    154: TARGOPTS=/GA /GEs /G2
                    155: EXPFLAG=/GEe
1.1.1.3 ! root      156: !else
        !           157: !if "$(CPU)" == "MIPS"
        !           158: TARGDEFS=/D_WINDOWS /D_MIPS_=1
        !           159: !else
        !           160: TARGDEFS=/D_WINDOWS /D_X86_=1
        !           161: !endif
        !           162: TARGOPTS=/Gd
        !           163: EXPFLAG=
1.1       root      164: !endif
                    165: 
                    166: !else
                    167: 
                    168: !error TARGET must be one of W, R
                    169: 
                    170: !endif
                    171: !endif
                    172: 
                    173: 
1.1.1.3 ! root      174: # REVIEW_NT: workaround for NMAKE bug
1.1       root      175: !if "$(OBJ)" == ""
                    176: !if "$(DLL)" != "0"
1.1.1.2   root      177: D=$$$(MODEL)$(TARGET)$(DEBUGSUF).dll
1.1.1.3 ! root      178: !else
        !           179: D=$$$(MODEL)$(TARGET)$(DEBUGSUF)
1.1       root      180: !endif
                    181: !else
                    182: D=$(OBJ)
                    183: !endif
                    184: 
                    185: DEFS=$(DEBDEFS) $(TARGDEFS)
                    186: CL_OPT=/W3 $(DEBOPTS) $(TARGOPTS) $(OPT)
                    187: 
                    188: !if "$(DLL)" == "0"
                    189: # Normal library
                    190: GOAL=$(MODEL)afxc$(TARGET)$(DEBUGSUF)
                    191: !else
                    192: # DLL library (SS!=DS) - only Large model supported (compact model is possible)
                    193: GOAL=$(MODEL)afxd$(TARGET)$(DEBUGSUF)
1.1.1.3 ! root      194: !ifndef _NTWIN
1.1       root      195: CL_MODEL=$(CL_MODEL)w
                    196: TARGOPTS=/GD /G2
1.1.1.2   root      197: !else
                    198: TARGOPTS=/D_WINDLL
                    199: !endif
1.1       root      200: # /GD will define _WINDLL
                    201: !endif
                    202: 
1.1.1.3 ! root      203: 
1.1       root      204: #############################################################################
                    205: # Library Components
                    206: 
                    207: OBJECT=$D\object.obj $D\except.obj $D\dumpcont.obj $D\abort.obj \
                    208:        $D\assert.obj $D\archive.obj $D\archivex.obj $D\memory.obj \
                    209:        $D\validadd.obj $D\dumpinit.obj $D\version.obj
                    210: 
                    211: FILES=$D\file.obj $D\filetxt.obj $D\filemem.obj $D\filex.obj
                    212: 
                    213: COLLECTIONS=$D\array_b.obj $D\array_d.obj $D\array_o.obj $D\array_p.obj \
                    214:        $D\array_s.obj $D\array_w.obj $D\list_o.obj $D\list_p.obj \
                    215:        $D\list_s.obj $D\map_pp.obj $D\map_pw.obj $D\map_so.obj \
                    216:        $D\map_sp.obj $D\map_ss.obj $D\map_wo.obj $D\map_wp.obj $D\plex.obj
                    217: 
                    218: MISC=$D\string.obj $D\stringex.obj $D\time.obj
                    219: 
                    220: WINDOWS=$D\window.obj $D\wingdi.obj $D\winctrl.obj $D\winstr.obj \
                    221:        $D\winapp.obj $D\winmain.obj $D\winmenu.obj $D\winmdi.obj $D\trace.obj
                    222: 
1.1.1.3 ! root      223: !ifndef _NTWIN
1.1       root      224: WINEXTRAS=$D\penctrl.obj $D\winbtn.obj $D\windlgs.obj
1.1.1.3 ! root      225: !else
        !           226: WINEXTRAS=$D\winbtn.obj $D\windlgs.obj
1.1       root      227: !endif
                    228: 
                    229: !if "$(DLL)" == "0"
                    230: OLE= $D\olemisc.obj $D\olefile.obj $D\olecli.obj $D\oleui.obj $D\oleui2.obj \
                    231:        $D\olesvr.obj
                    232: !else
                    233: OLE= # OLE not supported for DLLs
                    234: !endif
                    235: 
                    236: OBJS=$(OBJS) $(OBJECT) $(FILES) $(COLLECTIONS) $(MISC)
                    237: 
                    238: !ifdef MKWIN
                    239: OBJS=$(OBJS) $(WINDOWS) $(WINEXTRAS) $(OLE)
                    240: !endif
                    241: 
                    242: 
                    243: #############################################################################
                    244: # Set CPPFLAGS for use with .cpp.obj and .c.obj rules
                    245: # Define rule for use with OBJ directory
                    246: # C++ uses a PCH file
                    247: 
                    248: CPPFLAGS=$(CPPFLAGS) $(CL_STANDARD) $(CL_MODEL) $(CL_OPT) $(DEFS) 
                    249: 
                    250: !ifndef NO_PCH
                    251: PCH_FILE=$D\afxpch.pch
                    252: CPPFLAGS=$(CPPFLAGS) /Yu /Fp$(PCH_FILE)
                    253: !else
                    254: PCH_FILE=
                    255: !endif
                    256: 
                    257: CFLAGS=$(CFLAGS) $(CL_STANDARD) $(CL_MODEL) $(CL_OPT) $(DEFS) 
                    258: 
                    259: .SUFFIXES : .cpp
                    260: 
                    261: .cpp{$D}.obj:
                    262:        $(CPP) @<<
                    263:                $(CPPFLAGS) /c /Fo$@ $<
                    264: <<
                    265: 
                    266: .c{$D}.obj:
                    267:        $(CC) @<< 
                    268:                $(CFLAGS) /c /Fo$@ $<
                    269: <<
                    270: 
                    271: #############################################################################
                    272: # Goal to build
                    273: 
                    274: goal: $D ..\lib\$(GOAL).lib
                    275: 
                    276: $D:
                    277:        IF NOT EXIST $D mkdir $D
                    278: 
                    279: clean:
                    280:        -erase $D\*.obj
                    281:        -erase $D\*.pch
                    282:        -rmdir $D
                    283: 
                    284: 
                    285: #############################################################################
                    286: # Precompiled header file
                    287: 
                    288: !ifndef NO_PCH
                    289: INC_DIR=..\include
                    290: HDRS=$(INC_DIR)\afx.h $(INC_DIR)\afx.inl $(INC_DIR)\afxcoll.h \
                    291:                $(INC_DIR)\afxwin.h $(INC_DIR)\afxwin.inl $(INC_DIR)\afxmsg.h \
                    292:                $(INC_DIR)\afxres.h \
                    293:                $(INC_DIR)\afxole.h $(INC_DIR)\afxoleui.h
                    294: 
                    295: $D\object.obj $(PCH_FILE): object.cpp $(HDRS)
1.1.1.2   root      296:        $(CPP) /c /Yc /Fp$(PCH_FILE) $(CL_STANDARD) $(CL_MODEL) $(CL_OPT) $(DEFS) $(CVEXTRA) /Fo$D\object.obj object.cpp
                    297: !else
                    298: $D\object.obj: object.cpp
                    299:        $(CPP) $(CPPFLAGS) $(CVEXTRA) /c /Fo$D\object.obj object.cpp
1.1       root      300: !endif
                    301: 
                    302: ############################################################################
                    303: # CodeView for select files
                    304: !if "$(CODEVIEW)"=="2"
                    305: $D\memory.obj : memory.cpp
                    306:        $(CPP) $(CPPFLAGS) $(CVEXTRA) /c /Fo$D\memory.obj memory.cpp
                    307: 
                    308: !ifdef MKWIN
                    309: $D\winmain.obj : winmain.cpp
                    310:        $(CPP) $(CPPFLAGS) $(CVEXTRA) /c /Fo$D\winmain.obj winmain.cpp
                    311: 
                    312: $D\window.obj : window.cpp
                    313:        $(CPP) $(CPPFLAGS) $(CVEXTRA) /c /Fo$D\window.obj window.cpp
                    314: 
                    315: $D\winapp.obj : winapp.cpp
                    316:        $(CPP) $(CPPFLAGS) $(CVEXTRA) /c /Fo$D\winapp.obj winapp.cpp
                    317: !endif
                    318: !endif
                    319: 
1.1.1.3 ! root      320: 
1.1       root      321: #############################################################################
                    322: # Windows 3.0 loader export/version number
                    323: $D\version.obj : version.cpp
                    324:        $(CPP) @<<
                    325: $(CPPFLAGS) $(EXPFLAG) /c /Fo$D\version.obj version.cpp
                    326: <<
                    327: 
                    328: 
                    329: #############################################################################
                    330: # Library results
                    331: 
                    332: ..\lib\$(GOAL).lib: $D $(OBJS)
                    333:        -erase $@
1.1.1.3 ! root      334: !ifndef _NTWIN
1.1       root      335:        lib /PAGESIZE:128 @<<
                    336: ..\lib\$(GOAL).lib
                    337: y
                    338: $(OBJS)
                    339: nul
                    340: ;
                    341: <<
1.1.1.3 ! root      342: !else
        !           343:        lib32 @<<
        !           344: -out:..\lib\$(GOAL).lib $(OBJS)
        !           345: <<
1.1       root      346: !endif
                    347: 
                    348: #############################################################################

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.