]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - include/buildmacros
update configure defaults
[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)
a74fe294 18SRCFILES += $(QAHFILES)
9440d84d
NS
19
20DEPDIRT = dep dep.bak
21MANDIRT = *.[1-9].gz
22PODIRT = *.tmpo *.mo
23CDIRT = $(OBJECTS) $(LTOBJECTS) $(LTCOMMAND) $(LTLIBRARY)
24DIRT = $(LDIRT) $(DEPDIRT) $(MANDIRT) $(PODIRT) $(CDIRT)
42e5b5df
NS
25LIBDIRT = .libs
26DIRDIRT = $(LDIRDIRT) $(LIBDIRT)
3ded4129
NS
27
28OBJECTS = $(ASFILES:.s=.o) \
dfc130f3
RC
29 $(CFILES:.c=.o) \
30 $(LFILES:.l=.o) \
31 $(YFILES:%.y=%.tab.o)
3ded4129 32
93d9f139 33INSTALL = $(TOPDIR)/install-sh -o $(PKG_USER) -g $(PKG_GROUP)
3ded4129
NS
34
35SHELL = /bin/sh
36IMAGES_DIR = $(TOPDIR)/all-images
37DIST_DIR = $(TOPDIR)/dist
38
4e6ff442 39CCF = $(CC) $(CFLAGS) $(CPPFLAGS)
3ded4129
NS
40MAKEF = $(MAKE) $(MAKEOPTS)
41CXXF = $(CXX) $(CXXFLAGS)
3ded4129
NS
42
43# For libtool.
44LIBNAME = $(basename $(LTLIBRARY))
45LTOBJECTS = $(OBJECTS:.o=.lo)
46LTVERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
47
5e656dbb 48LTLINK = $(LIBTOOL) --tag=CC --mode=link $(CC)
3ded4129
NS
49LTEXEC = $(LIBTOOL) --mode=execute
50LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
5e656dbb 51LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CCF)
3ded4129
NS
52
53ifeq ($(ENABLE_SHARED),yes)
595e27db 54LTLDFLAGS += -rpath $(PKG_ROOT_LIB_DIR)
3ded4129
NS
55LTLDFLAGS += -version-info $(LTVERSION)
56endif
57
58ifeq ($(ENABLE_SHARED),yes)
59INSTALL_LTLIB = \
60 cd $(TOPDIR)/$(LIBNAME)/.libs; \
595e27db
CH
61 ../$(INSTALL) -m 755 -d $(PKG_ROOT_LIB_DIR); \
62 ../$(INSTALL) -m 644 -T so_dot_version $(LIBNAME).lai $(PKG_ROOT_LIB_DIR); \
63 ../$(INSTALL) -T so_dot_current $(LIBNAME).lai $(PKG_ROOT_LIB_DIR)
3ded4129
NS
64endif
65
66# Libtool thinks the static and shared libs should be in the same dir, so
67# make the static lib appear in the place we chose as rpath (using the two
68# symlinks below).
69# Other things want the shared libs to appear in /usr/lib, else they'll
70# link with the static libs there. So, another symlink to get the .so into
71# /usr/lib.
72ifeq ($(ENABLE_SHARED),yes)
73INSTALL_LTLIB_DEV = \
74 cd $(TOPDIR)/$(LIBNAME)/.libs; \
75 ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
595e27db
CH
76 ../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_LIB_DIR); \
77 ../$(INSTALL) -m 644 $(LIBNAME).lai $(PKG_LIB_DIR)/$(LIBNAME).la ; \
78 ../$(INSTALL) -m 755 -d $(PKG_ROOT_LIB_DIR); \
79 ../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_ROOT_LIB_DIR); \
80 if test "x$(PKG_LIB_DIR)" != "x$(PKG_ROOT_LIB_DIR)" ; then \
81 ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).a $(PKG_ROOT_LIB_DIR)/$(LIBNAME).a; \
82 ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).la $(PKG_ROOT_LIB_DIR)/$(LIBNAME).la; \
83 ../$(INSTALL) -S $(PKG_ROOT_LIB_DIR)/$(LIBNAME).so $(PKG_LIB_DIR)/$(LIBNAME).so; \
54dd1539 84 fi
3ded4129
NS
85else
86INSTALL_LTLIB_DEV = $(INSTALL_LTLIB_STATIC)
87endif
88
89INSTALL_LTLIB_STATIC = \
90 cd $(TOPDIR)/$(LIBNAME)/.libs; \
595e27db
CH
91 ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
92 ../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_LIB_DIR)
3ded4129
NS
93
94INSTALL_MAN = \
4f3edd9e 95 @for d in $(MAN_PAGES); do \
3ded4129
NS
96 first=true; \
97 for m in `$(AWK) \
98 '/^\.S[h|H] NAME/ {ok=1; next} ok {print; exit}' $$d \
99 | $(SED) \
100 -e 's/^\.Nm //' -e 's/,/ /g' -e 's/\\-.*//' \
101 -e 's/\\\f[0-9]//g' -e 's/ / /g;q'`; \
102 do \
103 [ -z "$$m" -o "$$m" = "\\" ] && continue; \
104 t=$(MAN_DEST)/$$m.$(MAN_SECTION); \
105 if $$first; then \
106 if $(HAVE_ZIPPED_MANPAGES); then \
107 $(ZIP) -9 -c $$d > $$d.gz; _sfx=.gz; \
108 fi; \
109 u=$$m.$(MAN_SECTION)$$_sfx; \
110 echo $(INSTALL) -m 644 $${d}$$_sfx $${t}$$_sfx;\
111 $(INSTALL) -m 644 $${d}$$_sfx $${t}$$_sfx; \
112 else \
113 echo $(INSTALL) -S $$u $${t}$$_sfx; \
114 $(INSTALL) -S $$u $${t}$$_sfx; \
115 fi; \
116 first=false; \
117 done; \
118 done
119
9440d84d
NS
120ifeq ($(ENABLE_GETTEXT),yes)
121INSTALL_LINGUAS = \
f3e9ba96
SL
122 @for l in $(LINGUAS) ""; do \
123 if test -f "$$l.mo" ; then \
124 ldir=$(PKG_LOCALE_DIR)/$$l/LC_MESSAGES; \
125 $(INSTALL) -m 755 -d $$ldir; \
126 $(INSTALL) -m 644 $$l.mo $$ldir/$(PKG_NAME).mo; \
127 fi; \
9440d84d
NS
128 done
129endif
130
3ded4129
NS
131MAN_MAKERULE = \
132 @for f in *.[12345678] ""; do \
133 if test ! -z "$$f"; then \
134 $(ZIP) --best -c < $$f > $$f.gz; \
135 fi; \
136 done
137
138DIST_MAKERULE = \
139 $(MAKEF) -C build dist
140
141SOURCE_MAKERULE = \
142 @test -z "$$DIR" && DIR="."; \
42e5b5df 143 for f in $(SRCFILES) $(POTHEAD) ""; do \
1672be9b
NS
144 test -z "$$f" && break; \
145 test -L "$$f" || $(ECHO) $$DIR/$$f; \
3ded4129 146 done; \
1672be9b
NS
147 for d in `echo $(SUBDIRS)` ""; do \
148 test -z "$$d" && break; \
149 if test -d "$$d"; then \
3ded4129
NS
150 $(MAKEF) DIR=$$DIR/$$d -C $$d $@ || exit $$?; \
151 fi; \
152 done