########################################################################## # # Makefile for OUTLUI.DLL # # Usage: NMAKE (builds DEBUG library) # or: NMAKE RELEASE=1 (builds RELEASE library -- no debug symbols) # or: NMAKE clean (erase all compiled files) # # Environment variables: # DEVROOT_DIR= (root dir for sample code development) # ########################################################################## LIBNAME = outlui !ifndef DEVROOT_DIR !error You must define DEVROOT_DIR (ole20 sub-tree) !endif !ifndef INCLUDE !error You must define INCLUDE (non ole20 include files) !endif !ifndef LIB !error You must deinfe LIB (non ole20 libraries) !endif !ifndef OLEBUILD OLEBUILD=NT !endif OLE2_H=$(DEVROOT_DIR)\h OLE2_LIB=$(DEVROOT_DIR)\lib !ifndef SAMPLE_DIR SAMPLE_DIR = $(DEVROOT_DIR)\samples !endif SRC_DIR = $(SAMPLE_DIR)\$(APP) MAKEFILE = makefile.32 # ============================================================================ # File: M A K E F I L E # # NMAKE description file for the OLE2.0 User Interface DLL # # Copyright (C) Microsoft Corporation, 1992-1993. All Rights Reserved. # Microsoft Confidential. # ============================================================================ # ---------------------------------------------------------------------------- # U I M A K E . I N I # ---------------------------------------------------------------------------- !if "$(OLEBUILD)" == "DOS" || "$(OLEBUILD)" == "" DOS=1 !endif !if "$(OLEBUILD)" == "NT" NT=1 !if "$(MACHINE)" == "i386" || "$(MACHINE)" == "" MACHINE = i386 MACHINE_D = _X86_ MACHINE_CC = cl386 !endif !if "$(MACHINE)" == "MIPS" MACHINE = mips MACHINE_D = _MIPS_ MACHINE_CC = cc !endif !endif !include "uimake.ini" !ifndef LANG LANG=USA !endif !ifndef BUILD BUILD=dll !endif GOAL: MAKEINI nmake -f $(MAKEFILE) PRELUDE SETFLAGS $(LIBNAME).$(BUILD) MAKEINI: nmake -f $(MAKEFILE) LIBNAME=$(LIBNAME) LANG=$(LANG) BUILD=$(BUILD) RESOURCE=RESOUCE REL_DIR=$(OLEREL_DIR) DEBUG !if "$(INSTALL_DIR)"=="" INSTALL_DIR = $(REL_DIR) !endif #use src/tok pairs to build if localized version !if ("$(LANG)"!="USA") && ("$(LANG)"!="usa") SRCTOK=1 !endif # ---------------------------------------------------------------------------- # O B J E C T F I L E L I S T # ---------------------------------------------------------------------------- UI_COBJS = \ D^\busy.obj\ D^\common.obj\ D^\convert.obj\ D^\dbgutil.obj\ D^\drawicon.obj\ D^\hatch.obj\ D^\icon.obj\ D^\iconbox.obj\ D^\insobj.obj\ D^\links.obj\ D^\msgfiltr.obj\ D^\enumfetc.obj\ D^\objfdbk.obj\ D^\ole2ui.obj\ D^\olestd.obj\ D^\targtdev.obj\ D^\oleutl.obj\ D^\pastespl.obj\ D^\regdb.obj\ D^\resimage.obj\ D^\utility.obj\ UI_NOPCOBJS = \ D^\geticon.obj\ UI_DLLOBJS = \ D^\dllfuncs.obj\ PRECOMPOBJ=$(O)precomp.obj PRECOMP=$(O)precomp.pch # ---------------------------------------------------------------------------- # R E S O U R C E L I S T # ---------------------------------------------------------------------------- RES = \ busy.h \ common.h \ convert.h \ edlinks.h \ geticon.h \ icon.h \ iconbox.h \ insobj.h \ msgfiltr.h \ enumfetc.h \ ole2ui.h \ pastespl.h \ resimage.h \ $(RESOURCE)\STATIC\default.ico \ $(RESOURCE)\STATIC\bang.ico \ $(RESOURCE)\STATIC\egares.bmp \ $(RESOURCE)\STATIC\hivgares.bmp \ $(RESOURCE)\STATIC\vgares.bmp \ $(RESOURCE)\$(LANG)\strings.rc \ $(RESOURCE)\$(LANG)\busy.dlg \ $(RESOURCE)\$(LANG)\convert.dlg \ $(RESOURCE)\$(LANG)\fileopen.dlg \ $(RESOURCE)\$(LANG)\icon.dlg \ $(RESOURCE)\$(LANG)\insobj.dlg \ $(RESOURCE)\$(LANG)\links.dlg \ $(RESOURCE)\$(LANG)\pastespl.dlg \ $(RESOURCE)\$(LANG)\prompt.dlg \ $(RESOURCE)\ole2ui.rcv \ $(RESOURCE)\$(LANG)\verlocal.h \ # ---------------------------------------------------------------------------- # D E B U G S T A T I C L I B M A K E P A R A M E T E R S # ---------------------------------------------------------------------------- DEBUGLIB: @echo Creating DEBUG LIB <nul] !error Object subdirectory $(OBJ)\ could not be created !endif !if [if not exist $(OBJ)\NOPC\*. md $(OBJ)\NOPC > nul] !error non-precompiled header object subdirectory $(OBJ)\NOPC\ could not be created !endif #select language for version resource if localized version !if ("$(LANG)"!="USA") && ("$(LANG)"!="usa") RFLAGS=$(RFLAGS) -D VER_LOC !endif !if ("$(LIBNAME)"=="PUBOLEUI") RFLAGS=$(RFLAGS) -D PUBLISHER !endif .SUFFIXES: .c .asm .obj .res .rc .def .bmp .ico .exe .dll .cod .str O=.\$(OBJ)^\ # ---------------------------------------------------------------------------- # I N F E R E N C E R U L E S # ---------------------------------------------------------------------------- # compile C file without precompiled headers into object directory\NOPC # dont compile c files etc for lcoalized builds. !ifndef SRCTOK {}.c{$(O)NOPC\}.obj: @echo °°°°°°°°°°°°°°°°°°°°°°°°° Compiling $(@B).c °°°°°°°°°°°°°°°°°°°°°°°°° !ifdef DOS SET CL=$(CFLAGS) $(CC) -Fo$(O)NOPC\$(@B) $(@B).c !else $(CC) $(CFLAGS) -Fo$(O)NOPC\$(@B) $(@B).c !endif # compile C file into object directory {}.c{$(O)}.obj: @echo °°°°°°°°°°°°°°°°°°°°°°°°° Compiling $(@B).c °°°°°°°°°°°°°°°°°°°°°°°°° !ifdef DOS SET CL=$(CFLAGS) -Yuole2ui.h -Fp$(O)precomp.pch $(CC) -Fo$(O)$(@B) $(@B).c !else $(CC) $(CFLAGS) -Yuole2ui.h -Fp$(O)precomp.pch -Fo$(O)$(@B) $(@B).c !endif !endif #endif SRCTOK {}.rc{$(O)}.res: @echo ²²²²²²²²²²²²²²²²²²² Resource Compiling $(@B).res ²²²²²²²²²²²²²²²²²²²² $(RS) -I $(RESOURCE)\$(LANG);$(RESOURCE)\static;$(RESOURCE) -FO $(O)$(@B).res -R $(RFLAGS) $(@B).rc -del $(LIBNAME).dll !ifndef SRCTOK {}.c.cod: @echo ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ Making $(@B).cod ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ !ifdef DOS SET CL=$(CFLAGS) -f -Fc $(CC) $(@B).c !else $(CC) $(CFLAGS) -f- -Fc $(@B).c !endif !endif #endif SRCTOK # rules for creating rc & dlg files for localized verisons from src/tok pairs !ifdef SRCTOK $(RESOURCE)\$(LANG)\busy.dlg : $(RESOURCE)\$(LANG)\busy.tok $(RESOURCE)\src\busy.src tok -q -f $*.tok $(RESOURCE)\src\$(@B).src > $@ $(RESOURCE)\$(LANG)\convert.dlg : $(RESOURCE)\$(LANG)\convert.tok $(RESOURCE)\src\convert.src tok -q -f $*.tok $(RESOURCE)\src\$(@B).src > $@ $(RESOURCE)\$(LANG)\fileopen.dlg : $(RESOURCE)\$(LANG)\fileopen.tok $(RESOURCE)\src\fileopen.src tok -q -f $*.tok $(RESOURCE)\src\$(@B).src > $@ $(RESOURCE)\$(LANG)\icon.dlg : $(RESOURCE)\$(LANG)\icon.tok $(RESOURCE)\src\icon.src tok -q -f $*.tok $(RESOURCE)\src\$(@B).src > $@ $(RESOURCE)\$(LANG)\insobj.dlg : $(RESOURCE)\$(LANG)\insobj.tok $(RESOURCE)\src\insobj.src tok -q -f $*.tok $(RESOURCE)\src\$(@B).src > $@ $(RESOURCE)\$(LANG)\links.dlg : $(RESOURCE)\$(LANG)\links.tok $(RESOURCE)\src\links.src tok -q -f $*.tok $(RESOURCE)\src\$(@B).src > $@ $(RESOURCE)\$(LANG)\pastespl.dlg : $(RESOURCE)\$(LANG)\pastespl.tok $(RESOURCE)\src\pastespl.src tok -q -f $*.tok $(RESOURCE)\src\$(@B).src > $@ $(RESOURCE)\$(LANG)\prompt.dlg : $(RESOURCE)\$(LANG)\prompt.tok $(RESOURCE)\src\prompt.src tok -q -f $*.tok $(RESOURCE)\src\$(@B).src > $@ $(RESOURCE)\$(LANG)\strings.rc : $(RESOURCE)\$(LANG)\strings.tok $(RESOURCE)\src\strings.src tok -q -f $*.tok $(RESOURCE)\src\$(@B).src > $@ !endif # ---------------------------------------------------------------------------- # D E P E N D F I L E C R E A T I O N # ---------------------------------------------------------------------------- UI_CFILE = $(UI_COBJS:.obj=.c) $(UI_DLLOBJS:.obj=.c) UI_NOPCFILE = $(UI_NOPCOBJS:.obj=.c) DEPEND: nul @echo Making a NEW dependancy file. mkdep -p $$(O) -s .obj $(UI_CFILE:D^\=) > tmp.tmp sed "s/:/: $$(PRECOMP)/g" < tmp.tmp > depend -del tmp.tmp mkdep -p $$(O)NOPC\ -s .obj $(UI_NOPCFILE:D^\=) >> depend mkdep -p $$(O) -s .pch precomp.c >> depend # ---------------------------------------------------------------------------- # W E L C O M E B A N N E R # ---------------------------------------------------------------------------- PRELUDE: @echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» @echo º Makefile for UILibrary º @echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ @echo $(MSG) !ifndef SRCTOK set INCLUDE=$(OLEREL_DIR);$(INCLUDE) set LIB=$(OLEREL_DIR);$(LIB) !endif SETFLAGS: set INCLUDE=$(INCLUDE);$(OLE2_H) set LIB=$(LIB);$(OLE2_LIB) # ---------------------------------------------------------------------------- # G O A L T A R G E T S # ---------------------------------------------------------------------------- !include "depend" CLEAN: CleanUp GOAL CleanUp: MAKEINI nmake -f $(MAKEFILE) SETFLAGS Delete Delete: -echo y|del .\$(OBJ)\*.* -del $(LIBNAME).dll -del $(LIBNAME).lib !ifndef SRCTOK $(O)precomp.pch: precomp.c !ifdef DOS SET CL=$(CFLAGS) -Fp$(O)precomp.pch -Ycole2ui.h $(CC) -Fo$(O)$(@B) precomp.c !else $(CC) $(CFLAGS) -Fp$(O)precomp.pch -Ycole2ui.h -Fo$(O)$(@B) precomp.c !endif !endif #endif SRCTOK $(O)ole2ui.res: ole2ui.rc $(RES) ole2ui.rc : $(RESOURCE)\$(LANG)\strings.rc # # Build .LIB static library # $(LIBNAME).lib: $(LIBOBJS) $(PRECOMPOBJ) -del $(O)$(LIBNAME).lib lib @<< $(O)$(LIBNAME).lib y $(PRECOMPOBJ: = +) $(LIBOBJS: = +) << copy $(O)$(LIBNAME).lib $(LIBNAME).lib # # Build .DLL dynamic-link library # !if "$(OLEBUILD)" == "NT" !else $(O)$(LIBNAME).lib: $(LIBOBJS) $(PRECOMPOBJS) -del $(O)$(LIBNAME).lib lib @<< $(O)$(LIBNAME).lib y $(PRECOMPOBJ: = +) $(LIBOBJS: = +) << !endif !if "$(OLEBUILD)" == "NT" $(LIBNAME).dll: $(LIBNAME).d32 $(PRECOMPOBJS) $(LIBOBJS) $(DLLOBJS) $(O)ole2ui.res @echo Linking ... lib32 -out:$*.lib -def:$(LIBNAME).d32 -machine:$(MACHINE) $(LIBOBJS) $(DLLOBJS) cvtres -$(MACHINE) $(O)ole2ui.res -o $*.rs link32 $(LFLAGS) -entry:LibMain@12 @<<$(BUILD_DIR)\ole2util.lnk $(LIBNAME).exp $(LIBOBJS) $(DLLOBJS) $(PRECOMPOBJ) $(UILIBS) $*.rs -out:$@ -map:$*.map -dll $(UILIBS) <