|
|
1.1 root 1: # build/Common.bmake
2: #
3: # Global build system setup file for Borland Make/BCC
4: #
5: # $Id: Common.bmake,v 1.38 2004/09/23 18:12:04 rswindell Exp $
6: #
7: #############################################################################
8: # #
9: # Common macro setup for Borland make #
10: # #
11: # Common Build Macros REQUIRED: #
12: # SRC_ROOT - *MUST* be set to the src dir #
13: # #
14: # Common Build Macros Used: #
15: # DEBUG - Create a debug build #
16: # RELEASE - Create a release build #
17: # (Mutually exclusive, if both are set, RELEASE #
18: # is cleared) #
19: # DONT_CLOBBER_CC - Do not change the default setting of CC #
20: # OBJPATH_SUFFIX - Suffix appended to OBJPATH usefull for compiling #
21: # different options of the same source file #
22: # #
23: # Common Build Macros Defined: #
24: # DELETE - Delete files (Preferrably verbose) #
25: # OBJODIR - Object output dir #
26: # LIBODIR - Library output dir #
27: # EXEODIR - Executable output dir #
28: # DEBUG - Set for debug builds #
29: # RELEASE - Set for release builds #
30: # One of DEBUG or RELEASE is always set! #
31: # QUIET - Target command prefix to show/not show commands #
32: # (Toggled off by setting VERBOSE) #
33: # CFLAGS - Common C and C++ compiler flags #
34: # CCFLAGS - C specific compiler flags #
35: # CXXFLAGS - C++ specific compiler flags #
36: # LDFLAGS - Linker flags #
37: # CC - C compiler #
38: # CXX - C++ compiler #
39: # EXEFILE - Executable file extension (Includes .) #
40: # OFILE - Object file extension (Includes .) #
41: # SOFILE - Shared object (DLL) file extension (Includes .) #
42: # LIBFILE - Static library file extension (Include .) #
43: # LIBPREFIX - Prefix to library filename #
44: # LIBS - Library names (Appropriate for dependencies) #
45: # LIB_LDFLAGS - Libraries appropriate for link command-line usage #
46: # COMPILE_MSG - Message saying a target is being compiled #
47: # DIRSEP - The directory seperator this system likes most #
48: # VERSION - Synchronet version number in MAJOR.MINOR format #
49: # (Numeric ONLY) #
50: # OUTPUT - Compiler flag specifying output filename #
51: # LOUTPUT - Linker flag specifying output filename #
52: # XPDEV_SRC - Path to xpdev #
53: # UIFC_SRC - Path to uifc #
54: # CIOLIB_SRC - Path to ciolib #
55: # SMBLIB_SRC - Path to smblib #
56: # MT_CFLAGS - CFLAGS for building MT objects #
57: # MT_LDFLAGS - LDFLAGS for linking MT targets #
58: # UL_PRE - Use Library prefix (*nix is -l) #
59: # UL_SUF - Use Library siffix (bcc is .lib) #
60: # #
61: # Common Targets Defined: #
62: # Implicit C and C++ targets #
63: # "clean" target #
64: # Output directory targets #
65: # #
66: #############################################################################
67:
68: .autodepend
69: .cacheautodepend
70:
71: # Macros
72: # Set VERSION
73: !ifndef VERSION
74: VERSION = 3.12
75: !endif
76:
77: # Set DEBUG
78: !ifdef DEBUG
79: ! ifdef RELEASE
80: ! undef RELEASE
81: ! endif
82: !endif
83:
84: !ifndef DEBUG
85: ! ifndef RELEASE
86: DEBUG = 1
87: ! endif
88: !endif
89:
90: # VERBOSE/QUIET
91: !ifndef VERBOSE
92: QUIET = @
93: !endif
94:
95: # OS-specific
96: DIRSEP = \ # This comment is necessary
97: EXEFILE = .exe
98: OFILE = .obj
99: SOFILE = .dll
100: LIBFILE = .lib
101: DELETE = echo y | del
102: IFNOTEXIST = if not exist $@
103: UL_PRE =
104: UL_SUF = $(LIBFILE)
105:
106: # Compiler-specific
107: !ifdef msc # Microsoft Visual C++
108: CC = cl
109: LD = link
110: CCPRE = msvc.win32
111: OUTPUT = -Fo
112: LOUTPUT = -Fe
113: CFLAGS = -nologo -MTd
114: LDFLAGS = $(CFLAGS)
115: !ifdef DEBUG
116: CFLAGS = $(CFLAGS) -Yd
117: !endif
118:
119: !else # Borland C++
120:
121: CC = bcc32
122: CCPRE = bcc
123: LD = ilink32
124: OUTPUT = -o
125: LOUTPUT = $(OUTPUT)
126: CFLAGS = -q
127: LDFLAGS = $(CFLAGS)
128: CFLAGS = $(CFLAGS) -M -X-
129: MT_CFLAGS = -WM
130: MT_LDFLAGS = -WM
131: !ifdef DEBUG
132: CFLAGS = $(CFLAGS) -v
133: !endif
134: !endif
135:
136: # Common compiler flags
137: !ifdef DEBUG
138: CFLAGS = $(CFLAGS) -Od -D_DEBUG
139: !endif
140:
141: # Debug or release build?
142: !ifdef DEBUG
143: BUILDPATH = debug
144: !else
145: BUILDPATH = release
146: !endif
147:
148: OBJODIR = $(CCPRE).win32.obj.$(BUILDPATH)
149: MTOBJODIR = $(CCPRE).win32.obj.$(BUILDPATH)_mt
150: LIBODIR = $(CCPRE).win32.lib.$(BUILDPATH)
151: EXEODIR = $(CCPRE).win32.exe.$(BUILDPATH)
152:
153: # Paths
154: XPDEV_SRC = $(SRC_ROOT)$(DIRSEP)xpdev
155: CIOLIB_SRC = $(SRC_ROOT)$(DIRSEP)conio
156: SMBLIB_SRC = $(SRC_ROOT)$(DIRSEP)smblib
157: UIFC_SRC = $(SRC_ROOT)$(DIRSEP)uifc
158:
159: # Pull in lib-specific flags
160: !include $(CIOLIB_SRC)$(DIRSEP)Common.make
161: !include $(UIFC_SRC)$(DIRSEP)Common.make
162: !include $(SMBLIB_SRC)$(DIRSEP)Common.make
163: !include $(XPDEV_SRC)$(DIRSEP)Common.make
164:
165: .path.c = .
166: .path.cpp = .
167:
168: !include targets.mk
169: !include $(SRC_ROOT)/build/rules.mk
170: !include objects.mk # defines $(OBJS)
171:
172: .SUFFIXES
173: .SUFFIXES .cpp .c
174: # Implicit C Compile Rule
175: .c{$(OBJODIR)}$(OFILE):
176: $(QUIET)$(CC) $(CFLAGS) $(CCFLAGS) -n$(OBJODIR) -c $< $(OUTPUT)$@
177:
178: # Implicit C++ Compile Rule
179: .cpp{$(OBJODIR)}$(OFILE):
180: $(QUIET)$(CC) $(CFLAGS) $(CXXFLAGS) -n$(OBJODIR) -c $< $(OUTPUT)$@
181:
182: # Implicit MT C Compile Rule
183: .c{$(MTOBJODIR)}$(OFILE):
184: $(QUIET)$(CC) $(CFLAGS) $(CCFLAGS) -n$(MTOBJODIR) $(MT_CFLAGS) -c $< $(OUTPUT)$@
185:
186: # Implicit MT C++ Compile Rule
187: .cpp{$(MTOBJODIR)}$(OFILE):
188: $(QUIET)$(CC) $(CFLAGS) $(CXXFLAGS) -n$(MTOBJODIR) $(MT_CFLAGS) -c $< $(OUTPUT)$@
189:
190: $(XPDEV_LIB): xpdev
191: xpdev:
192: $(COMSPEC) <<|
193: set VERSION=$(VERSION)
194: set DEBUG=$(DEBUG)
195: set RELEASE=$(RELEASE)
196: set VERBOSE=$(VERBOSE)
197: cd $(XPDEV_SRC)
198: $(MAKE) -$(MAKEFLAGS) lib
199: exit
200: |
201:
202: $(XPDEV-MT_LIB): xpdev-mt
203: xpdev-mt:
204: $(COMSPEC) <<|
205: set VERSION=$(VERSION)
206: set DEBUG=$(DEBUG)
207: set RELEASE=$(RELEASE)
208: set VERBOSE=$(VERBOSE)
209: cd $(XPDEV_SRC)
210: $(MAKE) -$(MAKEFLAGS) mtlib
211: exit
212: |
213:
214: $(SMBLIB): smblib
215: smblib:
216: $(COMSPEC) <<|
217: set VERSION=$(VERSION)
218: set DEBUG=$(DEBUG)
219: set RELEASE=$(RELEASE)
220: set VERBOSE=$(VERBOSE)
221: cd $(SMBLIB_SRC)
222: $(MAKE) -$(MAKEFLAGS) lib
223: exit
224: |
225:
226: $(CIOLIB-MT): ciolib-mt
227: ciolib-mt:
228: $(COMSPEC) <<|
229: set VERSION=$(VERSION)
230: set DEBUG=$(DEBUG)
231: set RELEASE=$(RELEASE)
232: set VERBOSE=$(VERBOSE)
233: cd $(CIOLIB_SRC)
234: $(MAKE) -$(MAKEFLAGS) mtlib
235: exit
236: |
237:
238: $(UIFCLIB): uifc
239: uifc:
240: $(COMSPEC) <<|
241: set VERSION=$(VERSION)
242: set DEBUG=$(DEBUG)
243: set RELEASE=$(RELEASE)
244: set VERBOSE=$(VERBOSE)
245: cd $(UIFC_SRC)
246: $(MAKE) -$(MAKEFLAGS) lib
247: exit
248: |
249:
250: $(UIFCLIB-MT): uifc-mt
251: uifc-mt:
252: $(COMSPEC) <<|
253: set VERSION=$(VERSION)
254: set DEBUG=$(DEBUG)
255: set RELEASE=$(RELEASE)
256: set VERBOSE=$(VERBOSE)
257: cd $(UIFC_SRC)
258: $(MAKE) -$(MAKEFLAGS) mtlib
259: exit
260: |
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.