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

1.1.1.4 ! root        1: # Makefile : Builds a Microsoft Foundation Class library variant.
        !             2: #
        !             3: # This is a part of the Microsoft Foundation Classes C++ library.
        !             4: # Copyright (C) 1992,93 Microsoft Corporation
        !             5: # All rights reserved.
        !             6: #
        !             7: # This source code is only intended as a supplement to the
        !             8: # Microsoft Foundation Classes Reference and Microsoft
        !             9: # WinHelp documentation provided with the library.
        !            10: # See these sources for detailed information regarding the
        !            11: # Microsoft Foundation Classes product.
1.1       root       12: #
                     13: # Usage: NMAKE CLEAN        (removes all intermediary files)
                     14: #    or: NMAKE options      (builds one library variant (see below))
                     15: # Note that an NMAKE CLEAN should be performed before building a new variant.
                     16: #
                     17: # 'Options' are one of each of:
1.1.1.3   root       18: #   "TARGET=W"           (defaults to W)
1.1.1.4 ! root       19: #           Any of the following targets are accepted: 
        !            20: #                              R (console mode),
        !            21: #              W (windows).
1.1       root       22: #   "DLL"              (defaults to 0)
                     23: #           If this item is 0, then a normal library is generated.
1.1.1.4 ! root       24: #           If this item is 1, a DLL version of the library is generated.
1.1       root       25: #   "DEBUG"             (defaults to 1)
                     26: #           If this item is 1, debugging support is compiled into
                     27: #           the library.  If this item is 0, then debugging support
                     28: #           is disabled.  Debug support does not include CodeView information.
1.1.1.4 ! root       29: #   "CODEVIEW=0"           (defaults to 1, always)
1.1       root       30: #           If this item is 1 CodeView information is compiled into
                     31: #           the library.  You must use the /CODEVIEW link option
                     32: #           in addition, when linking your executable.  If this item
                     33: #           is 2, then only selected modules will be compiled with
                     34: #           CodeView information.  You must use the link option /CODEVIEW.
                     35: #           A value of 0 indicates that no CodeView information is to be
                     36: #           generated.
                     37: #   "OBJ=.\obj"          (defaults to '$$(MODEL)$(TARGET)$(DEBUG)'
                     38: #           This optional specification specifies where temporary OBJ files
                     39: #           are stored during the build process.  The directory is created or
                     40: #           removed as necessary.
                     41: #   "OPT="               (no default value)
                     42: #           This allows additional compiler options to be added to the build.
                     43: #           If more than one switch is desired, put double-quotes around the
                     44: #           whole OPT= argument, e.g., "OPT=/J /W3".
                     45: #   "NO_PCH=1" 
                     46: #           Set this item to override the default use of precompiled headers
1.1.1.4 ! root       47: #   "PLATFORM=INTEL"     (defaults to INTEL)
        !            48: #           This option chooses the appropriate tools and sources for the
        !            49: #           different platforms support by Windows/NT.  Currently INTEL and
        !            50: #           MIPS are supported; more will be aded as they become available.
1.1       root       51: #
1.1.1.4 ! root       52: #   The default is to build PLATFORM=INTEL TARGET=W DEBUG=1
1.1       root       53: #
                     54: #
                     55: #############################################################################
1.1.1.4 ! root       56: # Define defaults if not defined
1.1       root       57: 
1.1.1.4 ! root       58: # Only NT 'MODEL' is supported by MFC 2.1
        !            59: MODEL=N
1.1.1.3   root       60: 
1.1.1.4 ! root       61: # Default to ALPHA platform
        !            62: !ifndef PLATFORM
        !            63: PLATFORM=ALPHA
1.1       root       64: !endif
                     65: 
1.1.1.4 ! root       66: # Default to DEBUG mode
1.1       root       67: !ifndef DEBUG
                     68: DEBUG=1
                     69: !endif
                     70: 
1.1.1.4 ! root       71: # Default to NOT DLL
1.1       root       72: !ifndef DLL
                     73: DLL=0
