|
|
1.1 ! root 1: ############################################################################## ! 2: # ! 3: # (c) Copyright Microsoft Corp. 1992-1993 All Rights Reserved ! 4: # ! 5: # File: ! 6: # ! 7: # makefile - makefile for spoly2.exe ! 8: # ! 9: # Purpose: ! 10: # ! 11: # Builds the OLE 2.0 sample IDispatch server, dispcalc.exe. ! 12: # ! 13: # ! 14: # Usage: ! 15: # ! 16: # NMAKE ; build with defaults ! 17: # or: NMAKE option ; build with the given option(s) ! 18: # or: NMAKE clean ; erase all compiled files ! 19: # ! 20: # option: dev = [win16 | win32] ; dev=win16 is the default ! 21: # DEBUG=[0|1] ; DEBUG=1 is the default ! 22: # ! 23: # ! 24: # Notes: ! 25: # ! 26: # This makefile assumes that the PATH, INCLUDE and LIB environment ! 27: # variables are setup properly. ! 28: # ! 29: ############################################################################## ! 30: ! 31: ! 32: ! 33: ########################################################################## ! 34: # ! 35: # Default Settings ! 36: # ! 37: ! 38: !if "$(dev)" == "" ! 39: dev = win32 ! 40: !endif ! 41: ! 42: !if !("$(dev)" == "win16" || "$(dev)" == "win32" || "$(dev)" == "mac") ! 43: !error Invalid dev option, choose from [win16 | win32 | mac] ! 44: !endif ! 45: ! 46: !if "$(dev)" == "win16" ! 47: TARGET = WIN16 ! 48: !endif ! 49: ! 50: !if "$(dev)" == "win32" ! 51: TARGET = WIN32 ! 52: MACHINE = i386 ! 53: !endif ! 54: ! 55: !if "$(dev)" == "mac" ! 56: !error Mac build is currently not supported ! 57: !endif ! 58: ! 59: !if "$(DEBUG)" == "" ! 60: DEBUG = 1 ! 61: !endif ! 62: ! 63: ! 64: ########################################################################## ! 65: # ! 66: # WIN16 Settings ! 67: # ! 68: !if "$(TARGET)" == "WIN16" ! 69: ! 70: CC = cl ! 71: LINK = link ! 72: ! 73: RCFLAGS = -dWIN16 ! 74: CFLAGS = -W3 -AM -GA -GEs -DWIN16 ! 75: LINKFLAGS = /NOD /NOI /BATCH /ONERROR:NOEXE ! 76: ! 77: LIBS = libw.lib mlibcew.lib ! 78: ! 79: !if "$(DEBUG)" == "1" ! 80: CFLAGS = $(CFLAGS) -Od -Zi -D_DEBUG $(CL) ! 81: LINKFLAGS = $(LINKFLAGS) /COD ! 82: !else ! 83: CFLAGS = $(CFLAGS) -Ox $(CL) ! 84: LINKFLAGS = $(LINKFLAGS) /FAR /PACKC ! 85: !endif ! 86: !endif ! 87: ! 88: ! 89: ########################################################################## ! 90: # ! 91: # WIN32 Settings ! 92: # ! 93: !if "$(TARGET)" == "WIN32" ! 94: ! 95: CC = cl386 ! 96: LINK = link32 ! 97: ! 98: RCFLAGS = -dWIN32 ! 99: CFLAGS = -W3 -G3 -nologo -D$(MACHINE)=1 -DWIN32 -D_NTWIN -D_WINDOWS $(CL) ! 100: CFLAGS = $(CFLAGS) -DOLE2SHIP -DOLE2FINAL -D_INC_OLE -D__RPC_H__ -D__RPCDCE_H__ -D_X86_ -DNTBETA2 -D_MT ! 101: LINKFLAGS = -subsystem:windows -entry:WinMainCRTStartup -machine:$(MACHINE) ! 102: ! 103: LIBS = libc.lib kernel32.lib user32.lib ! 104: ! 105: !if "$(DEBUG)" == "1" ! 106: CFLAGS = $(CFLAGS) -Od -Zi -D_DEBUG $(CL) ! 107: LINKFLAGS = -debug:full -debugtype:cv $(LINKFLAGS) ! 108: !else ! 109: CFLAGS = $(CFLAGS) -Ox ! 110: !endif ! 111: !endif ! 112: ! 113: ! 114: ########################################################################## ! 115: # ! 116: # Build rules ! 117: # ! 118: ! 119: .cpp.obj: ! 120: @echo Compiling $<... ! 121: $(CC) -c $< ! 122: ! 123: .c.obj: ! 124: @echo Compiling $<... ! 125: $(CC) -c $< ! 126: ! 127: ! 128: ########################################################################## ! 129: # ! 130: # Application Settings ! 131: # ! 132: ! 133: APPS = dispcalc ! 134: ! 135: ! 136: !if "$(TARGET)" == "WIN16" ! 137: LIBS = ole2.lib compobj.lib ole2disp.lib $(LIBS) ! 138: !else ! 139: !if "$(TARGET)" == "WIN32" ! 140: LIBS = ole2w32.lib ole2di32.lib $(LIBS) ! 141: !endif ! 142: !endif ! 143: ! 144: OBJS = \ ! 145: main.obj \ ! 146: idata.obj \ ! 147: dispcalc.obj \ ! 148: clsid.obj ! 149: ! 150: ! 151: ########################################################################## ! 152: # ! 153: # Default Goal ! 154: # ! 155: ! 156: goal : setflags $(APPS).exe ! 157: ! 158: setflags : ! 159: set CL=$(CFLAGS) ! 160: ! 161: ! 162: ########################################################################## ! 163: # ! 164: # Clean (erase) generated files ! 165: # ! 166: clean : ! 167: if exist *.obj del *.obj ! 168: if exist $(APPS).exe del $(APPS).exe ! 169: if exist $(APPS).map del $(APPS).map ! 170: if exist $(APPS).res del $(APPS).res ! 171: if exist $(APPS).rs del $(APPS).rs ! 172: ! 173: ! 174: ########################################################################## ! 175: # ! 176: # Application Build (WIN16 Specific) ! 177: # ! 178: ! 179: !if "$(TARGET)" == "WIN16" ! 180: $(APPS).exe : $(OBJS) $(APPS).def $(APPS).res $(APPS).ico ! 181: link $(LINKFLAGS) @<< ! 182: $(OBJS), ! 183: $@,, ! 184: $(LIBS), ! 185: $(APPS).def ! 186: << ! 187: rc -k -t $(APPS).res $@ ! 188: !endif ! 189: ! 190: ! 191: ########################################################################## ! 192: # ! 193: # Application Build (WIN32 Specific) ! 194: # ! 195: !if "$(TARGET)" == "WIN32" ! 196: $(APPS).exe : $(OBJS) $(APPS).def $(APPS).res $(APPS).ico ! 197: cvtres -$(MACHINE) $(APPS).res -o $(APPS).rs ! 198: $(LINK) @<< ! 199: $(LINKFLAGS) ! 200: -out:$@ ! 201: -map:$*.map ! 202: $(OBJS) ! 203: $(APPS).rs ! 204: $(LIBS) ! 205: << ! 206: !endif ! 207: ! 208: ! 209: ########################################################################## ! 210: # ! 211: # Application Build (Common) ! 212: # ! 213: ! 214: $(APPS).res : $(APPS).rc ! 215: rc $(RCFLAGS) -r -fo$@ $? ! 216: ! 217: ! 218: ########################################################################## ! 219: # ! 220: # Dependencies ! 221: # ! 222: ! 223: main.obj: main.cpp dispcalc.h ! 224: $(CC) -c main.cpp ! 225: ! 226: idata.obj: idata.cpp dispcalc.h ! 227: $(CC) -c idata.cpp ! 228: ! 229: dispcalc.obj: dispcalc.cpp dispcalc.h ! 230: $(CC) -c dispcalc.cpp ! 231: ! 232: clsid.obj: clsid.c clsid.h ! 233: $(CC) -c clsid.c
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.