]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - Makefile
xfs: abort dir/attr btree operation if btree is obviously weird
[thirdparty/xfsprogs-dev.git] / Makefile
1 #
2 # Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved.
3 #
4
5 ifeq ("$(origin V)", "command line")
6 BUILD_VERBOSE = $(V)
7 endif
8 ifndef BUILD_VERBOSE
9 BUILD_VERBOSE = 0
10 endif
11
12 ifeq ($(BUILD_VERBOSE),1)
13 Q =
14 else
15 Q = @
16 endif
17
18 MAKEOPTS = --no-print-directory Q=$(Q)
19
20 TOPDIR = .
21 HAVE_BUILDDEFS = $(shell test -f $(TOPDIR)/include/builddefs && echo yes || echo no)
22
23 ifeq ($(HAVE_BUILDDEFS), yes)
24 include $(TOPDIR)/include/builddefs
25 endif
26
27 SRCDIR = $(PKG_NAME)-$(PKG_VERSION)
28 SRCTAR = $(PKG_NAME)-$(PKG_VERSION).tar.gz
29 SRCTARXZ = $(PKG_NAME)-$(PKG_VERSION).tar.xz
30
31 CONFIGURE = aclocal.m4 configure config.guess config.sub install-sh ltmain.sh
32 LSRCFILES = configure.ac release.sh README VERSION $(CONFIGURE)
33 SRCTARINC = m4/libtool.m4 m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 \
34 m4/ltversion.m4 po/xfsprogs.pot .gitcensus $(CONFIGURE)
35 LDIRT = config.log .ltdep .dep config.status config.cache confdefs.h \
36 conftest* built .census install.* install-dev.* *.gz *.xz \
37 autom4te.cache/* libtool include/builddefs include/platform_defs.h
38
39 ifeq ($(HAVE_BUILDDEFS), yes)
40 LDIRDIRT = $(SRCDIR)
41 LDIRT += $(SRCTAR) $(SRCTARXZ)
42 endif
43
44 # header install rules to populate include/xfs correctly
45 HDR_SUBDIRS = include libxfs
46
47 DLIB_SUBDIRS = libxlog libxcmd libhandle
48 LIB_SUBDIRS = libxfs $(DLIB_SUBDIRS)
49 TOOL_SUBDIRS = copy db estimate fsck growfs io logprint mkfs quota \
50 mdrestore repair rtcp m4 man doc debian spaceman
51
52 ifneq ("$(PKG_PLATFORM)","darwin")
53 TOOL_SUBDIRS += fsr
54 endif
55
56 ifneq ("$(XGETTEXT)","")
57 TOOL_SUBDIRS += po
58 endif
59
60 # If we are on OS X, use glibtoolize from MacPorts, as OS X doesn't have
61 # libtoolize binary itself.
62 LIBTOOLIZE_TEST=$(shell libtoolize --version >/dev/null 2>&1 && echo found)
63 LIBTOOLIZE_BIN=libtoolize
64 ifneq ("$(LIBTOOLIZE_TEST)","found")
65 LIBTOOLIZE_BIN=glibtoolize
66 endif
67
68 # include is listed last so it is processed last in clean rules.
69 SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS) include
70
71 default: include/builddefs include/platform_defs.h
72 ifeq ($(HAVE_BUILDDEFS), no)
73 $(Q)$(MAKE) $(MAKEOPTS) -C . $@
74 else
75 $(Q)$(MAKE) $(MAKEOPTS) headers
76 $(Q)$(MAKE) $(MAKEOPTS) $(SUBDIRS)
77 endif
78
79 # tool/lib dependencies
80 # note: include/xfs is set up by libxfs, too, so everything is dependent on it.
81 $(LIB_SUBDIRS) $(TOOL_SUBDIRS): include
82 $(DLIB_SUBDIRS) $(TOOL_SUBDIRS): libxfs
83 db logprint: libxlog
84 fsr: libhandle
85 growfs: libxcmd
86 io: libxcmd libhandle
87 quota: libxcmd
88 repair: libxlog libxcmd
89 copy: libxlog
90 mkfs: libxcmd
91 spaceman: libxcmd
92
93 ifeq ($(HAVE_BUILDDEFS), yes)
94 include $(BUILDRULES)
95 else
96 clean: # if configure hasn't run, nothing to clean
97 endif
98
99
100 # Recent versions of libtool require the -i option for copying auxiliary
101 # files (config.sub, config.guess, install-sh, ltmain.sh), while older
102 # versions will copy those files anyway, and don't understand -i.
103 LIBTOOLIZE_INSTALL = `$(LIBTOOLIZE_BIN) -n -i >/dev/null 2>/dev/null && echo -i`
104
105 configure: configure.ac
106 $(LIBTOOLIZE_BIN) -c $(LIBTOOLIZE_INSTALL) -f
107 cp include/install-sh .
108 aclocal -I m4
109 autoconf
110
111 include/builddefs: configure
112 ./configure $$LOCAL_CONFIGURE_OPTIONS
113
114 include/platform_defs.h: include/builddefs
115 ## Recover from the removal of $@
116 @if test -f $@; then :; else \
117 rm -f include/builddefs; \
118 $(MAKE) $(MAKEOPTS) $(AM_MAKEFLAGS) include/builddefs; \
119 fi
120
121 install: $(addsuffix -install,$(SUBDIRS))
122 $(INSTALL) -m 755 -d $(PKG_DOC_DIR)
123 $(INSTALL) -m 644 README $(PKG_DOC_DIR)
124
125 install-dev: $(addsuffix -install-dev,$(SUBDIRS))
126
127 %-install:
128 @echo "Installing $@"
129 $(Q)$(MAKE) $(MAKEOPTS) -C $* install
130
131 %-install-dev:
132 @echo "Installing $@"
133 $(Q)$(MAKE) $(MAKEOPTS) -C $* install-dev
134
135 distclean: clean
136 $(Q)rm -f $(LDIRT)
137
138 realclean: distclean
139 $(Q)rm -f $(CONFIGURE) .gitcensus
140
141 #
142 # All this gunk is to allow for a make dist on an unconfigured tree
143 #
144 dist: include/builddefs include/platform_defs.h default
145 ifeq ($(HAVE_BUILDDEFS), no)
146 $(Q)$(MAKE) $(MAKEOPTS) -C . $@
147 else
148 $(Q)$(MAKE) $(MAKEOPTS) $(SRCTAR)
149 endif
150
151 deb: include/builddefs include/platform_defs.h
152 ifeq ($(HAVE_BUILDDEFS), no)
153 $(Q)$(MAKE) $(MAKEOPTS) -C . $@
154 else
155 # need to build translations before the source tarball
156 $(Q)$(MAKE) $(MAKEOPTS) -C po
157 $(Q)$(MAKE) $(MAKEOPTS) $(SRCDIR)
158 $(Q)cd $(SRCDIR) && dpkg-buildpackage
159 endif
160
161 $(SRCDIR) : $(_FORCE) $(SRCTAR)
162 rm -fr $@
163 $(Q)$(TAR) -zxvf $(SRCTAR)
164
165 $(SRCTAR) : default $(SRCTARINC) .gitcensus
166 $(Q)$(TAR) --transform "s,^,$(SRCDIR)/," -zcf $(SRCDIR).tar.gz \
167 `cat .gitcensus` $(SRCTARINC)
168 echo Wrote: $@
169
170 $(SRCTARXZ) : default $(SRCTARINC) .gitcensus
171 $(Q)$(TAR) --transform "s,^,$(SRCDIR)/," -Jcf $(SRCDIR).tar.xz \
172 `cat .gitcensus` $(SRCTARINC)
173 echo Wrote: $@
174
175 .gitcensus: $(_FORCE)
176 $(Q)if test -d .git; then \
177 git ls-files > .gitcensus && echo "new .gitcensus"; \
178 fi