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