source: branches/branch-1-0/src/helpers/makefile@ 413

Last change on this file since 413 was 403, checked in by pr, 14 years ago

Restore VAC 3.08 ilib capability.

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 10.1 KB
Line 
1# $Id: makefile 403 2012-02-12 22:47:59Z pr $
2
3#
4# makefile:
5# makefile for src/helpers directory.
6# For use with IBM NMAKE, which comes with the IBM compilers,
7# the Developer's Toolkit, and the DDK.
8#
9# This makefile is even more complicated than the other makefiles
10# because the helpers code has been designed to be independent
11# of any single project. For example, the helpers code is used
12# by XWorkplace also. As a result, I had to design a way so that
13# this makefile can produce output in a variable directory, with
14# variable compiler flags, and so on. This is done via environment
15# variables (see below).
16#
17# Even worse, with V0.9.5, I chose to create a shared runtime DLL
18# for the various WarpIN executables. For that, I chose to use
19# a separate makefile (makefile_dll). In order to share make
20# definitions, these have been put into separate .in files in
21# this directory, which are included via nmake !include.
22#
23# Called from: main makefile
24#
25# Required environment variables:
26#
27# -- PROJECT_BASE_DIR: where to find setup.in; this should
28# be the root directory of the project, e.g. "C:\cvs\warpin"
29# or "C:\cvs\xworkplace"
30#
31# -- HELPERS_OUTPUT_DIR: where to create output files (*.obj, helpers.lib)
32# this should be a "bin" directory (e.g. "C:\cvs\warpin\bin"
33#
34# -- CC_HELPERS: compiler command line for compiling C files.
35# With VAC++, this should include the /Ge+ (compile to EXE)
36# option to allow linking the library to both EXE and DLL
37# files.
38# If you're using the "dll" target, specify /Ge- instead.
39#
40# -- MAINMAKERUNNING: if this is NOT defined, this makefile
41# will recurse to the makefile in $(PROJECT_BASE_DIR).
42# So to have this makefile run successfully, define this
43# variable to something.
44#
45# This variable was introduced to be able to start a build
46# process from src\helpers as well. However, when your own
47# project makefile calls src\helpers\makefile, you must set
48# this to something.
49#
50# Input: ./*.c
51#
52# Targets: specify the target(s) to be made, which can be:
53#
54# -- "all" (default): create helpers.lib in addition
55# to all the output .obj files in $(HELPERS_OUTPUT_DIR).
56#
57# This contains all helpers (plain C, control program,
58# and PM).
59#
60# This makes linking a bit easier since you don't have to
61# keep in mind the millions of object files. Still, you
62# should be sure to include the proper headers in your
63# code.
64#
65# Alternatively, you can call this makefile with certain
66# targets explicitly specified. However, you must then
67# make sure that the resulted object files are linked
68# properly, because some of the more advanced helpers
69# require other helpers.
70#
71# -- "plainc": create "plainc.lib", which contains
72# platform-independent helpers code only (no control
73# program helpers, no PM helpers).
74#
75# This is included if you specify "all". Use this if
76# you want a subset of the helpers only.
77#
78# -- "cp": create "cp.lib", which contains "plainc" plus
79# control program helpers.
80#
81# This is included if you specify "all". Use this if
82# you want a subset of the helpers only.
83#
84# Edit "setup.in" to set up the make process.
85#
86
87# Say hello to yourself.
88!if [@echo +++++ Entering $(MAKEDIR)\makefile]
89!endif
90
91# helpers_pre.in: sets up more environment variables
92# and defines $(OBJ), which contains all object targets
93!include helpers_pre.in
94
95# The main target:
96# If we're called from the main makefile, MAINMAKERUNNING is defined,
97# and we'll set $(OBJS) as our targets (which will go on).
98# Otherwise, we call the main makefile, which will again call ourselves later.
99
100all: \
101!ifndef MAINMAKERUNNING
102 callmainmake
103 @echo ----- Leaving $(MAKEDIR)
104!else
105 $(OUTPUTDIR)\helpers.lib
106#$(OBJS)
107 @echo ----- Leaving $(MAKEDIR)
108!endif
109
110plainc: \
111!ifndef MAINMAKERUNNING
112 callmainmake
113 @echo ----- Leaving $(MAKEDIR)
114!else
115 $(OUTPUTDIR)\plainc.lib
116#$(OBJS)
117 @echo ----- Leaving $(MAKEDIR)
118!endif
119
120cp: \
121!ifndef MAINMAKERUNNING
122 callmainmake
123 @echo ----- Leaving $(MAKEDIR)
124!else
125 $(OUTPUTDIR)\cp.lib
126#$(OBJS)
127 @echo ----- Leaving $(MAKEDIR)
128!endif
129
130
131callmainmake:
132 @echo $(MAKEDIR)\makefile: Recursing to main makefile.
133 @cd $(PROJECT_BASE_DIR)
134 @$(MAKE) -nologo
135 @echo $(MAKEDIR)\makefile: Returned from main makefile. Done.
136
137# The "dep" target: run fastdep on the sources.
138# "nmake dep" gets called from src\makefile if nmake dep
139# is running on the main makefile.
140dep:
141 $(RUN_FASTDEP) *.c
142 @echo ----- Leaving $(MAKEDIR)
143
144# Define the main dependency between the output HELPERS.LIB and
145# all the object files.
146# $? represents the names of all dependent files that are
147# out-of-date with respect to the target file.
148# The exclamation point ( ! ) preceding the LIB command causes NMAKE
149# to execute the LIB command once for each dependent file in the list.
150
151$(OUTPUTDIR)\helpers.lib: $(OBJS) makefile
152!ifdef EMX
153 !emxomfar cr $* $?
154!else
155 - del $@
156# support both 3.08 and 3.6.5 ilib syntax V1.0.9 (2011-11-30) [slevine]
157!ifdef CXXMAIN
158# 2011-11-30 SHL fixme for no public symbols warning
159 -4 ilib /nol /nobr /out:$@ @<<$(TEMP)\ilib.lnk
160$(OBJS)
161<<
162!else
163 ilib /nol /nob $@ @<<$(TEMP)\ilib.lnk
164+$(OBJS: =&^
165);
166<<
167!endif
168!endif
169
170# same thing for cp.lib
171$(OUTPUTDIR)\cp.lib: $(CPOBJS) makefile
172!ifdef EMX
173 !emxomfar cr $* $?
174!else
175 - del $@
176# support both 3.08 and 3.6.5 ilib syntax V1.0.9 (2011-11-30) [slevine]
177!ifdef CXXMAIN
178 -4 ilib /nol /nobr /out:$@ @<<$(TEMP)\ilib.lnk
179$(CPOBJS)
180<<
181!else
182 ilib /nol /nob $@ @<<$(TEMP)\ilib.lnk
183+$(CPOBJS: =&^
184);
185<<
186!endif
187!endif
188
189# same thing for plainc.lib
190$(OUTPUTDIR)\plainc.lib: $(PLAINCOBJS) makefile
191!ifdef EMX
192 !emxomfar cr $* $?
193!else
194 - del $@
195# support both 3.08 and 3.6.5 ilib syntax V1.0.9 (2011-11-30) [slevine]
196!ifdef CXXMAIN
197 -4 ilib /nol /nobr /out:$@ @<<$(TEMP)\ilib.lnk
198$(PLAINCOBJS)
199<<
200!else
201 ilib /nol /nob $@ @<<$(TEMP)\ilib.lnk
202+$(PLAINCOBJS: =&^
203);
204<<
205!endif
206!endif
207
208!include helpers_post.in
209
210###################################################
211#
212# "test" target: for test cases
213#
214###################################################
215
216TESTCASE_DIR = testcase
217
218DEBUGDIALOG =
219!ifdef DBGDLG
220DEBUGDIALOG = /DDEBUG_DIALOG_WINDOWS=1
221!endif
222
223TESTCASE_CC = icc /c /ti+ /w2 /ss /se /D__DEBUG__=1 $(DEBUGDIALOG) /i$(HELPERS_BASE)\include /Fo$(TESTCASE_DIR)\$(@B).obj $(@B).c
224
225.c{$(TESTCASE_DIR)}.obj:
226 @echo $(MAKEDIR)\makefile: Compiling $(@B).c
227 @echo INCLUDE is $(INCLUDE)
228 $(TESTCASE_CC)
229
230# testcase executables
231TESTCASE_TARGETS = \
232 dosh.exe \
233 dialog.exe \
234 exeh.exe \
235 fdlg.exe \
236 xmap.exe \
237 vcard.exe
238
239# dialog.exe
240DIALOG_TEST_OBJS = \
241 $(TESTCASE_DIR)\dialog.obj \
242 $(TESTCASE_DIR)\_test_dialog.obj \
243 $(TESTCASE_DIR)\winh.obj \
244 $(TESTCASE_DIR)\xstring.obj \
245 $(TESTCASE_DIR)\linklist.obj \
246 $(TESTCASE_DIR)\cctl_checkcnr.obj \
247 $(TESTCASE_DIR)\cnrh.obj \
248 $(TESTCASE_DIR)\comctl.obj \
249 $(TESTCASE_DIR)\stringh.obj \
250 $(TESTCASE_DIR)\dosh.obj \
251 $(TESTCASE_DIR)\except.obj \
252 $(TESTCASE_DIR)\debug.obj \
253 $(TESTCASE_DIR)\textview.obj \
254 $(TESTCASE_DIR)\textv_html.obj \
255 $(TESTCASE_DIR)\tmsgfile.obj \
256 $(TESTCASE_DIR)\datetime.obj \
257 $(TESTCASE_DIR)\tree.obj \
258 $(TESTCASE_DIR)\gpih.obj
259
260$(TESTCASE_DIR)\dialog.obj: ..\..\include\helpers\dialog.h
261$(TESTCASE_DIR)\_test_dialog.obj: ..\..\include\helpers\dialog.h
262
263dialog.exe: $(DIALOG_TEST_OBJS)
264 ilink /debug /optfunc /pmtype:pm $(DIALOG_TEST_OBJS) pmprintf.lib /o:$@
265
266# dosh.exe
267DOSH_TEST_OBJS = \
268 $(TESTCASE_DIR)\dosh.obj \
269 $(TESTCASE_DIR)\_test_dosh.obj
270
271dosh.exe: $(DOSH_TEST_OBJS)
272 ilink /debug /optfunc /pmtype:vio $(DOSH_TEST_OBJS) pmprintf.lib /o:$@
273
274# exeh.exe
275EXEH_TEST_OBJS = \
276 $(TESTCASE_DIR)\dosh.obj \
277 $(TESTCASE_DIR)\exeh.obj \
278 $(TESTCASE_DIR)\stringh.obj \
279 $(TESTCASE_DIR)\xstring.obj \
280 $(TESTCASE_DIR)\_test_exeh.obj
281
282exeh.exe: $(EXEH_TEST_OBJS)
283 ilink /debug /optfunc /pmtype:vio $(EXEH_TEST_OBJS) pmprintf.lib /o:$@
284
285# fdlg.exe
286FDLG_TEST_OBJS = \
287 $(TESTCASE_DIR)\dosh.obj \
288 $(TESTCASE_DIR)\gpih.obj \
289 $(TESTCASE_DIR)\winh.obj \
290 $(TESTCASE_DIR)\stringh.obj \
291 $(TESTCASE_DIR)\xstring.obj \
292 $(TESTCASE_DIR)\_call_filedlg.obj
293
294fdlg.exe: $(FDLG_TEST_OBJS)
295 ilink /debug /pmtype:pm $(FDLG_TEST_OBJS) /o:$@
296
297# xmap.exe
298MAP_TEST_OBJS = \
299 $(TESTCASE_DIR)\map_vac.obj \
300 $(TESTCASE_DIR)\linklist.obj \
301 $(TESTCASE_DIR)\stringh.obj \
302 $(TESTCASE_DIR)\xstring.obj \
303 $(TESTCASE_DIR)\_test_map.obj
304
305xmap.exe: $(MAP_TEST_OBJS)
306 ilink /debug /optfunc /pmtype:vio $(MAP_TEST_OBJS) pmprintf.lib /o:$@
307
308# vcard.exe
309VCARD_TEST_OBJS = \
310 $(TESTCASE_DIR)\vcard.obj \
311 $(TESTCASE_DIR)\_test_vcard.obj \
312 $(TESTCASE_DIR)\xstring.obj \
313 $(TESTCASE_DIR)\stringh.obj \
314 $(TESTCASE_DIR)\linklist.obj \
315 $(TESTCASE_DIR)\dosh.obj \
316 $(TESTCASE_DIR)\prfh.obj \
317 $(TESTCASE_DIR)\nls.obj \
318 $(TESTCASE_DIR)\except.obj \
319 $(TESTCASE_DIR)\debug.obj \
320 $(TESTCASE_DIR)\tree.obj
321
322vcard.exe: $(VCARD_TEST_OBJS)
323 ilink /debug /pmtype:vio $(VCARD_TEST_OBJS) /o:$@
324
325test: $(TESTCASE_TARGETS)
326
327
Note: See TracBrowser for help on using the repository browser.