123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337 |
- #
- # $XConsortium: Makefile.include /main/3 1995/11/06 17:09:05 rswiston $
- #
- # %W% %G% cde_app_builder
- #
- # RESTRICTED CONFIDENTIAL INFORMATION:
- #
- # The information in this document is subject to special
- # restrictions in a confidential disclosure agreement between
- # HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
- # document outside HP, IBM, Sun, USL, SCO, or Univel without
- # Sun's specific written approval. This document and all copies
- # and derivative works thereof must be returned or destroyed at
- # Sun's request.
- #
- # Copyright 1993 Sun Microsystems, Inc. All rights reserved.
- #
- #
- #
- # This file is meant to be included in each Makefile associated with
- # a particular project. The following parameters should be defined
- # by the including Makefile, as appropriate:
- #
- # PROJECTDIR Top-level project directory
- # LIBRARY Target library
- # PROGRAM Target program
- # LOCALE Locale to install into
- # SOURCES.G GUIDE Intermediate Languages
- # SOURCES.c C code
- # SOURCES.uil UIL files
- # SOURCES.xres X Resource files
- # SOURCES.h Include files
- # SOURCES.l Lex files
- # SOURCES.sh Shell scripts
- # SOURCES.y Yacc files
- # SOURCES.pkg SVR4 package files
- # SOURCES.po Localization message files (only for testing)
- # IMAGES Bitmap/icon files
- #
- # Note that the localization items (e.g., .mo files are not shipped as
- # part of guide. They are installed into a test directory (for testing,
- # even).
- #
- #
- # Switch build environment based on OS. Automatically switches
- # for 4.1.x or 5.X builds. Override with:
- #
- # Solaris 2.0 bundles OpenWindows with the environment and
- # locates it in /usr/openwin. When compiling under 5.0, either
- # don't set OPENWINHOME, or make sure that it is set to
- # /usr/openwin so that LD_RUN_PATH (-R) is correct. If OpenWindows
- # is located somewhere else, then make a link from /usr/openwin to
- # that location before compiling.
- WIN_HOME:sh = \
- ( \
- case ${OPENWINHOME} \
- in ?*) echo ${OPENWINHOME};; \
- *) echo "/usr/openwin";; \
- esac; \
- )
- MOTIFHOME:sh = \
- ( \
- case ${MOTIFHOME} \
- in ?*) echo ${MOTIFHOME};; \
- *) echo "/opt/SUNWmotif";; \
- esac; \
- )
- # Derived parameters.
- SOURCES += \
- $(SOURCES.h) \
- $(SOURCES.G) \
- $(SOURCES.l) \
- $(SOURCES.y) \
- $(SOURCES.uil) \
- $(SOURCES.xres) \
- $(SOURCES.c) \
- $(SOURCES.ps) \
- $(SOURCES.cps) \
- $(SOURCES.sh) \
- $(SOURCES.misc) \
- $(SOURCES.other) \
- $(SOURCES.pkg) \
- $(SOURCES.po)
- TARGETS.c = \
- $(SOURCES.G:%.G=%_ui.c) \
- $(STUBS.G:%.G=%_stubs.c) \
- $(SOURCES.l:%.l=%.c) \
- $(SOURCES.y:%.y=%.c)
- TARGETS.h = \
- $(SOURCES.G:%.G=%_ui.h) \
- $(SOURCES.y:%.y=%.h) \
- $(SOURCES.cps:%.cps=%.h)
- TARGETS.uid = \
- $(SOURCES.uil:%.uil=uid/%.uid)
- TARGETS.other = \
- $(SOURCES.G:%.G=%.info)
- TARGETS.sh = \
- $(SOURCES.sh:%.sh=%)
- TARGETS.mo = \
- $(SOURCES.po:%.po=%.mo)
- TARGETS = \
- $(TARGETS.other) \
- $(TARGETS.sh) \
- $(TARGETS.h) \
- $(TARGETS.c) \
- $(TARGETS.uid) \
- $(TARGETS.mo)
- OBJECTS = \
- $(SOURCES.c:%.c=%.o) \
- $(TARGETS.c:%.c=%.o)
- #
- # The project dir (i.e. PROJECTDIR) relative to the build include and lib
- # directories (i.e. $(PROJECTDIR)/include/ab, $(PROJECTDIR)/lib).
- #
- BUILDINCPROJ = ../..
- DESTDIR = $(PROJECTDIR)/installed
- INSTALL += $(PROGRAM)$(TARGETS.sh) # no space!!!
- INSTDIR = $(DESTDIR)/bin
- INSTALL.a += $(LIBRARY)
- INSTDIR.a += $(DESTDIR)/lib
- INSTALL.h +=
- INSTDIR.h = $(DESTDIR)/include
- INSTALL.ps += $(SOURCES.ps)
- INSTDIR.ps = $(DESTDIR)/etc
- INSTALL.other += $(TARGETS.other)
- INSTDIR.other = $(DESTDIR)/lib/locale/C/help
- INSTALL.misc += $(SOURCES.misc)
- INSTDIR.misc = $(DESTDIR)/lib
- INSTALL.mo += $(TARGETS.mo)
- INSTDIR.mo = $(DESTDIR)/test-l10n/lib/locale/$(LOCALE)/LC_MESSAGES
- INSTALL.svr4 += $(SOURCES.pkg)
- INSTDIR.svr4 = $(DESTDIR)/svr4_installed
- # OS dependent stuff
- INST = /usr/ucb/install
- CC = cc
- LN = ln -s
- PKGINST = /usr/ucb/install
- # Compiler flags.
- CFLAGS += -Xc -g
- CPPFLAGS += -I$(PROJECTDIR)/src/include -I$(WIN_HOME)/include
- LDFLAGS += -L$(WIN_HOME)/lib -R$(WIN_HOME)/lib -L$(PROJECTDIR)/src/lib
- LINTFLAGS += -b
- G2CFLAGS += -s -n
- ULIBS += $(PROJECTDIR)/src/lib/libAButil.a
- .PRECIOUS: $(ULIBS) $(LIBRARY)
- # Standard targets.
- .KEEP_STATE:
- all: $(SOURCES) $(IMAGES) $(TARGETS) .WAIT $(LIBRARY) $(PROGRAM)
- objects: $(SOURCES.c) $(TARGETS.c) $(TARGETS.h) $(TARGETS.mo) .WAIT $(OBJECTS)
- sources: $(SOURCES) $(IMAGES)
- targets: $(SOURCES) $(IMAGES) $(TARGETS)
- $(PROGRAM): $(SOURCES) $(TARGETS) $(OBJECTS) $(ULIBS)
- $(PURIFY) $(LINK.c) -o $(PROGRAM) $(OBJECTS) $(ULIBS) $(LDLIBS)
- %_ui.c: %.G
- $(G2C) $(G2CFLAGS) $*
- %_ui.h: %_ui.c
- @touch $@
- %_stubs.c: %_ui.c
- @touch $@
- %.info: %_ui.c
- @touch $@
- %.mo: %.po
- msgfmt $<
- uid/%.uid: %.uil
- $(MOTIFHOME)/bin/uil $< -o $@
- # This rewrites the entire library any time an object changes (not *too* bad).
- # Should be able to only replace new objects, but this works
- $(LIBRARY): $(LIBRARY)($(OBJECTS))
- $(RM) $@
- ar rv $@ $(OBJECTS)
- $(LIBRARY)(%.o): %.o
- @true
- install: all
- @-sccs check
- @if [ "$(INSTALL)" ] ; then \
- set -x ; \
- $(INST) -d $(INSTDIR) ; \
- $(INST) -m 555 $(INSTALL) $(INSTDIR) ; \
- if [ "$(ALT_PROGRAM_NAME)" ] ; then \
- if [ -f $(INSTDIR)/$(PROGRAM) ] ; then \
- (cd $(INSTDIR) ; \
- $(RM) $(ALT_PROGRAM_NAME) ; \
- ln -s $(PROGRAM) $(ALT_PROGRAM_NAME)) ; \
- fi ; \
- fi ; \
- fi
- @if [ "$(INSTALL.a)" ] ; then \
- set -x ; \
- $(INST) -d $(INSTDIR.a) ; \
- $(INST) -m 664 $(INSTALL.a) $(INSTDIR.a) ; \
- (cd $(INSTDIR.a) ; chmod 444 $(INSTALL.a)) ; \
- fi
- @if [ "$(INSTALL.h)" ] ; then \
- set -x ; \
- $(INST) -d $(INSTDIR.h) ; \
- $(INST) -m 444 $(INSTALL.h) $(INSTDIR.h) ; \
- fi
- @if [ "$(INSTALL.share)" ] ; then \
- set -x ; \
- $(INST) -d $(DESTDIR)/share/$(INSTALL.share) ; \
- if [ ! -d $(DESTDIR)/$(INSTALL.share) ] ; then \
- (cd $(DESTDIR) ; ln -s share/$(INSTALL.share)) ; \
- fi ; \
- fi
- @if [ "$(INSTALL.libshare)" ] ; then \
- set -x ; \
- $(INST) -d $(DESTDIR)/share/lib/$(INSTALL.libshare) ; \
- if [ ! -d $(DESTDIR)/lib/$(INSTALL.libshare) ] ; then \
- (cd $(DESTDIR)/lib ; ln -s ../share/lib/$(INSTALL.libshare)) ; \
- fi ; \
- fi
- @if [ "$(INSTALL.other)" ] ; then \
- set -x ; \
- $(INST) -d $(INSTDIR.other) ; \
- $(INST) -m 444 $(INSTALL.other) $(INSTDIR.other) ; \
- fi
- @if [ "$(INSTALL.misc)" ] ; then \
- set -x ; \
- $(INST) -d $(INSTDIR.misc) ; \
- $(INST) -m 444 $(INSTALL.misc) $(INSTDIR.misc) ; \
- fi
- @if [ "$(INSTALL.ps)" ] ; then \
- set -x ; \
- $(INST) -d $(INSTDIR.ps) ; \
- $(INST) -m 444 $(INSTALL.ps) $(INSTDIR.ps) ; \
- fi
- @if [ "$(INSTALL.postinstall)" ] ; then \
- set -x ; \
- if [ ! -d $(DESTDIR)/lib/help ] ; then \
- (cd $(DESTDIR)/lib ; \
- ln -s ./$(INSTALL.postinstall)) ; \
- fi ; \
- fi
- @if [ "$(INSTALL.mo)" ] ; then \
- set -x ; \
- $(INST) -d $(INSTDIR.mo) ; \
- $(INST) -m 444 $(INSTALL.mo) $(INSTDIR.mo) ; \
- fi
- @if [ "$(INSTALL.svr4)" ] ; then \
- $(PKGINST) -d $(INSTDIR) ; \
- $(PKGINST) -m 644 $(SOURCES.pkg) $(INSTDIR) ; \
- $(PKGINST) -m 555 $(SOURCES.sh) $(INSTDIR) ; \
- (cd $(INSTDIR) ; make_package) ; \
- fi
- includes: ${SOURCES.h.shipped} ${SOURCES.h.shared} ${SOURCES.h.unshared}
- @if [ "x${SOURCES.h.shipped}" != "x" ] ; then \
- for file in . ${SOURCES.h.shipped} ; do \
- if [ "x$$file" != "x." ];then \
- echo "$$file => ${PROJECTDIR}/src/include/ab"; \
- ${RM} ${PROJECTDIR}/src/include/ab/$$file; \
- ${LN} ../../${LIBPART}/$$file \
- ${PROJECTDIR}/src/include/ab/$$file;\
- fi; \
- done;\
- fi
- @if [ "x${SOURCES.h.shared}" != "x" ] ; then \
- for file in . ${SOURCES.h.shared} ; do \
- if [ "x$$file" != "x." ];then \
- echo "$$file => ${PROJECTDIR}/src/include/ab_private"; \
- ${RM} ${PROJECTDIR}/src/include/ab_private/$$file;\
- ${LN} ../../${LIBPART}/$$file \
- ${PROJECTDIR}/src/include/ab_private/$$file;\
- fi; \
- done;\
- fi
- @ if [ "x${LIBS.shared}" != "x" ] ; then \
- $(INST) -d ${PROJECTDIR}/src/lib;\
- for file in . ${LIBS.shared} ; do \
- if [ "x$$file" != "x." ];then \
- echo "$$file => ${PROJECTDIR}/src/lib";\
- ${RM} ${PROJECTDIR}/src/lib/$$file;\
- ${LN} ../${LIBPART}/$$file \
- ${PROJECTDIR}/src/lib/$$file;\
- fi;\
- done; \
- fi
- saber_src: $(SOURCES) $(TARGETS) $(OBJECTS) $(ULIBS)
- #load $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $(SOURCES.c) $(SOURCES.c) $(TARGETS.c) $(ULIBS) $(LDLIBS)
- saber_obj: $(OBJECTS) $(ULIBS)
- #load $(CFLAGS) $(LDFLAGS) $(TARGET_ARCH) $(OBJECTS) $(ULIBS) $(LDLIBS)
- lint:
- $(LINT.c) $(SOURCES.c)
- clean:
- $(RM) $(TARGETS) $(OBJECTS) $(SOURCES.G:%.G=%_stubs.c) core *~ ,* *.BAK .make*.lock .make.depend*
- scour: clean
- $(RM) core $(LIBRARY) $(PROGRAM) .make*
- FORCE:
|