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