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