1 | # $Id: makefile 9 2000-10-27 21:34:28Z 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 | # -- PROJECT_BASE_DIR: where to find setup.in; this should
|
---|
27 | # be the root directory of the project, e.g. "C:\cvs\warpin"
|
---|
28 | # or "C:\cvs\xworkplace"
|
---|
29 | # -- HELPERS_OUTPUT_DIR: where to create output files (*.obj, helpers.lib)
|
---|
30 | # this should be a "bin" directory (e.g. "C:\cvs\warpin\bin"
|
---|
31 | # -- CC_HELPERS: compiler command line for compiling C files.
|
---|
32 | # With VAC++, this should include the /Ge+ (compile to EXE)
|
---|
33 | # option to allow linking the library to both EXE and DLL
|
---|
34 | # files.
|
---|
35 | # If you're using the "dll" target, specify /Ge- instead.
|
---|
36 | # -- MAINMAKERUNNING: if this is NOT defined, this makefile
|
---|
37 | # will recurse to the makefile in $(PROJECT_BASE_DIR).
|
---|
38 | # So to have this makefile run successfully, define this
|
---|
39 | # variable to something.
|
---|
40 | # This variable was introduced to be able to start a build
|
---|
41 | # process from src\helpers as well. However, when your own
|
---|
42 | # project makefile calls src\helpers\makefile, you must set
|
---|
43 | # this to something.
|
---|
44 | #
|
---|
45 | # Input: ./*.c
|
---|
46 | #
|
---|
47 | # Targets: specify the target(s) to be made, which can be:
|
---|
48 | #
|
---|
49 | # -- "all" (default): create helpers.lib in addition
|
---|
50 | # to all the output .obj files in $(HELPERS_OUTPUT_DIR).
|
---|
51 | #
|
---|
52 | # This contains all helpers (plain C, control program,
|
---|
53 | # and PM).
|
---|
54 | #
|
---|
55 | # This makes linking a bit easier since you don't have to
|
---|
56 | # keep in mind the millions of object files. Still, you
|
---|
57 | # should be sure to include the proper headers in your
|
---|
58 | # code.
|
---|
59 | #
|
---|
60 | # Alternatively, you can call this makefile with certain
|
---|
61 | # targets explicitly specified. However, you must then
|
---|
62 | # make sure that the resulted object files are linked
|
---|
63 | # properly, because some of the more advanced helpers
|
---|
64 | # require other helpers.
|
---|
65 | #
|
---|
66 | # -- "plainc": create "plainc.lib", which contains
|
---|
67 | # platform-independent helpers code only (no control
|
---|
68 | # program helpers, no PM helpers).
|
---|
69 | #
|
---|
70 | # This is included if you specify "all". Use this if
|
---|
71 | # you want a subset of the helpers only.
|
---|
72 | #
|
---|
73 | # -- "cp": create "cp.lib", which contains "plainc" plus
|
---|
74 | # control program helpers.
|
---|
75 | #
|
---|
76 | # This is included if you specify "all". Use this if
|
---|
77 | # you want a subset of the helpers only.
|
---|
78 | #
|
---|
79 | # Edit "setup.in" to set up the make process.
|
---|
80 | #
|
---|
81 |
|
---|
82 | # Say hello to yourself.
|
---|
83 | !if [@echo +++++ Entering $(MAKEDIR)\makefile]
|
---|
84 | !endif
|
---|
85 |
|
---|
86 | # helpers_pre.in: sets up more environment variables
|
---|
87 | # and defines $(OBJ), which contains all object targets
|
---|
88 | !include helpers_pre.in
|
---|
89 |
|
---|
90 | # The main target:
|
---|
91 | # If we're called from the main makefile, MAINMAKERUNNING is defined,
|
---|
92 | # and we'll set $(OBJS) as our targets (which will go on).
|
---|
93 | # Otherwise, we call the main makefile, which will again call ourselves later.
|
---|
94 |
|
---|
95 | all: \
|
---|
96 | !ifndef MAINMAKERUNNING
|
---|
97 | callmainmake
|
---|
98 | @echo ----- Leaving $(MAKEDIR)
|
---|
99 | !else
|
---|
100 | $(OUTPUTDIR)\helpers.lib
|
---|
101 | #$(OBJS)
|
---|
102 | @echo ----- Leaving $(MAKEDIR)
|
---|
103 | !endif
|
---|
104 |
|
---|
105 | plainc: \
|
---|
106 | !ifndef MAINMAKERUNNING
|
---|
107 | callmainmake
|
---|
108 | @echo ----- Leaving $(MAKEDIR)
|
---|
109 | !else
|
---|
110 | $(OUTPUTDIR)\plainc.lib
|
---|
111 | #$(OBJS)
|
---|
112 | @echo ----- Leaving $(MAKEDIR)
|
---|
113 | !endif
|
---|
114 |
|
---|
115 | cp: \
|
---|
116 | !ifndef MAINMAKERUNNING
|
---|
117 | callmainmake
|
---|
118 | @echo ----- Leaving $(MAKEDIR)
|
---|
119 | !else
|
---|
120 | $(OUTPUTDIR)\cp.lib
|
---|
121 | #$(OBJS)
|
---|
122 | @echo ----- Leaving $(MAKEDIR)
|
---|
123 | !endif
|
---|
124 |
|
---|
125 |
|
---|
126 | callmainmake:
|
---|
127 | @echo $(MAKEDIR)\makefile: Recursing to main makefile.
|
---|
128 | @cd $(PROJECT_BASE_DIR)
|
---|
129 | @nmake
|
---|
130 | @echo $(MAKEDIR)\makefile: Returned from main makefile. Done.
|
---|
131 |
|
---|
132 | # Define the main dependency between the output HELPERS.LIB and
|
---|
133 | # all the object files.
|
---|
134 | # $? represents the names of all dependent files that are
|
---|
135 | # out-of-date with respect to the target file.
|
---|
136 | # The exclamation point ( ! ) preceding the LIB command causes NMAKE
|
---|
137 | # to execute the LIB command once for each dependent file in the list.
|
---|
138 | $(OUTPUTDIR)\helpers.lib: $(OBJS)
|
---|
139 | !ifdef EMX
|
---|
140 | !emxomfar cr $(OUTPUTDIR)\helpers.lib $?
|
---|
141 | !else
|
---|
142 | !ilib /nol /nob $(OUTPUTDIR)\helpers.lib -+$?;
|
---|
143 | !endif
|
---|
144 |
|
---|
145 | !include helpers_post.in
|
---|
146 |
|
---|
147 |
|
---|