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