1.1.1.4 ! root       74: !endif
        !            75: 
        !            76: # Default Target to Windows
        !            77: !ifndef TARGET
        !            78: TARGET=w
        !            79: !endif
        !            80: 
        !            81: # Default Codeview Info
        !            82: !ifndef CODEVIEW
        !            83: !if "$(DEBUG)"=="1"
        !            84: CODEVIEW=1
1.1       root       85: !else
1.1.1.4 ! root       86: CODEVIEW=0
1.1       root       87: !endif
1.1.1.2   root       88: !endif
1.1       root       89: 
1.1.1.4 ! root       90: 
        !            91: #############################################################################
        !            92: # normalize cases of parameters, or error check
        !            93: 
        !            94: !if "$(TARGET)"=="W"
        !            95: !undef TARGET
        !            96: TARGET=w
        !            97: !else
        !            98: !if "$(TARGET)"=="R"
        !            99: !undef TARGET
        !           100: TARGET=r
        !           101: !endif
1.1       root      102: !endif
                    103: 
1.1.1.4 ! root      104: !if "$(CPU)"=="MIPS"
        !           105: !if "$(PLATFORM)"!="MIPS"
        !           106: !error Must set PLATFORM=MIPS for MIPS builds
        !           107: !endif
1.1       root      108: !endif
                    109: 
1.1.1.4 ! root      110: !if "$(CPU)"=="ALPHA"
        !           111: !if "$(PLATFORM)"!="ALPHA"
        !           112: !error Must set PLATFORM=ALPHA for ALPHA builds
        !           113: !endif
1.1       root      114: !endif
                    115: 
1.1.1.4 ! root      116: 
        !           117: #############################################################################
        !           118: # Parse these options:
        !           119: 
        !           120: #
        !           121: # DEBUG OPTIONS
        !           122: #
1.1       root      123: !if "$(DEBUG)" != "0"
                    124: DEBUGSUF=D
                    125: DEBDEFS=/D_DEBUG
1.1.1.3   root      126: DEBOPTS=/Od
1.1       root      127: !else
1.1.1.4 ! root      128: 
        !           129: #
        !           130: # NON-DEBUG OPTIONS
        !           131: #
        !           132: !if "$(PLATFORM)"=="INTEL"
        !           133: DEBUGSUF=
        !           134: DEBDEFS=
        !           135: DEBOPTS=/O1    /Gy
        !           136: !else
        !           137: !if "$(PLATFORM)"=="MIPS"
        !           138: DEBUGSUF=
        !           139: DEBDEFS=
        !           140: DEBOPTS=/Osg /Gs /Gy
        !           141: !else
        !           142: !if "$(PLATFORM)"=="ALPHA"
1.1       root      143: DEBUGSUF=
                    144: DEBDEFS=
1.1.1.4 ! root      145: DEBOPTS=/Ox
        !           146: !endif
        !           147: !endif
        !           148: !endif
1.1       root      149: !endif
                    150: 
1.1.1.4 ! root      151: #
        !           152: # CODEVIEW options
        !           153: #
        !           154: 
1.1       root      155: !if "$(CODEVIEW)" == "1"
1.1.1.4 ! root      156: CVOPTS=/Z7
1.1       root      157: !endif
                    158: 
1.1.1.4 ! root      159: 
1.1       root      160: # CVEXTRA used for select CodeView information (main files only)
                    161: !if "$(CODEVIEW)" == "2"
1.1.1.4 ! root      162: CVEXTRA=/Z7
1.1       root      163: !endif
                    164: 
1.1.1.4 ! root      165: #
        !           166: # PLATFORM options
        !           167: #
        !           168: !if "$(PLATFORM)"=="INTEL"
        !           169: CPP=cl
        !           170: CL_MODEL=/D_X86_
        !           171: LIB32=lib
1.1       root      172: !else
1.1.1.4 ! root      173: !if "$(PLATFORM)"=="MIPS"
        !           174: CPP=mcl
        !           175: CL_MODEL=/D_MIPS_
        !           176: LIB32=lib32
        !           177: !else
        !           178: !if "$(PLATFORM)"=="ALPHA"
        !           179: CPP=claxp
        !           180: CL_MODEL=
        !           181: LIB32=lib32
