1 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved.
6 ifeq ("$(origin V)", "command line")
13 ifeq ($(BUILD_VERBOSE
),1)
19 MAKEOPTS
= --no-print-directory Q
=$(Q
)
22 HAVE_BUILDDEFS
= $(shell test -f
$(TOPDIR
)/include/builddefs
&& echo yes || echo no
)
24 ifeq ($(HAVE_BUILDDEFS
), yes
)
25 include $(TOPDIR
)/include/builddefs
28 SRCDIR
= $(PKG_NAME
)-$(PKG_VERSION
)
29 SRCTAR
= $(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
30 SRCTARXZ
= $(PKG_NAME
)-$(PKG_VERSION
).
tar.xz
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
40 ifeq ($(HAVE_BUILDDEFS
), yes
)
42 LDIRT
+= $(SRCTAR
) $(SRCTARXZ
)
45 # header install rules to populate include/xfs correctly
46 HDR_SUBDIRS
= include libxfs
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 scrub
54 ifneq ("$(XGETTEXT)","")
58 # If we are on OS X, use glibtoolize from MacPorts, as OS X doesn't have
59 # libtoolize binary itself.
60 LIBTOOLIZE_TEST
=$(shell libtoolize
--version
>/dev
/null
2>&1 && echo found
)
61 LIBTOOLIZE_BIN
=libtoolize
62 ifneq ("$(LIBTOOLIZE_TEST)","found")
63 LIBTOOLIZE_BIN
=glibtoolize
66 # include is listed last so it is processed last in clean rules.
67 SUBDIRS
= $(LIBFROG_SUBDIR
) $(LIB_SUBDIRS
) $(TOOL_SUBDIRS
) include
69 default
: include/builddefs
include/platform_defs.h
70 ifeq ($(HAVE_BUILDDEFS
), no
)
71 $(Q
)$(MAKE
) $(MAKEOPTS
) -C .
$@
73 $(Q
)$(MAKE
) $(MAKEOPTS
) headers
74 $(Q
)$(MAKE
) $(MAKEOPTS
) $(SUBDIRS
)
77 # tool/lib dependencies
78 # note: include/xfs is set up by libxfs, too, so everything is dependent on it.
79 $(LIBFROG_SUBDIR
): include
80 $(LIB_SUBDIRS
) $(TOOL_SUBDIRS
): include libfrog
81 $(DLIB_SUBDIRS
) $(TOOL_SUBDIRS
): libxfs
87 repair
: libxlog libxcmd
91 scrub
: libhandle libxcmd
93 ifeq ($(HAVE_BUILDDEFS
), yes
)
96 clean: # if configure hasn't run, nothing to clean
100 # Recent versions of libtool require the -i option for copying auxiliary
101 # files (config.sub, config.guess, install-sh, ltmain.sh), while older
102 # versions will copy those files anyway, and don't understand -i.
103 LIBTOOLIZE_INSTALL
= `$(LIBTOOLIZE_BIN) -n -i >/dev/null 2>/dev/null && echo -i`
105 configure
: configure.ac
106 $(LIBTOOLIZE_BIN
) -c
$(LIBTOOLIZE_INSTALL
) -f
107 cp
include/install-sh .
111 include/builddefs
: configure
112 .
/configure
$$LOCAL_CONFIGURE_OPTIONS
114 include/platform_defs.h
: include/builddefs
115 ## Recover from the removal of $@
116 @if
test -f
$@
; then
:; else \
117 rm -f
include/builddefs
; \
118 $(MAKE
) $(MAKEOPTS
) $(AM_MAKEFLAGS
) include/builddefs
; \
121 install: $(addsuffix -install,$(SUBDIRS
))
122 $(INSTALL
) -m
755 -d
$(PKG_DOC_DIR
)
123 $(INSTALL
) -m
644 README
$(PKG_DOC_DIR
)
125 install-dev
: $(addsuffix -install-dev
,$(SUBDIRS
))
128 @echo
"Installing $@"
129 $(Q
)$(MAKE
) $(MAKEOPTS
) -C
$* install
132 @echo
"Installing $@"
133 $(Q
)$(MAKE
) $(MAKEOPTS
) -C
$* install-dev
139 $(Q
)rm -f
$(CONFIGURE
) .gitcensus
142 # All this gunk is to allow for a make dist on an unconfigured tree
144 dist: include/builddefs
include/platform_defs.h default
145 ifeq ($(HAVE_BUILDDEFS
), no
)
146 $(Q
)$(MAKE
) $(MAKEOPTS
) -C .
$@
148 $(Q
)$(MAKE
) $(MAKEOPTS
) $(SRCTAR
)
151 deb
: include/builddefs
include/platform_defs.h
152 ifeq ($(HAVE_BUILDDEFS
), no
)
153 $(Q
)$(MAKE
) $(MAKEOPTS
) -C .
$@
155 # need to build translations before the source tarball
156 $(Q
)$(MAKE
) $(MAKEOPTS
) -C po
157 $(Q
)$(MAKE
) $(MAKEOPTS
) $(SRCDIR
)
158 $(Q
)rm -f
$(PKG_NAME
)_
$(PKG_VERSION
).orig.
tar.gz
159 $(Q
)$(LN_S
) $(SRCTAR
) $(PKG_NAME
)_
$(PKG_VERSION
).orig.
tar.gz
160 $(Q
)cd
$(SRCDIR
) && dpkg-buildpackage
$$LOCAL_DPKG_OPTIONS # -sa -S
163 $(SRCDIR
) : $(_FORCE
) $(SRCTAR
)
165 $(Q
)$(TAR
) -zxvf
$(SRCTAR
)
167 $(SRCTAR
) : default
$(SRCTARINC
) .gitcensus
168 $(Q
)$(TAR
) --transform
"s,^,$(SRCDIR)/," -zcf
$(SRCDIR
).
tar.gz \
169 `cat .gitcensus` $(SRCTARINC
)
172 $(SRCTARXZ
) : default
$(SRCTARINC
) .gitcensus
173 $(Q
)$(TAR
) --transform
"s,^,$(SRCDIR)/," -Jcf
$(SRCDIR
).
tar.xz \
174 `cat .gitcensus` $(SRCTARINC
)
177 .gitcensus
: $(_FORCE
)
178 $(Q
)if
test -d .git
; then \
179 git ls-files
> .gitcensus
&& echo
"new .gitcensus"; \