Commit | Line | Data |
---|---|---|
a08cb76c DL |
1 | /**/# Imakefile file for liblw.a, Copyright (c) 1992-1993 Lucid, Inc. |
2 | ||
3 | /* | |
4 | * If you have Motif and want to provide support for Motif widgets in lwlib, | |
5 | * then define USE_MOTIF. | |
6 | * | |
7 | * If you have OpenLook and want to provide support for OpenLook widgets in | |
8 | * lwlib, then define USE_OLIT. | |
9 | * | |
10 | * Otherwise, define USE_LUCID to use Lucid's own Motif-lookalike widgets, | |
11 | * which are included in this directory. | |
12 | * | |
13 | * You cannot define USE_MOTIF and USE_OLIT at the same time, but USE_LUCID | |
14 | * may be defined along with either of the other two. | |
15 | * | |
16 | * The OLIT menubar is slow, and possibly buggy. We recommend against using | |
17 | * it unless you'd like to try to improve it (which we encourage.) | |
18 | * | |
19 | * The Lucid menubar is much faster than the Motif menubar, but is missing | |
20 | * a few features (most notably stay-up menus and keyboard traversal.) But | |
21 | * since it has the Motif look-and-feel, we recommend using it even if you | |
22 | * have Motif. | |
23 | * | |
24 | * Currently, only the Motif widgets provide support for dialog boxes. If | |
25 | * you don't have Motif, you will not be able to pop up dialog boxes from | |
26 | * emacs. If you define both USE_LUCID and USE_MOTIF, then the menus will | |
27 | * be implemented with Lucid widgets, and the dialog boxes will be | |
28 | * implemented with Motif widgets. | |
29 | * | |
30 | * It shouldn't take much work to add support for non-Motif dialog boxes; | |
31 | * all that one need do is add code that implements Athena versions of the | |
32 | * xm_create_dialog(), xm_update_one_widget(), and xm_update_one_value() | |
33 | * routines in lwlib-Xm.c. If you do this, please send us the code. | |
34 | * | |
35 | * If you have your X11 source tree online, then you should define | |
36 | * INCLUDE_EXTENSIONS to cause this library to contain some useful functions | |
37 | * which Xt should provide but doesn't. You can only do this if you have | |
38 | * the source tree online, because these functions require access to internal | |
39 | * Xt data structures that are not defined in the exported header files. | |
40 | * If you define INCLUDE_EXTENSIONS, then the variable $TOP must point at the | |
41 | * root of the X11 source tree. | |
42 | * | |
43 | * To build a "shared" version of lwlib as well, define BUILD_SHARED_LIB. | |
44 | * If INCLUDE_EXTENSIONS is defined, and you want to link with a dynamic | |
45 | * version of Xt, it may be necessary to build a shared version of lwlib as | |
46 | * well, as the X libraries sometimes put *different code* in the dynamic | |
47 | * and shared versions of their libraries, for some reason I don't understand. | |
48 | * | |
49 | * Remember, if you build and install a shared version of lwlib, you may need | |
50 | * to run ldconfig(8) before anything will realize that it exists. | |
51 | * | |
52 | * To compile with support for Lucid's Energize Programming System, you must | |
53 | * define all of ENERGIZE, USE_LUCID, USE_MOTIF, and INCLUDE_EXTENSIONS. | |
54 | */ | |
55 | ||
56 | #define USE_LUCID | |
57 | /* #define USE_MOTIF */ | |
58 | /* #define USE_OLIT */ | |
59 | /* #define BUILD_SHARED_LIB */ | |
60 | /* #define ENERGIZE */ | |
61 | ||
62 | /* #define INCLUDE_EXTENSIONS */ | |
63 | ||
64 | ||
65 | #ifdef INCLUDE_EXTENSIONS /* this is where it is at our site */ | |
66 | TOP = /$(WHICH_X)/mit | |
67 | #endif | |
68 | ||
69 | /* | |
70 | * | |
71 | * You shouldn't need to edit anything below this point. | |
72 | * | |
73 | */ | |
74 | ||
75 | #ifdef ENERGIZE | |
76 | # if !defined(USE_LUCID) || !defined(USE_MOTIF) || !defined(INCLUDE_EXTENSIONS) | |
77 | ERROR! Energize requires Lucid widgets, Motif, and X Extensions. | |
78 | # endif | |
79 | #endif /* ENERGIZE */ | |
80 | ||
81 | ||
82 | #ifdef BUILD_SHARED_LIB | |
83 | SOLWREV=1.0 | |
84 | #endif | |
85 | ||
86 | #if (ProjectX == 4) | |
87 | STD_DEFINES = LibraryDefines | |
88 | CDEBUGFLAGS = LibraryCDebugFlags | |
89 | EXT_DEFINES = -DTHIS_IS_X11R4 | |
90 | WHICH_X = x11r4 | |
91 | #define SpecialLibObjectRule SpecialObjectRule | |
92 | #else /* !4 */ | |
93 | #if (ProjectX == 5) | |
94 | #ifdef BUILD_SHARED_LIB | |
95 | # define DoSharedLib YES | |
96 | # define DoNormalLib YES | |
97 | #endif | |
98 | #include <Library.tmpl> | |
99 | EXT_DEFINES = -DTHIS_IS_X11R5 -DINCLUDE_ALLOCA_H | |
100 | WHICH_X = x11r5 | |
101 | #else /* !5 */ | |
102 | EXT_DEFINES = "ERROR! Imakefile was unable to determine whether this is X11r4 or X11r5." | |
103 | #endif /* !5 */ | |
104 | #endif /* !4 */ | |
105 | ||
106 | LUCID_SRCS = lwlib-Xlw.c xlwmenu.c | |
107 | LUCID_OBJS = lwlib-Xlw.o xlwmenu.o | |
108 | MOTIF_SRCS = lwlib-Xm.c | |
109 | MOTIF_OBJS = lwlib-Xm.o | |
110 | OLIT_SRCS = lwlib-Xol.c lwlib-Xol-mb.c | |
111 | OLIT_OBJS = lwlib-Xol.o lwlib-Xol-mb.o | |
112 | ||
113 | #ifdef INCLUDE_EXTENSIONS | |
114 | EXT_SRCS = dispatch.c xrdb-cpp.c xrdb.c | |
115 | EXT_OBJS = dispatch.o xrdb-cpp.o xrdb.o | |
116 | #endif | |
117 | ||
118 | #if (defined(USE_MOTIF) && defined(USE_OLIT)) | |
119 | TOOLKIT_DEFINES = "ERROR! You cannot define both USE_MOTIF and USE_OLIT at the same time (in Imakefile)." | |
120 | #else | |
121 | # if (defined(USE_MOTIF) && defined(USE_LUCID)) | |
122 | TOOLKIT_DEFINES = -DUSE_MOTIF -DUSE_LUCID | |
123 | TOOLKIT_SRCS = $(MOTIF_SRC) $(LUCID_SRCS) | |
124 | TOOLKIT_OBJS = $(MOTIF_OBJS) $(LUCID_OBJS) | |
125 | # else | |
126 | # if (defined(USE_OLIT) && defined(USE_LUCID)) | |
127 | DEFINES = -DUSE_OLIT -DUSE_LUCID | |
128 | TOOLKIT_SRCS = $(OLIT_SRC) $(LUCID_SRCS) | |
129 | TOOLKIT_OBJS = $(OLIT_OBJS) $(LUCID_OBJS) | |
130 | # else | |
131 | # if defined(USE_OLIT) | |
132 | TOOLKIT_DEFINES = -DUSE_OLIT | |
133 | TOOLKIT_SRCS = $(OLIT_SRC) | |
134 | TOOLKIT_OBJS = $(OLIT_OBJS) | |
135 | # else | |
136 | # if defined(USE_MOTIF) | |
137 | TOOLKIT_DEFINES = -DUSE_MOTIF | |
138 | TOOLKIT_SRCS = $(MOTIF_SRC) | |
139 | TOOLKIT_OBJS = $(MOTIF_OBJS) | |
140 | # else | |
141 | # if defined(USE_LUCID) | |
142 | TOOLKIT_DEFINES = -DUSE_LUCID | |
143 | TOOLKIT_SRCS = $(LUCID_SRC) | |
144 | TOOLKIT_OBJS = $(LUCID_OBJS) | |
145 | # else | |
146 | TOOLKIT_DEFINES = "ERROR! At least one of USE_MOTIF, USE_LUCID or USE_OLIT must be defined in Imakefile." | |
147 | # endif | |
148 | # endif | |
149 | # endif | |
150 | # endif | |
151 | # endif | |
152 | #endif | |
153 | ||
154 | #ifdef ENERGIZE | |
155 | # ifndef USE_MOTIF | |
156 | EZ_OBJS = "ERROR! ENERGIZE requires USE_MOTIF to be defined in Imakefile." | |
157 | # else | |
158 | EZ_OBJS = energize/blpsheet.o energize/build.o energize/classbr_ps.o \ | |
159 | energize/ctreebr_ps.o energize/debuggerps.o \ | |
160 | energize/editmode.o energize/leb_psheet.o \ | |
161 | energize/projectdisp.o energize/projectps.o \ | |
162 | energize/search.o energize/target.o | |
163 | ENERGIZEP = -DENERGIZE | |
164 | # endif | |
165 | #endif | |
166 | ||
167 | SRCS = lwlib.c $(TOOLKIT_SRCS) lwlib-utils.c $(EXT_SRCS) | |
168 | OBJS = lwlib.o $(TOOLKIT_OBJS) lwlib-utils.o $(EXT_OBJS) $(EZ_OBJS) | |
169 | EXT_FLAGS = -I$(TOOLKITSRC) $(EXT_DEFINES) | |
170 | LIBNAME = liblw.a | |
171 | ||
172 | ||
173 | #if defined(ENERGIZE) && defined(BUILD_SHARED_LIB) | |
174 | all:: | |
175 | @if [ ! -d shared ]; then mkdir shared; else exit 0; fi | |
176 | @if [ ! -d energize/shared ]; then mkdir energize/shared; \ | |
177 | else exit 0; fi | |
178 | @if [ ! -h shared/energize ]; \ | |
179 | then cd shared ; ln -s ../energize/shared energize ; \ | |
180 | else exit 0; fi | |
181 | ||
182 | clean:: | |
183 | $(RM) shared/energize | |
184 | #endif | |
185 | ||
186 | ||
187 | #ifdef BUILD_SHARED_LIB | |
188 | # if (ProjectX == 4) | |
189 | SharedLibraryObjectRule () | |
190 | NormalSharedLibraryTarget(lw,$(SOLWREV),$(OBJS)) | |
191 | # else /* X != 4 */ | |
192 | LibraryObjectRule () | |
193 | SharedLibraryTarget(lw,$(SOLWREV),$(OBJS),shared,..) | |
194 | # endif /* X != 4 */ | |
195 | #else /* !BUILD_SHARED_LIB */ | |
196 | NormalLibraryObjectRule () | |
197 | #endif /* !BUILD_SHARED_LIB */ | |
198 | ||
199 | NormalLibraryTarget (lw,$(OBJS)) | |
200 | MakefileSubdirs (energize) | |
201 | DependTarget () | |
202 | ||
203 | #ifdef ENERGIZE | |
204 | ||
205 | energize/Imakefile: | |
206 | -mkdir energize | |
207 | -(cd energize ; sh -c "ln -s ../$(VPATH)/energize/* .") | |
208 | ||
209 | /* #### we should automatically edit BUILD_SHARED_LIB into/out of the energize | |
210 | Imakefile, since that's the only thing down there that changes */ | |
211 | energize/Makefile: energize/Imakefile Imakefile | |
212 | $(MAKE) $(MFLAGS) Makefiles | |
213 | ||
214 | Makefile:: | |
215 | $(RM) energize/Makefile | |
216 | ||
217 | $(EZ_OBJS): energize/Makefile | |
218 | ${RM} $@ ; cd energize ; $(MAKE) $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" | |
219 | ||
220 | clean:: | |
221 | cd energize ; $(MAKE) $(MFLAGS) clean | |
222 | ||
223 | #endif | |
224 | ||
225 | #if defined(BUILD_SHARED_LIB) && (ProjectX == 4) | |
226 | # define LWObjectRule SpecialSharedObjectRule | |
227 | #else | |
228 | # define LWObjectRule SpecialLibObjectRule | |
229 | #endif | |
230 | ||
231 | CPPDEFS=-DCPP_PROGRAM=\"CppCmd\" | |
232 | ||
233 | LWObjectRule (lwlib.o, lwlib.c, $(TOOLKIT_DEFINES)) | |
234 | LWObjectRule (dispatch.o, dispatch.c, $(EXT_FLAGS)) | |
235 | LWObjectRule (xrdb-cpp.o, xrdb-cpp.c, $(EXT_FLAGS) "$(CPPDEFS)") | |
236 | LWObjectRule (xrdb.o, xrdb.c, $(EXT_FLAGS)) | |
237 | LWObjectRule (lwlib-Xm.o, lwlib-Xm.c, $(ENERGIZEP)) | |
238 | ||
239 | lwlib-utils.o: lwlib-utils.h | |
240 | lwlib.o: lwlib.h lwlib-internal.h | |
241 | lwlib-Xlw.o: lwlib.h lwlib-internal.h | |
242 | lwlib-Xm.o: lwlib.h lwlib-internal.h lwlib-utils.h | |
243 | lwlib-Xol.o: lwlib.h lwlib-internal.h | |
244 | lwlib-Xol-mb.o: lwlib-Xol-mb.h lwlib-Xol-mbP.h |