1.1       root      182: !else
1.1.1.4 ! root      183: !error PLATFORM must be one of INTEL or MIPS or ALPHA
1.1       root      184: !endif
                    185: !endif
                    186: !endif
                    187: 
1.1.1.4 ! root      188: #
        !           189: # TARGET options
        !           190: !if "$(TARGET)"=="r"
        !           191: TARGDEFS=/D_CONSOLE
1.1       root      192: TARGOPTS=
                    193: !else
1.1.1.4 ! root      194: !if "$(TARGET)"=="w"
1.1       root      195: MKWIN=1
                    196: TARGDEFS=/D_WINDOWS
1.1.1.4 ! root      197: TARGOPTS=
1.1.1.3   root      198: !else
1.1.1.4 ! root      199: !error TARGET must be one of W or R.
1.1.1.3   root      200: !endif
1.1       root      201: !endif
                    202: 
1.1.1.4 ! root      203: # TYPE = Library Type Designator
        !           204: #       c = normal C library
        !           205: #       d = DLL library
        !           206: TYPE=c
1.1       root      207: 
1.1.1.4 ! root      208: #
        !           209: # DLL Variants
        !           210: #
        !           211: !if "$(DLL)" == "1"
        !           212: # _USRDLL library (SS!=DS)
        !           213: TYPE=d
        !           214: DEXT=.dll
        !           215: TARGOPTS=/D_USRDLL /D_WINDLL
        !           216: !else
        !           217: DEXT=
1.1       root      218: !endif
                    219: 
1.1.1.4 ! root      220: #
        !           221: # Object File Directory
        !           222: #
1.1       root      223: !if "$(OBJ)" == ""
1.1.1.4 ! root      224: D=$$$(MODEL)$(TARGET)$(DEBUGSUF)$(DEXT)  # subdirectory specific to variant
1.1       root      225: !else
1.1.1.4 ! root      226: D=$(OBJ)                                 # User specified directory
1.1       root      227: !endif
                    228: 
1.1.1.4 ! root      229: #
        !           230: # COMPILER OPTIONS
        !           231: #
        !           232: !if "$(PLATFORM)"=="ALPHA"
        !           233: CL_OPT=/W3 /Gf $(DEBOPTS) $(CVOPTS) $(TARGOPTS)
1.1       root      234: !else
1.1.1.4 ! root      235: !if "$(PLATFORM)"=="MIPS"
        !           236: CL_OPT=/W3 /Gf $(DEBOPTS) $(CVOPTS) $(TARGOPTS)
1.1.1.2   root      237: !else
1.1.1.4 ! root      238: # INTEL
        !           239: CL_OPT=/W3 /WX /Gf /Zl $(DEBOPTS) $(CVOPTS) $(TARGOPTS)
1.1.1.2   root      240: !endif
1.1       root      241: !endif
                    242: 
                    243: #############################################################################
1.1.1.4 ! root      244: # Options always built from above conditionals
1.1       root      245: 
1.1.1.4 ! root      246: DEFS=$(DEBDEFS) $(TARGDEFS)
        !           247: GOAL=$(MODEL)afx$(TYPE)$(TARGET)$(DEBUGSUF)
1.1       root      248: 
1.1.1.4 ! root      249: #############################################################################
        !           250: # Library Components
