3 # $XConsortium: Makefile.include /main/3 1995/11/06 17:09:05 rswiston $
5 # %W% %G% cde_app_builder
7 # RESTRICTED CONFIDENTIAL INFORMATION:
9 # The information in this document is subject to special
10 # restrictions in a confidential disclosure agreement between
11 # HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
12 # document outside HP, IBM, Sun, USL, SCO, or Univel without
13 # Sun's specific written approval. This document and all copies
14 # and derivative works thereof must be returned or destroyed at
17 # Copyright 1993 Sun Microsystems, Inc. All rights reserved.
22 # This file is meant to be included in each Makefile associated with
23 # a particular project. The following parameters should be defined
24 # by the including Makefile, as appropriate:
26 # PROJECTDIR Top-level project directory
27 # LIBRARY Target library
28 # PROGRAM Target program
29 # LOCALE Locale to install into
30 # SOURCES.G GUIDE Intermediate Languages
32 # SOURCES.uil UIL files
33 # SOURCES.xres X Resource files
34 # SOURCES.h Include files
36 # SOURCES.sh Shell scripts
37 # SOURCES.y Yacc files
38 # SOURCES.pkg SVR4 package files
39 # SOURCES.po Localization message files (only for testing)
40 # IMAGES Bitmap/icon files
42 # Note that the localization items (e.g., .mo files are not shipped as
43 # part of guide. They are installed into a test directory (for testing,
48 # Switch build environment based on OS. Automatically switches
49 # for 4.1.x or 5.X builds. Override with:
52 # Solaris 2.0 bundles OpenWindows with the environment and
53 # locates it in /usr/openwin. When compiling under 5.0, either
54 # don't set OPENWINHOME, or make sure that it is set to
55 # /usr/openwin so that LD_RUN_PATH (-R) is correct. If OpenWindows
56 # is located somewhere else, then make a link from /usr/openwin to
57 # that location before compiling.
61 in ?*) echo ${OPENWINHOME};; \
62 *) echo "/usr/openwin";; \
69 in ?*) echo ${MOTIFHOME};; \
70 *) echo "/opt/SUNWmotif";; \
93 $(SOURCES.G:%.G=%_ui.c) \
94 $(STUBS.G:%.G=%_stubs.c) \
95 $(SOURCES.l:%.l=%.c) \
99 $(SOURCES.G:%.G=%_ui.h) \
100 $(SOURCES.y:%.y=%.h) \
101 $(SOURCES.cps:%.cps=%.h)
104 $(SOURCES.uil:%.uil=uid/%.uid)
107 $(SOURCES.G:%.G=%.info)
113 $(SOURCES.po:%.po=%.mo)
124 $(SOURCES.c:%.c=%.o) \
128 # The project dir (i.e. PROJECTDIR) relative to the build include and lib
129 # directories (i.e. $(PROJECTDIR)/include/ab, $(PROJECTDIR)/lib).
133 DESTDIR = $(PROJECTDIR)/installed
135 INSTALL += $(PROGRAM)$(TARGETS.sh) # no space!!!
136 INSTDIR = $(DESTDIR)/bin
138 INSTALL.a += $(LIBRARY)
139 INSTDIR.a += $(DESTDIR)/lib
142 INSTDIR.h = $(DESTDIR)/include
144 INSTALL.ps += $(SOURCES.ps)
145 INSTDIR.ps = $(DESTDIR)/etc
147 INSTALL.other += $(TARGETS.other)
148 INSTDIR.other = $(DESTDIR)/lib/locale/C/help
150 INSTALL.misc += $(SOURCES.misc)
151 INSTDIR.misc = $(DESTDIR)/lib
153 INSTALL.mo += $(TARGETS.mo)
154 INSTDIR.mo = $(DESTDIR)/test-l10n/lib/locale/$(LOCALE)/LC_MESSAGES
156 INSTALL.svr4 += $(SOURCES.pkg)
157 INSTDIR.svr4 = $(DESTDIR)/svr4_installed
161 INST = /usr/ucb/install
168 PKGINST = /usr/ucb/install
173 CPPFLAGS += -I$(PROJECTDIR)/src/include -I$(WIN_HOME)/include
174 LDFLAGS += -L$(WIN_HOME)/lib -R$(WIN_HOME)/lib -L$(PROJECTDIR)/src/lib
177 ULIBS += $(PROJECTDIR)/src/lib/libAButil.a
178 .PRECIOUS: $(ULIBS) $(LIBRARY)
183 all: $(SOURCES) $(IMAGES) $(TARGETS) .WAIT $(LIBRARY) $(PROGRAM)
184 objects: $(SOURCES.c) $(TARGETS.c) $(TARGETS.h) $(TARGETS.mo) .WAIT $(OBJECTS)
185 sources: $(SOURCES) $(IMAGES)
186 targets: $(SOURCES) $(IMAGES) $(TARGETS)
188 $(PROGRAM): $(SOURCES) $(TARGETS) $(OBJECTS) $(ULIBS)
189 $(PURIFY) $(LINK.c) -o $(PROGRAM) $(OBJECTS) $(ULIBS) $(LDLIBS)
192 $(G2C) $(G2CFLAGS) $*
202 $(MOTIFHOME)/bin/uil $< -o $@
204 # This rewrites the entire library any time an object changes (not *too* bad).
205 # Should be able to only replace new objects, but this works
206 $(LIBRARY): $(LIBRARY)($(OBJECTS))
215 @if [ "$(INSTALL)" ] ; then \
217 $(INST) -d $(INSTDIR) ; \
218 $(INST) -m 555 $(INSTALL) $(INSTDIR) ; \
219 if [ "$(ALT_PROGRAM_NAME)" ] ; then \
220 if [ -f $(INSTDIR)/$(PROGRAM) ] ; then \
222 $(RM) $(ALT_PROGRAM_NAME) ; \
223 ln -s $(PROGRAM) $(ALT_PROGRAM_NAME)) ; \
227 @if [ "$(INSTALL.a)" ] ; then \
229 $(INST) -d $(INSTDIR.a) ; \
230 $(INST) -m 664 $(INSTALL.a) $(INSTDIR.a) ; \
231 (cd $(INSTDIR.a) ; chmod 444 $(INSTALL.a)) ; \
233 @if [ "$(INSTALL.h)" ] ; then \
235 $(INST) -d $(INSTDIR.h) ; \
236 $(INST) -m 444 $(INSTALL.h) $(INSTDIR.h) ; \
238 @if [ "$(INSTALL.share)" ] ; then \
240 $(INST) -d $(DESTDIR)/share/$(INSTALL.share) ; \
241 if [ ! -d $(DESTDIR)/$(INSTALL.share) ] ; then \
242 (cd $(DESTDIR) ; ln -s share/$(INSTALL.share)) ; \
245 @if [ "$(INSTALL.libshare)" ] ; then \
247 $(INST) -d $(DESTDIR)/share/lib/$(INSTALL.libshare) ; \
248 if [ ! -d $(DESTDIR)/lib/$(INSTALL.libshare) ] ; then \
249 (cd $(DESTDIR)/lib ; ln -s ../share/lib/$(INSTALL.libshare)) ; \
252 @if [ "$(INSTALL.other)" ] ; then \
254 $(INST) -d $(INSTDIR.other) ; \
255 $(INST) -m 444 $(INSTALL.other) $(INSTDIR.other) ; \
257 @if [ "$(INSTALL.misc)" ] ; then \
259 $(INST) -d $(INSTDIR.misc) ; \
260 $(INST) -m 444 $(INSTALL.misc) $(INSTDIR.misc) ; \
262 @if [ "$(INSTALL.ps)" ] ; then \
264 $(INST) -d $(INSTDIR.ps) ; \
265 $(INST) -m 444 $(INSTALL.ps) $(INSTDIR.ps) ; \
267 @if [ "$(INSTALL.postinstall)" ] ; then \
269 if [ ! -d $(DESTDIR)/lib/help ] ; then \
270 (cd $(DESTDIR)/lib ; \
271 ln -s ./$(INSTALL.postinstall)) ; \
274 @if [ "$(INSTALL.mo)" ] ; then \
276 $(INST) -d $(INSTDIR.mo) ; \
277 $(INST) -m 444 $(INSTALL.mo) $(INSTDIR.mo) ; \
279 @if [ "$(INSTALL.svr4)" ] ; then \
280 $(PKGINST) -d $(INSTDIR) ; \
281 $(PKGINST) -m 644 $(SOURCES.pkg) $(INSTDIR) ; \
282 $(PKGINST) -m 555 $(SOURCES.sh) $(INSTDIR) ; \
283 (cd $(INSTDIR) ; make_package) ; \
287 includes: ${SOURCES.h.shipped} ${SOURCES.h.shared} ${SOURCES.h.unshared}
288 @if [ "x${SOURCES.h.shipped}" != "x" ] ; then \
289 for file in . ${SOURCES.h.shipped} ; do \
290 if [ "x$$file" != "x." ];then \
291 echo "$$file => ${PROJECTDIR}/src/include/ab"; \
292 ${RM} ${PROJECTDIR}/src/include/ab/$$file; \
293 ${LN} ../../${LIBPART}/$$file \
294 ${PROJECTDIR}/src/include/ab/$$file;\
298 @if [ "x${SOURCES.h.shared}" != "x" ] ; then \
299 for file in . ${SOURCES.h.shared} ; do \
300 if [ "x$$file" != "x." ];then \
301 echo "$$file => ${PROJECTDIR}/src/include/ab_private"; \
302 ${RM} ${PROJECTDIR}/src/include/ab_private/$$file;\
303 ${LN} ../../${LIBPART}/$$file \
304 ${PROJECTDIR}/src/include/ab_private/$$file;\
308 @ if [ "x${LIBS.shared}" != "x" ] ; then \
309 $(INST) -d ${PROJECTDIR}/src/lib;\
310 for file in . ${LIBS.shared} ; do \
311 if [ "x$$file" != "x." ];then \
312 echo "$$file => ${PROJECTDIR}/src/lib";\
313 ${RM} ${PROJECTDIR}/src/lib/$$file;\
314 ${LN} ../${LIBPART}/$$file \
315 ${PROJECTDIR}/src/lib/$$file;\
322 saber_src: $(SOURCES) $(TARGETS) $(OBJECTS) $(ULIBS)
323 #load $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $(SOURCES.c) $(SOURCES.c) $(TARGETS.c) $(ULIBS) $(LDLIBS)
325 saber_obj: $(OBJECTS) $(ULIBS)
326 #load $(CFLAGS) $(LDFLAGS) $(TARGET_ARCH) $(OBJECTS) $(ULIBS) $(LDLIBS)
329 $(LINT.c) $(SOURCES.c)
332 $(RM) $(TARGETS) $(OBJECTS) $(SOURCES.G:%.G=%_stubs.c) core *~ ,* *.BAK .make*.lock .make.depend*
335 $(RM) core $(LIBRARY) $(PROGRAM) .make*