source: trunk/src/helpers/makefile@ 90

Last change on this file since 90 was 75, checked in by umoeller, 24 years ago

Misc changes.

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 6.2 KB
Line 
1# $Id: makefile 75 2001-05-25 16:51:46Z 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# 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)
152!ifdef EMX
153 !emxomfar cr $* $?
154!else
155 !ilib /nol /nob $* -+$?;
156!endif
157
158# same thing for cp.lib
159$(OUTPUTDIR)\cp.lib: $(CPOBJS)
160!ifdef EMX
161 !emxomfar cr $* $?
162!else
163 !ilib /nol /nob $* -+$?;
164!endif
165
166# same thing for plainc.lib
167$(OUTPUTDIR)\plainc.lib: $(PLAINCOBJS)
168!ifdef EMX
169 !emxomfar cr $* $?
170!else
171 !ilib /nol /nob $* -+$?;
172!endif
173
174!include helpers_post.in
175
176
Note: See TracBrowser for help on using the repository browser.