1.1       root      251: 
1.1.1.4 ! root      252: OBJECT=$D\objcore.obj $D\except.obj $D\afxver.obj \
        !           253:     $D\validadd.obj $D\dumpcont.obj $D\dumpflt.obj \
        !           254:     $D\arccore.obj $D\arcobj.obj $D\arcex.obj
        !           255: 
        !           256: # non-shared diagnostics
        !           257: OBJDIAG=$D\dumpinit.obj $D\dumpout.obj \
        !           258:     $D\afxasert.obj $D\afxmem.obj $D\afxabort.obj
        !           259: 
        !           260: FILES=$D\filecore.obj $D\filetxt.obj $D\filemem.obj $D\filex.obj $D\filest.obj
        !           261: 
        !           262: COLLECTIONS1=$D\array_b.obj $D\array_d.obj $D\array_p.obj $D\array_o.obj \
        !           263:     $D\array_s.obj $D\array_u.obj $D\array_w.obj \
        !           264:     $D\list_o.obj $D\list_p.obj $D\list_s.obj
        !           265: 
        !           266: COLLECTIONS2=$D\map_pp.obj $D\map_pw.obj $D\map_so.obj \
        !           267:     $D\map_sp.obj $D\map_ss.obj $D\map_wo.obj $D\map_wp.obj $D\plex.obj
        !           268: 
        !           269: MISC=$D\strcore.obj $D\strex.obj $D\timecore.obj
        !           270: 
        !           271: WINDOWS=\
        !           272:     $D\wincore.obj $D\winfrm.obj $D\winmdi.obj $D\winhand.obj $D\winmain.obj \
        !           273:     $D\barcore.obj $D\bartool.obj $D\bardlg.obj \
        !           274:     $D\dcprev.obj $D\dcmeta.obj
        !           275: 
        !           276: DIALOG=\
        !           277:     $D\dlgcore.obj $D\dlgdata.obj $D\dlgfloat.obj \
        !           278:     $D\winctrl.obj $D\winbtn.obj \
        !           279:     $D\dlgfile.obj $D\dlgprnt.obj $D\dlgclr.obj $D\dlgfnt.obj $D\dlgfr.obj
        !           280: 
        !           281: WINMISC=\
        !           282:     $D\wingdi.obj $D\winstr.obj $D\winmenu.obj \
        !           283:     $D\auxdata.obj $D\afxtrace.obj
        !           284: 
        !           285: DOCVIEW=\
        !           286:     $D\cmdtarg.obj $D\doccore.obj $D\doctempl.obj \
        !           287:     $D\docsingl.obj $D\docmulti.obj \
        !           288:     $D\viewcore.obj $D\viewprnt.obj $D\winsplit.obj $D\viewscrl.obj \
        !           289:     $D\viewform.obj $D\viewedit.obj $D\viewprev.obj
        !           290: 
        !           291: APPLICATION=\
        !           292:     $D\appcore.obj $D\appui.obj $D\appgray.obj $D\appdlg.obj $D\appprnt.obj \
        !           293:     $D\apphelp.obj $D\apphelpx.obj
1.1       root      294: 
1.1.1.4 ! root      295: !if "$(DEBUG)" == "1"
        !           296: !ifdef MKWIN
        !           297: INLINES = $D\afxinl1.obj $D\afxinl2.obj $D\afxinl3.obj
1.1.1.3   root      298: !else
1.1.1.4 ! root      299: INLINES = $D\afxinl1.obj
1.1       root      300: !endif
                    301: !else
1.1.1.4 ! root      302: INLINES =
1.1       root      303: !endif
                    304: 
1.1.1.4 ! root      305: OLE= $D\olemisc.obj $D\olefile.obj $D\oledoc.obj $D\olecli.obj \
        !           306:        $D\oleui.obj $D\oleui2.obj $D\olesvr.obj $D\oletsvr.obj
        !           307: 
        !           308: OBJS=$(OBJECT) $(OBJDIAG) $(INLINES) $(FILES) $(COLLECTIONS1) $(COLLECTIONS2) $(MISC)
1.1       root      309: 
                    310: !ifdef MKWIN
1.1.1.4 ! root      311: OBJS=$(OBJS) $(WINDOWS) $(DIALOG) $(WINMISC) $(DOCVIEW) $(APPLICATION) $(OLE)
1.1       root      312: !endif
                    313: 
1.1.1.4 ! root      314: #############################################################################
        !           315: # Standard tools
