|
|
1.1 root 1: ##############################################################################
2: #
3: # (c) Copyright Microsoft Corp. 1992-1993 All Rights Reserved
4: #
5: # File:
6: #
7: # makefile - makefile for dispdemo.exe
8: #
9: # Purpose:
10: #
11: # Builds the OLE 2.0 IDispatch sample client application, dispdemo.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")
43: !error Invalid dev option, choose from [win16 | win32]
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:
104: LIBS = libc.lib kernel32.lib user32.lib gdi32.lib
105:
106: !if "$(DEBUG)" == "1"
107: CFLAGS = $(CFLAGS) -Od -Zi -D_DEBUG $(CL)
108: LINKFLAGS = -debug:full -debugtype:cv $(LINKFLAGS)
109: !else
110: CFLAGS = $(CFLAGS) -Ox
111: !endif
112: !endif
113:
114:
115: ##########################################################################
116: #
117: # Build rules
118: #
119:
120: .cpp.obj:
121: @echo Compiling $<...
122: $(CC) -c $<
123:
124: .c.obj:
125: @echo Compiling $<...
126: $(CC) -c $<
127:
128:
129: ##########################################################################
130: #
131: # Application Settings
132: #
133:
134: APPS = dispdemo
135:
136:
137: !if "$(TARGET)" == "WIN16"
138: LIBS = ole2.lib compobj.lib ole2disp.lib $(LIBS)
139: !endif
140: !if "$(TARGET)" == "WIN32"
141: LIBS = ole2w32.lib ole2di32.lib $(LIBS)
142: !endif
143:
144: OBJS = \
145: winmain.obj \
146: misc.obj \
147: crempoly.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: if exist *.pdb del *.pdb
173:
174:
175: ##########################################################################
176: #
177: # Application Build (WIN16 Specific)
178: #
179:
180: !if "$(TARGET)" == "WIN16"
181: $(APPS).exe : $(OBJS) $(APPS).def $(APPS).res $(APPS).ico
182: link $(LINKFLAGS) @<<
183: $(OBJS),
184: $@,,
185: $(LIBS),
186: $(APPS).def
187: <<
188: rc -k -t $(APPS).res $@
189: !endif
190:
191:
192: ##########################################################################
193: #
194: # Application Build (WIN32 Specific)
195: #
196: !if "$(TARGET)" == "WIN32"
197: $(APPS).exe : $(OBJS) $(APPS).def $(APPS).res $(APPS).ico
198: cvtres -$(MACHINE) $(APPS).res -o $(APPS).rs
199: $(LINK) @<<
200: $(LINKFLAGS)
201: -out:$@
202: -map:$*.map
203: $(OBJS)
204: $(APPS).rs
205: $(LIBS)
206: <<
207: !endif
208:
209:
210: ##########################################################################
211: #
212: # Application Build (Common)
213: #
214:
215: $(APPS).res : $(APPS).rc
216: rc $(RCFLAGS) -r -fo$@ $?
217:
218:
219: ##########################################################################
220: #
221: # Dependencies
222: #
223:
224: winmain.obj: winmain.cpp dispdemo.h
225: $(CC) -c winmain.cpp
226:
227: misc.obj: misc.cpp dispdemo.h
228: $(CC) -c misc.cpp
229:
230: crempoly.obj: crempoly.cpp crempoly.h
231: $(CC) -c crempoly.cpp
232:
233: clsid.obj: clsid.c clsid.h
234: $(CC) -c clsid.c
235:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.