1 /**/# Imakefile file for liblw.a, Copyright (c) 1992-1993 Lucid, Inc.
4 * If you have Motif and want to provide support for Motif widgets in lwlib,
5 * then define USE_MOTIF.
7 * If you have OpenLook and want to provide support for OpenLook widgets in
8 * lwlib, then define USE_OLIT.
10 * Otherwise, define USE_LUCID to use Lucid's own Motif-lookalike widgets,
11 * which are included in this directory.
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.
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.)
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
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.
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.
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.
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.
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.
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.
57 /* #define USE_MOTIF */
58 /* #define USE_OLIT */
59 /* #define BUILD_SHARED_LIB */
60 /* #define ENERGIZE */
62 /* #define INCLUDE_EXTENSIONS */
65 #ifdef INCLUDE_EXTENSIONS /* this is where it is at our site */
71 * You shouldn't need to edit anything below this point.
76 # if !defined(USE_LUCID) || !defined(USE_MOTIF) || !defined(INCLUDE_EXTENSIONS)
77 ERROR! Energize requires Lucid widgets, Motif, and X Extensions.
82 #ifdef BUILD_SHARED_LIB
87 STD_DEFINES = LibraryDefines
88 CDEBUGFLAGS = LibraryCDebugFlags
89 EXT_DEFINES = -DTHIS_IS_X11R4
91 #define SpecialLibObjectRule SpecialObjectRule
94 #ifdef BUILD_SHARED_LIB
95 # define DoSharedLib YES
96 # define DoNormalLib YES
98 #include <Library.tmpl>
99 EXT_DEFINES = -DTHIS_IS_X11R5 -DINCLUDE_ALLOCA_H
102 EXT_DEFINES = "ERROR! Imakefile was unable to determine whether this is X11r4 or X11r5."
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
113 #ifdef INCLUDE_EXTENSIONS
114 EXT_SRCS = dispatch.c xrdb-cpp.c xrdb.c
115 EXT_OBJS = dispatch.o xrdb-cpp.o xrdb.o
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)."
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)
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)
131 # if defined(USE_OLIT)
132 TOOLKIT_DEFINES = -DUSE_OLIT
133 TOOLKIT_SRCS = $(OLIT_SRC)
134 TOOLKIT_OBJS = $(OLIT_OBJS)
136 # if defined(USE_MOTIF)
137 TOOLKIT_DEFINES = -DUSE_MOTIF
138 TOOLKIT_SRCS = $(MOTIF_SRC)
139 TOOLKIT_OBJS = $(MOTIF_OBJS)
141 # if defined(USE_LUCID)
142 TOOLKIT_DEFINES = -DUSE_LUCID
143 TOOLKIT_SRCS = $(LUCID_SRC)
144 TOOLKIT_OBJS = $(LUCID_OBJS)
146 TOOLKIT_DEFINES = "ERROR! At least one of USE_MOTIF, USE_LUCID or USE_OLIT must be defined in Imakefile."
156 EZ_OBJS = "ERROR! ENERGIZE requires USE_MOTIF to be defined in Imakefile."
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
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)
173 #if defined(ENERGIZE) && defined(BUILD_SHARED_LIB)
175 @if [ ! -d shared ]; then mkdir shared; else exit 0; fi
176 @if [ ! -d energize/shared ]; then mkdir energize/shared; \
178 @if [ ! -h shared/energize ]; \
179 then cd shared ; ln -s ../energize/shared energize ; \
183 $(RM) shared/energize
187 #ifdef BUILD_SHARED_LIB
189 SharedLibraryObjectRule ()
190 NormalSharedLibraryTarget(lw,$(SOLWREV),$(OBJS))
193 SharedLibraryTarget(lw,$(SOLWREV),$(OBJS),shared,..)
195 #else /* !BUILD_SHARED_LIB */
196 NormalLibraryObjectRule ()
197 #endif /* !BUILD_SHARED_LIB */
199 NormalLibraryTarget (lw,$(OBJS))
200 MakefileSubdirs (energize)
207 -(cd energize ; sh -c "ln -s ../$(VPATH)/energize/* .")
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
215 $(RM) energize/Makefile
217 $(EZ_OBJS): energize/Makefile
218 ${RM} $@ ; cd energize ; $(MAKE) $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)"
221 cd energize ; $(MAKE) $(MFLAGS) clean
225 #if defined(BUILD_SHARED_LIB) && (ProjectX == 4)
226 # define LWObjectRule SpecialSharedObjectRule
228 # define LWObjectRule SpecialLibObjectRule
231 CPPDEFS=-DCPP_PROGRAM=\"CppCmd\"
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))
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