1.1       root      316: 
                    317: #############################################################################
                    318: # Set CPPFLAGS for use with .cpp.obj and .c.obj rules
                    319: # Define rule for use with OBJ directory
                    320: # C++ uses a PCH file
                    321: 
1.1.1.4 ! root      322: CPPFLAGS=$(CPPFLAGS) $(CL_MODEL) $(CL_OPT) $(DEFS) $(OPT)
1.1       root      323: 
                    324: !ifndef NO_PCH
1.1.1.4 ! root      325: !ifndef PCH_FILE
        !           326: PCH_FILE=$D\stdafx.pch
        !           327: !endif
        !           328: 
        !           329: CPPFLAGS=$(CPPFLAGS) /Yustdafx.h /Fp$(PCH_FILE)
1.1       root      330: !else
                    331: PCH_FILE=
                    332: !endif
                    333: 
1.1.1.4 ! root      334: .SUFFIXES: .cpp
1.1       root      335: 
                    336: .cpp{$D}.obj:
1.1.1.4 ! root      337:     $(CPP) $(CPPFLAGS) /c /Fo$D\ $<
1.1       root      338: 
                    339: #############################################################################
1.1.1.4 ! root      340: # Goals to build
1.1       root      341: 
1.1.1.4 ! root      342: goal: create.dir ..\lib\$(GOAL).lib
1.1       root      343: 
1.1.1.4 ! root      344: create.dir:
        !           345:     @-if not exist $D\*.* mkdir $D
1.1       root      346: 
                    347: clean:
1.1.1.4 ! root      348:     -if exist $D\*.obj erase $D\*.obj
        !           349:     -if exist $D\*.pch erase $D\*.pch
        !           350:     -rmdir $D
1.1       root      351: 
                    352: #############################################################################
                    353: # Precompiled header file
                    354: 
                    355: !ifndef NO_PCH
1.1.1.4 ! root      356: HDRS =..\include\*.h ..\include\*.inl
        !           357: 
        !           358: $D\objcore.obj $(PCH_FILE): objcore.cpp $(HDRS)
        !           359:     $(CPP) /c /Ycstdafx.h /Fp$(PCH_FILE) $(CL_MODEL) $(CL_OPT) $(DEFS) $(CVEXTRA) $(OPT) /c /Fo$D\objcore.obj objcore.cpp
1.1       root      360: 
                    361: !endif
                    362: 
                    363: ############################################################################
                    364: # CodeView for select files
1.1.1.4 ! root      365: 
1.1       root      366: !if "$(CODEVIEW)"=="2"
1.1.1.4 ! root      367: 
        !           368: $D\afxmem.obj : afxmem.cpp
        !           369:     $(CPP) $(CPPFLAGS) $(CVEXTRA) /c /Fo$D\afxmem.obj afxmem.cpp
1.1       root      370: 
                    371: !ifdef MKWIN
                    372: $D\winmain.obj : winmain.cpp
1.1.1.4 ! root      373:     $(CPP) $(CPPFLAGS) $(CVEXTRA) /c /Fo$D\winmain.obj winmain.cpp
1.1       root      374: 
1.1.1.4 ! root      375: $D\wincore.obj : wincore.cpp
        !           376:     $(CPP) $(CPPFLAGS) $(CVEXTRA) /c /Fo$D\wincore.obj wincore.cpp
1.1       root      377: 
1.1.1.4 ! root      378: $D\appcore.obj : appcore.cpp
        !           379:     $(CPP) $(CPPFLAGS) $(CVEXTRA) /c /Fo$D\appcore.obj appcore.cpp
1.1       root      380: !endif
                    381: !endif
                    382: 
                    383: #############################################################################
1.1.1.4 ! root      384: # Build the library from the up-to-date objs
1.1       root      385: 
1.1.1.4 ! root      386: ..\lib\$(GOAL).lib: $(OBJS)
        !           387:     @-if exist $@ erase $@
        !           388:     @$(LIB32) -out:$@ @<<
1.1       root      389: $(OBJS)
                    390: <<
                    391: 
                    392: #############################################################################

unix.superglobalmegacorp.com

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