# Microsoft Media Phone # Common Targets Makefile # common\cmntgt.mak # Copyright 1995 Microsoft Corp. # If INCLUDEd the following macros must be set for this file to work # effictively # # Macro Description # # TARGETS A list of items that are to be deleted during a # make clean_targets. # # SRCfiles A list of source files .c or .asm that will be used for # generation of depends and tags files. # # Hfiles List of .h files for use in generation of depends # # INCfiles List of .inc files for use in generation of depends # # OBJfiles A list of object files that is are deleted during a make # clean. # # DEFfile Def file to be used for linking. # # LIBname The name of the library to build, if used as a library # make file # Saved for later addition to StdHelp. # cleanret -- deletes RETAIL objs, dlls, exes and implibs for $(TargetPlatform). # cleandbg -- deletes DEBUG objs, dlls, exes and implibs for $(TargetPlatform). # cleantst -- deletes TEST objs, dlls, exes and implibs for $(TargetPlatform). # cleanbbt -- deletes BBT objs, dlls, exes and implibs for $(TargetPlatform). # cleanall -- does all targets. help: -@type << Standard targets: help -- Get this message (default target). tgthelp -- Displays help for all bits of target information. depends -- Makes depend files for all source code. ret -- Does a retail build of the $(TargetPlatform) target. tst -- NYI. Does a test build of $(TargetPlatform) target. dbg -- Does a debug build of $(TargetPlatform) target. bld_info -- Displays the current nmake variables. nash_? -- Builds a retail (?=r) or debug (?=d) Nasville clean_nash_? -- Cleans a retail (?=r) or debug (?=d) Nasville build < NUL -$(RM) *.pch $(OBJDIR)\*.pch $(OBJDIR)\*.cod $(OBJDIR)\*.sbr $(OBJDIR)\*.bsc $(OBJDIR)\*.pdb $(OBJDIR)\*.ACM > NUL -$(EXP) $(OBJDIR) > NUL cleantgt: -$(RM) $(TARGETS) $(OBJDIR)\*.map $(OBJDIR)\*.exp > NUL -$(EXP) $(OBJDIR) > NUL depends: dpndcore ## mkdep needs include directories $(CCmdIncPaths) in -Ifoo -Ibar form. dpndcore: $(SRCfiles) $(RM) -f depends.mak -!$(INCLUDES) $(MKDEP_options) $** >> depends.mak $(SED) -f $(ProjectRootPath)\common\depends.sed depends.mak > depends.new $(MV) depends.new depends.mak ### # A simple directory recursion tool... ### relay: cd $(DIR) @set PATH=$(PATH) $(MAKE) $(TARGET) cd $(MAKEDIR) ################ ## ## Main target (exe, dll) generation ## ################ ### # Generic library make file maintenance targets ### # SRCfiles the source files that make up the library # LIBOBJfiles the object files that make up the library # LIBname the name of the library ## # !IFDEF LIBname # Build a Library from the objects # Well, this is a pain. The lib utill has a particular format which uses # prefixed command of + - and combination if the like to control addition and # replacement of objects in a library. There is not much we can do with # prefixes for symbolic replacement, and without the command prefix of -+ # when the object is already a part of the library lib simply ignores the # replacement object. So, rather then risk out of date library delete the # library and rebuld from scratch. That way we don't need no stinking command # prefixes. COPYLIB=$(CP) $(LIBname) $(PROJlibpath) $(LIBname): $(LIBOBJfiles) -$(RM) $@ > NUL $(LIBUTIL) @<< /out:$@ $(**: = ^ ) < NUL $(LFLAGS) $(BaseOpt) $(LocalLFLAGS) /OUT:$@ /MAP:$*.map $(LinkDef) $(STARTUPOBJ) $(DEBUGUTILOBJ) $(OBJfiles:.obj=.obj^ ) $(RESfile) $(LocalPreLibs) $(LIBRARIES) $(LocalLibraries) <