|
|
1.1 root 1: # Makefile : Builds a Foundation class library variant.
2: #
3: # Usage: NMAKE CLEAN (removes all intermediary files)
4: # or: NMAKE options (builds one library variant (see below))
5: # Note that an NMAKE CLEAN should be performed before building a new variant.
6: #
7: # 'Options' are one of each of:
8: # "MODEL=M" (defaults to M)
9: # Any of the following models are accepted: S (small), M (medium),
10: # C (compact), or L (large).
11: # "TARGET=N" (defaults to N)
12: # Any of the following platforms are accepted: R (real-mode DOS),
13: # W (windows), N (Windows NT).
14: # "DLL" (defaults to 0)
15: # If this item is 1, a DLL version of the library is generated.
16: # If this item is 0, then a normal library is generated.
17: # Only Large model versions of DLLs are supported.
18: # "DEBUG" (defaults to 1)
19: # If this item is 1, debugging support is compiled into
20: # the library. If this item is 0, then debugging support
21: # is disabled. Debug support does not include CodeView information.
22: # "CODEVIEW=0" (defaults to 2, always)
23: # If this item is 1 CodeView information is compiled into
24: # the library. You must use the /CODEVIEW link option
25: # in addition, when linking your executable. If this item
26: # is 2, then only selected modules will be compiled with
27: # CodeView information. You must use the link option /CODEVIEW.
28: # A value of 0 indicates that no CodeView information is to be
29: # generated.
30: # "OBJ=.\obj" (defaults to '$$(MODEL)$(TARGET)$(DEBUG)'
31: # This optional specification specifies where temporary OBJ files
32: # are stored during the build process. The directory is created or
33: # removed as necessary.
34: # "OPT=" (no default value)
35: # This allows additional compiler options to be added to the build.
36: # If more than one switch is desired, put double-quotes around the
37: # whole OPT= argument, e.g., "OPT=/J /W3".
38: # "NO_PCH=1"
39: # Set this item to override the default use of precompiled headers
40: #
41: # The default is to build MODEL=M TARGET=W DEBUG=1
42: #
43: #
44: #############################################################################
45: # Standard tools
46:
47: !if "$(MODEL)"=="n" || "$(MODEL)"=="N"
48: CPP=cl386
49: CC=cl386
50: MKNT=1
51: !else
52: CPP=cl
53: CC=cl
54: !endif
55:
56: #############################################################################
57: # Parse these options:
58:
59: !ifndef DEBUG
60: DEBUG=1
61: !endif
62:
63: !ifndef DLL
64: DLL=0
65: !else
66: # DLL must be large model
67: MODEL=l
68: !endif
69:
70: !ifndef TARGET
71: TARGET=W
72: !endif
73:
74: !ifndef MODEL
75: MODEL=M
76: !endif
77:
78: !ifndef CODEVIEW
79: CODEVIEW=2
80: !endif
81:
82: !if "$(DEBUG)" != "0"
83: DEBUGSUF=D
84: DEBDEFS=/D_DEBUG
85: !ifdef MKNT
86: DEBOPTS=/Od /Zd
87: CVTOPTS=-g
88: !else
89: DEBOPTS=/Odr /f
90: CVTOPTS=
91: !endif
92: !else
93: DEBUGSUF=
94: DEBDEFS=
95: !ifdef MKNT
96: DEBOPTS=/Os /Zd
97: !else
98: DEBOPTS=/Oxt
99: !endif
100: !endif
101:
102: !if "$(CODEVIEW)" == "1"
103: !ifdef MKNT
104: DEBOPTS=$(DEBOPTS) /Zd
105: !else
106: DEBOPTS=$(DEBOPTS) /Zi
107: !endif
108: !endif
109:
110: # CVEXTRA used for select CodeView information (main files only)
111: !if "$(CODEVIEW)" == "2"
112: !ifdef MKNT
113: CVEXTRA=/Zd
114: !else
115: CVEXTRA=/Zi
116: !endif
117: !endif
118:
119: !if "$(MODEL)"=="s" || "$(MODEL)"=="S"
120: CL_MODEL=/AS
121: !else
122: !if "$(MODEL)"=="m" || "$(MODEL)"=="M"
123: CL_MODEL=/AM
124: !else
125: !if "$(MODEL)"=="c" || "$(MODEL)"=="C"
126: CL_MODEL=/AC
127: !else
128: !if "$(MODEL)"=="l" || "$(MODEL)"=="L"
129: CL_MODEL=/AL
130: !else
131: !if "$(MODEL)"=="n" || "$(MODEL)"=="N"
132: # Windows NT
133: CL_MODEL=/D_NTWIN /Di386
134: MKNT=1
135: !else
136: !error MODEL must be one of S, M, L, or N
137:
138: !endif
139: !endif
140: !endif
141: !endif
142: !endif
143:
144: !if "$(TARGET)"=="r" || "$(TARGET)"=="R"
145: !ifdef MKNT
146: TARGDEFS=
147: TARGOPTS=
148: EXPFLAG=
149: !else
150: TARGDEFS=/D_DOS
151: TARGOPTS=
152: EXPFLAG=
153: !endif
154: !else
155:
156: !if "$(TARGET)"=="w" || "$(TARGET)"=="W"
157: MKWIN=1
158: !ifdef MKNT
159: TARGDEFS=/D_WINDOWS /DWINVER=0x030a
160: EXPFLAG=
161: !else
162: TARGDEFS=/D_WINDOWS
163: TARGOPTS=/GA /GEs /G2
164: EXPFLAG=/GEe
165: !endif
166:
167: !else
168:
169: !error TARGET must be one of W, R
170:
171: !endif
172: !endif
173:
174:
175: !if "$(OBJ)" == ""
176: D=$$$(MODEL)$(TARGET)$(DEBUGSUF)
177: !if "$(DLL)" != "0"
178: D=$D.dll
179: !endif
180: !else
181: D=$(OBJ)
182: !endif
183:
184: DEFS=$(DEBDEFS) $(TARGDEFS)
185: CL_OPT=/W3 $(DEBOPTS) $(TARGOPTS) $(OPT)
186:
187: !if "$(DLL)" == "0"
188: # Normal library
189: GOAL=$(MODEL)afxc$(TARGET)$(DEBUGSUF)
190: !else
191: # DLL library (SS!=DS) - only Large model supported (compact model is possible)
192: GOAL=$(MODEL)afxd$(TARGET)$(DEBUGSUF)
193: CL_MODEL=$(CL_MODEL)w
194: TARGOPTS=/GD /G2
195: # /GD will define _WINDLL
196: !endif
197:
198: #############################################################################
199: # Library Components
200:
201: OBJECT=$D\object.obj $D\except.obj $D\dumpcont.obj $D\abort.obj \
202: $D\assert.obj $D\archive.obj $D\archivex.obj $D\memory.obj \
203: $D\validadd.obj $D\dumpinit.obj $D\version.obj
204:
205: FILES=$D\file.obj $D\filetxt.obj $D\filemem.obj $D\filex.obj
206:
207: COLLECTIONS=$D\array_b.obj $D\array_d.obj $D\array_o.obj $D\array_p.obj \
208: $D\array_s.obj $D\array_w.obj $D\list_o.obj $D\list_p.obj \
209: $D\list_s.obj $D\map_pp.obj $D\map_pw.obj $D\map_so.obj \
210: $D\map_sp.obj $D\map_ss.obj $D\map_wo.obj $D\map_wp.obj $D\plex.obj
211:
212: MISC=$D\string.obj $D\stringex.obj $D\time.obj
213:
214: WINDOWS=$D\window.obj $D\wingdi.obj $D\winctrl.obj $D\winstr.obj \
215: $D\winapp.obj $D\winmain.obj $D\winmenu.obj $D\winmdi.obj $D\trace.obj
216:
217: !ifdef MKNT
218: WINEXTRAS=$D\winbtn.obj $D\windlgs.obj
219: !else
220: WINEXTRAS=$D\penctrl.obj $D\winbtn.obj $D\windlgs.obj
221: !endif
222:
223: !if "$(DLL)" == "0"
224: OLE= $D\olemisc.obj $D\olefile.obj $D\olecli.obj $D\oleui.obj $D\oleui2.obj \
225: $D\olesvr.obj
226: !else
227: OLE= # OLE not supported for DLLs
228: !endif
229:
230: OBJS=$(OBJS) $(OBJECT) $(FILES) $(COLLECTIONS) $(MISC)
231:
232: !ifdef MKWIN
233: OBJS=$(OBJS) $(WINDOWS) $(WINEXTRAS) $(OLE)
234: !endif
235:
236:
237:
238:
239: #############################################################################
240: # Set CPPFLAGS for use with .cpp.obj and .c.obj rules
241: # Define rule for use with OBJ directory
242: # C++ uses a PCH file
243:
244: CPPFLAGS=$(CPPFLAGS) $(CL_STANDARD) $(CL_MODEL) $(CL_OPT) $(DEFS)
245:
246: !ifndef NO_PCH
247: PCH_FILE=$D\afxpch.pch
248: CPPFLAGS=$(CPPFLAGS) /Yu /Fp$(PCH_FILE)
249: !else
250: PCH_FILE=
251: !endif
252:
253: CFLAGS=$(CFLAGS) $(CL_STANDARD) $(CL_MODEL) $(CL_OPT) $(DEFS)
254:
255: .SUFFIXES : .cpp
256:
257: .cpp{$D}.obj:
258: !ifdef MKNT
259: $(CPP) $(CPPFLAGS) /c /Fo$@ $<
260: !else
261: $(CPP) @<<
262: $(CPPFLAGS) /c /Fo$@ $<
263: <<
264: !endif
265:
266: .c{$D}.obj:
267: !ifdef MKNT
268: $(CC) $(CFLAGS) /c /Fo$@ $<
269: !else
270: $(CC) @<<
271: $(CFLAGS) /c /Fo$@ $<
272: <<
273: !endif
274:
275: #############################################################################
276: # Goal to build
277:
278: goal: $D ..\lib\$(GOAL).lib
279:
280: $D:
281: IF NOT EXIST $D mkdir $D
282:
283: clean:
284: -erase $D\*.obj
285: -erase $D\*.pch
286: -rmdir $D
287:
288:
289: #############################################################################
290: # Precompiled header file
291:
292: !ifndef NO_PCH
293: INC_DIR=..\include
294: HDRS=$(INC_DIR)\afx.h $(INC_DIR)\afx.inl $(INC_DIR)\afxcoll.h \
295: $(INC_DIR)\afxwin.h $(INC_DIR)\afxwin.inl $(INC_DIR)\afxmsg.h \
296: $(INC_DIR)\afxres.h \
297: $(INC_DIR)\afxole.h $(INC_DIR)\afxoleui.h
298:
299: $D\object.obj $(PCH_FILE): object.cpp $(HDRS)
300: $(CPP) /c /Yc /Fp$(PCH_FILE) $(CL_STANDARD) $(CL_MODEL) $(CL_OPT) $(DEFS) $(CVEXTRA) /c /Fo$D\object.obj object.cpp
301: !endif
302:
303: ############################################################################
304: # CodeView for select files
305: !if "$(CODEVIEW)"=="2"
306: $D\memory.obj : memory.cpp
307: $(CPP) $(CPPFLAGS) $(CVEXTRA) /c /Fo$D\memory.obj memory.cpp
308:
309: !ifdef MKWIN
310: $D\winmain.obj : winmain.cpp
311: $(CPP) $(CPPFLAGS) $(CVEXTRA) /c /Fo$D\winmain.obj winmain.cpp
312:
313: $D\window.obj : window.cpp
314: $(CPP) $(CPPFLAGS) $(CVEXTRA) /c /Fo$D\window.obj window.cpp
315:
316: $D\winapp.obj : winapp.cpp
317: $(CPP) $(CPPFLAGS) $(CVEXTRA) /c /Fo$D\winapp.obj winapp.cpp
318: !endif
319: !endif
320:
321: #############################################################################
322: # Windows 3.0 loader export/version number
323: $D\version.obj : version.cpp
324: !ifdef MKNT
325: $(CPP) $(CPPFLAGS) $(EXPFLAG) /c /Fo$D\version.obj version.cpp
326: !else
327: $(CPP) @<<
328: $(CPPFLAGS) $(EXPFLAG) /c /Fo$D\version.obj version.cpp
329: <<
330: !endif
331:
332:
333: #############################################################################
334: # Library results
335:
336: ..\lib\$(GOAL).lib: $D $(OBJS)
337: -erase $@
338: !ifdef MKNT
339: coff -lib -out:..\lib\$(GOAL).lib $(OBJS)
340: !else
341: lib /PAGESIZE:128 @<<
342: ..\lib\$(GOAL).lib
343: y
344: $(OBJS)
345: nul
346: ;
347: <<
348: !endif
349:
350: #############################################################################
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.