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