2 # Copyright (c) 2002-2003 Silicon Graphics, Inc. All Rights Reserved.
5 BUILDRULES = $(TOPDIR)/include/buildrules
7 # LCFLAGS, LLDFLAGS, LLDLIBS, LSRCFILES and LDIRT may be specified in
8 # user Makefiles. Note: LSRCFILES is anything other than Makefile, $(CFILES)
9 # $(CXXFILES), or $(HFILES) and is used to construct the manifest list
10 # during the "dist" phase (packaging).
12 LDFLAGS += $(LOADERFLAGS) $(LLDFLAGS)
13 LTLDFLAGS += $(LOADERFLAGS)
14 LDLIBS = $(LLDLIBS) $(PLDLIBS) $(MALLOCLIB)
16 MAKEOPTS = --no-print-directory
17 SRCFILES = Makefile $(HFILES) $(CFILES) $(LSRCFILES) $(LFILES) $(YFILES)
22 CDIRT = $(OBJECTS) $(LTOBJECTS) $(LTCOMMAND) $(LTLIBRARY)
23 DIRT = $(LDIRT) $(DEPDIRT) $(MANDIRT) $(PODIRT) $(CDIRT)
25 OBJECTS = $(ASFILES:.s=.o) \
30 INSTALL = $(TOPDIR)/install-sh -o $(PKG_USER) -g $(PKG_GROUP)
33 IMAGES_DIR = $(TOPDIR)/all-images
34 DIST_DIR = $(TOPDIR)/dist
36 CCF = $(CC) $(CFLAGS) $(CPPFLAGS)
37 MAKEF = $(MAKE) $(MAKEOPTS)
38 CXXF = $(CXX) $(CXXFLAGS)
41 LIBNAME = $(basename $(LTLIBRARY))
42 LTOBJECTS = $(OBJECTS:.o=.lo)
43 LTVERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
45 LTLINK = $(LIBTOOL) --tag=CC --mode=link $(CC)
46 LTEXEC = $(LIBTOOL) --mode=execute
47 LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
48 LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CCF)
50 ifeq ($(ENABLE_SHARED),yes)
51 LTLDFLAGS += -rpath $(PKG_LIB_DIR)
52 LTLDFLAGS += -version-info $(LTVERSION)
55 ifeq ($(ENABLE_SHARED),yes)
57 cd $(TOPDIR)/$(LIBNAME)/.libs; \
58 ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
59 ../$(INSTALL) -m 644 -T so_dot_version $(LIBNAME).lai $(PKG_LIB_DIR); \
60 ../$(INSTALL) -T so_dot_current $(LIBNAME).lai $(PKG_LIB_DIR)
63 # Libtool thinks the static and shared libs should be in the same dir, so
64 # make the static lib appear in the place we chose as rpath (using the two
66 # Other things want the shared libs to appear in /usr/lib, else they'll
67 # link with the static libs there. So, another symlink to get the .so into
69 ifeq ($(ENABLE_SHARED),yes)
71 cd $(TOPDIR)/$(LIBNAME)/.libs; \
72 ../$(INSTALL) -m 755 -d $(PKG_DEVLIB_DIR); \
73 ../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_DEVLIB_DIR); \
74 ../$(INSTALL) -m 644 $(LIBNAME).lai $(PKG_DEVLIB_DIR)/$(LIBNAME).la ; \
75 ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
76 ../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_LIB_DIR); \
77 ../$(INSTALL) -S $(PKG_DEVLIB_DIR)/$(LIBNAME).a $(PKG_LIB_DIR)/$(LIBNAME).a; \
78 ../$(INSTALL) -S $(PKG_DEVLIB_DIR)/$(LIBNAME).la $(PKG_LIB_DIR)/$(LIBNAME).la; \
79 ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).so $(PKG_DEVLIB_DIR)/$(LIBNAME).so
81 INSTALL_LTLIB_DEV = $(INSTALL_LTLIB_STATIC)
84 INSTALL_LTLIB_STATIC = \
85 cd $(TOPDIR)/$(LIBNAME)/.libs; \
86 ../$(INSTALL) -m 755 -d $(PKG_DEVLIB_DIR); \
87 ../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_DEVLIB_DIR)
90 @for d in $(MAN_PAGES); do \
93 '/^\.S[h|H] NAME/ {ok=1; next} ok {print; exit}' $$d \
95 -e 's/^\.Nm //' -e 's/,/ /g' -e 's/\\-.*//' \
96 -e 's/\\\f[0-9]//g' -e 's/ / /g;q'`; \
98 [ -z "$$m" -o "$$m" = "\\" ] && continue; \
99 t=$(MAN_DEST)/$$m.$(MAN_SECTION); \
101 if $(HAVE_ZIPPED_MANPAGES); then \
102 $(ZIP) -9 -c $$d > $$d.gz; _sfx=.gz; \
104 u=$$m.$(MAN_SECTION)$$_sfx; \
105 echo $(INSTALL) -m 644 $${d}$$_sfx $${t}$$_sfx;\
106 $(INSTALL) -m 644 $${d}$$_sfx $${t}$$_sfx; \
108 echo $(INSTALL) -S $$u $${t}$$_sfx; \
109 $(INSTALL) -S $$u $${t}$$_sfx; \
115 ifeq ($(ENABLE_GETTEXT),yes)
117 @for l in $(LINGUAS) ""; do \
118 if test -f "$$l.mo" ; then \
119 ldir=$(PKG_LOCALE_DIR)/$$l/LC_MESSAGES; \
120 $(INSTALL) -m 755 -d $$ldir; \
121 $(INSTALL) -m 644 $$l.mo $$ldir/$(PKG_NAME).mo; \
127 @for f in *.[12345678] ""; do \
128 if test ! -z "$$f"; then \
129 $(ZIP) --best -c < $$f > $$f.gz; \
134 $(MAKEF) -C build dist
137 @test -z "$$DIR" && DIR="."; \
138 for f in $(SRCFILES) ""; do \
139 test -z "$$f" && break; \
140 test -L "$$f" || $(ECHO) $$DIR/$$f; \
142 for d in `echo $(SUBDIRS)` ""; do \
143 test -z "$$d" && break; \
144 if test -d "$$d"; then \
145 $(MAKEF) DIR=$$DIR/$$d -C $$d $@ || exit $$?; \