]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - include/buildmacros
xfsprogs debian changes
[thirdparty/xfsprogs-dev.git] / include / buildmacros
CommitLineData
3ded4129 1#
6e3140c7 2# Copyright (c) 2002-2003 Silicon Graphics, Inc. All Rights Reserved.
3ded4129
NS
3#
4
3ded4129
NS
5BUILDRULES = $(TOPDIR)/include/buildrules
6
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).
11
4d32d744 12LDFLAGS += $(LOADERFLAGS) $(LLDFLAGS)
1163c17d 13LTLDFLAGS += $(LOADERFLAGS)
93d9f139 14LDLIBS = $(LLDLIBS) $(PLDLIBS) $(MALLOCLIB)
3ded4129
NS
15
16MAKEOPTS = --no-print-directory
17SRCFILES = Makefile $(HFILES) $(CFILES) $(LSRCFILES) $(LFILES) $(YFILES)
9440d84d
NS
18
19DEPDIRT = dep dep.bak
20MANDIRT = *.[1-9].gz
21PODIRT = *.tmpo *.mo
22CDIRT = $(OBJECTS) $(LTOBJECTS) $(LTCOMMAND) $(LTLIBRARY)
23DIRT = $(LDIRT) $(DEPDIRT) $(MANDIRT) $(PODIRT) $(CDIRT)
3ded4129
NS
24
25OBJECTS = $(ASFILES:.s=.o) \
dfc130f3
RC
26 $(CFILES:.c=.o) \
27 $(LFILES:.l=.o) \
28 $(YFILES:%.y=%.tab.o)
3ded4129 29
93d9f139 30INSTALL = $(TOPDIR)/install-sh -o $(PKG_USER) -g $(PKG_GROUP)
3ded4129
NS
31
32SHELL = /bin/sh
33IMAGES_DIR = $(TOPDIR)/all-images
34DIST_DIR = $(TOPDIR)/dist
35
4e6ff442 36CCF = $(CC) $(CFLAGS) $(CPPFLAGS)
3ded4129
NS
37MAKEF = $(MAKE) $(MAKEOPTS)
38CXXF = $(CXX) $(CXXFLAGS)
3ded4129
NS
39
40# For libtool.
41LIBNAME = $(basename $(LTLIBRARY))
42LTOBJECTS = $(OBJECTS:.o=.lo)
43LTVERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
44
45LTLINK = $(LIBTOOL) --mode=link $(CC)
46LTEXEC = $(LIBTOOL) --mode=execute
47LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
062998e3 48LTCOMPILE = $(LIBTOOL) --mode=compile $(CCF)
3ded4129
NS
49
50ifeq ($(ENABLE_SHARED),yes)
dfc130f3 51LTLDFLAGS += -rpath $(PKG_LIB_DIR)
3ded4129
NS
52LTLDFLAGS += -version-info $(LTVERSION)
53endif
54
55ifeq ($(ENABLE_SHARED),yes)
56INSTALL_LTLIB = \
57 cd $(TOPDIR)/$(LIBNAME)/.libs; \
6c6508ec
NS
58 ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
59 ../$(INSTALL) -m 644 -T so_dot_version $(LIBNAME).lai $(PKG_LIB_DIR); \
6c6508ec 60 ../$(INSTALL) -T so_dot_current $(LIBNAME).lai $(PKG_LIB_DIR)
3ded4129
NS
61endif
62
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
65# symlinks below).
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
68# /usr/lib.
69ifeq ($(ENABLE_SHARED),yes)
70INSTALL_LTLIB_DEV = \
71 cd $(TOPDIR)/$(LIBNAME)/.libs; \
6c6508ec
NS
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 ; \
3ded4129 75 ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
6c6508ec
NS
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
3ded4129
NS
80else
81INSTALL_LTLIB_DEV = $(INSTALL_LTLIB_STATIC)
82endif
83
84INSTALL_LTLIB_STATIC = \
85 cd $(TOPDIR)/$(LIBNAME)/.libs; \
6c6508ec
NS
86 ../$(INSTALL) -m 755 -d $(PKG_DEVLIB_DIR); \
87 ../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_DEVLIB_DIR)
3ded4129
NS
88
89INSTALL_MAN = \
4f3edd9e 90 @for d in $(MAN_PAGES); do \
3ded4129
NS
91 first=true; \
92 for m in `$(AWK) \
93 '/^\.S[h|H] NAME/ {ok=1; next} ok {print; exit}' $$d \
94 | $(SED) \
95 -e 's/^\.Nm //' -e 's/,/ /g' -e 's/\\-.*//' \
96 -e 's/\\\f[0-9]//g' -e 's/ / /g;q'`; \
97 do \
98 [ -z "$$m" -o "$$m" = "\\" ] && continue; \
99 t=$(MAN_DEST)/$$m.$(MAN_SECTION); \
100 if $$first; then \
101 if $(HAVE_ZIPPED_MANPAGES); then \
102 $(ZIP) -9 -c $$d > $$d.gz; _sfx=.gz; \
103 fi; \
104 u=$$m.$(MAN_SECTION)$$_sfx; \
105 echo $(INSTALL) -m 644 $${d}$$_sfx $${t}$$_sfx;\
106 $(INSTALL) -m 644 $${d}$$_sfx $${t}$$_sfx; \
107 else \
108 echo $(INSTALL) -S $$u $${t}$$_sfx; \
109 $(INSTALL) -S $$u $${t}$$_sfx; \
110 fi; \
111 first=false; \
112 done; \
113 done
114
9440d84d
NS
115ifeq ($(ENABLE_GETTEXT),yes)
116INSTALL_LINGUAS = \
f3e9ba96
SL
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; \
122 fi; \
9440d84d
NS
123 done
124endif
125
3ded4129
NS
126SUBDIRS_MAKERULE = \
127 @for d in $(SUBDIRS) ""; do \
128 if test -d "$$d" -a ! -z "$$d"; then \
129 $(ECHO) === $$d ===; \
130 $(MAKEF) -C $$d $@ || exit $$?; \
131 fi; \
132 done
133
134MAN_MAKERULE = \
135 @for f in *.[12345678] ""; do \
136 if test ! -z "$$f"; then \
137 $(ZIP) --best -c < $$f > $$f.gz; \
138 fi; \
139 done
140
141DIST_MAKERULE = \
142 $(MAKEF) -C build dist
143
144SOURCE_MAKERULE = \
145 @test -z "$$DIR" && DIR="."; \
146 for f in $(SRCFILES) ""; do \
1672be9b
NS
147 test -z "$$f" && break; \
148 test -L "$$f" || $(ECHO) $$DIR/$$f; \
3ded4129 149 done; \
1672be9b
NS
150 for d in `echo $(SUBDIRS)` ""; do \
151 test -z "$$d" && break; \
152 if test -d "$$d"; then \
3ded4129
NS
153 $(MAKEF) DIR=$$DIR/$$d -C $$d $@ || exit $$?; \
154 fi; \
155 done