source: trunk/src/helpers/makefile@ 144

Last change on this file since 144 was 138, checked in by umoeller, 24 years ago

Sources as of V0.9.16.

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 7.8 KB
Line 
1# $Id: makefile 138 2002-02-04 21:21:38Z umoeller $
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 @nmake
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# "test" target: for test cases
145TESTCASE_DIR = testcase
146
147TESTCASE_CC = icc /c /ti+ /w2 /ss /se /i$(HELPERS_BASE)\include /DDEBUG_DIALOG_WINDOWS /Fo$(TESTCASE_DIR)\$(@B).obj $(@B).c
148
149.c.{$(TESTCASE_DIR)}.obj:
150 @echo $(MAKEDIR)\makefile: Compiling $(@B).c
151 $(TESTCASE_CC)
152
153# testcase executables
154TESTCASE_TARGETS = \
155 dosh.exe \
156 dialog.exe \
157 vcard.exe \
158 fdlg.exe \
159
160# dosh.exe
161DOSH_TEST_OBJS = \
162 $(TESTCASE_DIR)\dosh.obj \
163 $(TESTCASE_DIR)\_test_dosh.obj
164
165dosh.exe: $(DOSH_TEST_OBJS)
166 ilink /debug /optfunc /pmtype:vio $(DOSH_TEST_OBJS) /o:$@
167
168# dialog.exe
169DIALOG_TEST_OBJS = \
170 $(TESTCASE_DIR)\dialog.obj \
171 $(TESTCASE_DIR)\_test_dialog.obj \
172 $(TESTCASE_DIR)\winh.obj \
173 $(TESTCASE_DIR)\xstring.obj \
174 $(TESTCASE_DIR)\linklist.obj \
175 $(TESTCASE_DIR)\comctl.obj \
176 $(TESTCASE_DIR)\stringh.obj \
177 $(TESTCASE_DIR)\dosh.obj \
178 $(TESTCASE_DIR)\gpih.obj
179
180dialog.exe: $(DIALOG_TEST_OBJS)
181 ilink /debug /optfunc /pmtype:pm $(DIALOG_TEST_OBJS) /o:$@
182
183# vcard.exe
184VCARD_TEST_OBJS = \
185 $(TESTCASE_DIR)\vcard.obj \
186 $(TESTCASE_DIR)\_test_vcard.obj \
187 $(TESTCASE_DIR)\xstring.obj \
188 $(TESTCASE_DIR)\stringh.obj \
189 $(TESTCASE_DIR)\linklist.obj \
190 $(TESTCASE_DIR)\dosh.obj \
191 $(TESTCASE_DIR)\prfh.obj \
192 $(TESTCASE_DIR)\nls.obj
193
194vcard.exe: $(VCARD_TEST_OBJS)
195 ilink /debug /pmtype:vio $(VCARD_TEST_OBJS) /o:$@
196
197# vcard.exe
198VCARD_TEST_OBJS = \
199 $(TESTCASE_DIR)\_call_filedlg.obj
200
201fdlg.exe: $(VCARD_TEST_OBJS)
202 ilink /debug /pmtype:pm $(VCARD_TEST_OBJS) /o:$@
203
204test: $(TESTCASE_TARGETS)
205
206# Define the main dependency between the output HELPERS.LIB and
207# all the object files.
208# $? represents the names of all dependent files that are
209# out-of-date with respect to the target file.
210# The exclamation point ( ! ) preceding the LIB command causes NMAKE
211# to execute the LIB command once for each dependent file in the list.
212
213$(OUTPUTDIR)\helpers.lib: $(OBJS)
214!ifdef EMX
215 !emxomfar cr $* $?
216!else
217 !ilib /nol /nob $* -+$?;
218!endif
219
220# same thing for cp.lib
221$(OUTPUTDIR)\cp.lib: $(CPOBJS)
222!ifdef EMX
223 !emxomfar cr $* $?
224!else
225 !ilib /nol /nob $* -+$?;
226!endif
227
228# same thing for plainc.lib
229$(OUTPUTDIR)\plainc.lib: $(PLAINCOBJS)
230!ifdef EMX
231 !emxomfar cr $* $?
232!else
233 !ilib /nol /nob $* -+$?;
234!endif
235
236!include helpers_post.in
237
238
Note: See TracBrowser for help on using the repository browser.