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)
20 CHECK_OPTS
=-Wsparse-all
-Wbitwise
-Wno-transparent-union
-Wno-return-void
-Wno-undef \
21 -Wno-non-pointer-null
-D__CHECK_ENDIAN__
-D__linux__
23 ifeq ("$(origin C)", "command line")
24 CHECK_CMD
=$(CHECK
) $(CHECK_OPTS
)
31 export CHECK_CMD CHECKSRC
33 MAKEOPTS
= --no-print-directory Q
=$(Q
)
36 HAVE_BUILDDEFS
= $(shell test -f
$(TOPDIR
)/include/builddefs
&& echo yes || echo no
)
38 ifeq ($(HAVE_BUILDDEFS
), yes
)
39 include $(TOPDIR
)/include/builddefs
42 SRCDIR
= $(PKG_NAME
)-$(PKG_VERSION
)
43 SRCTAR
= $(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
44 SRCTARXZ
= $(PKG_NAME
)-$(PKG_VERSION
).
tar.xz
46 CONFIGURE
= aclocal.m4 configure config.guess config.sub install-sh ltmain.sh
47 LSRCFILES
= configure.ac release.sh README VERSION
$(CONFIGURE
)
48 SRCTARINC
= m4
/libtool.m4 m4
/lt~obsolete.m4 m4
/ltoptions.m4 m4
/ltsugar.m4 \
49 m4
/ltversion.m4 po
/xfsprogs.pot .gitcensus
$(CONFIGURE
)
50 LDIRT
= config.log .ltdep .dep config.status config.cache confdefs.h \
51 conftest
* built .census
install.
* install-dev.
* *.gz
*.xz \
52 autom4te.cache
/* libtool
include/builddefs
include/platform_defs.h
54 ifeq ($(HAVE_BUILDDEFS
), yes
)
56 LDIRT
+= $(SRCTAR
) $(SRCTARXZ
)
59 # header install rules to populate include/xfs correctly
60 HDR_SUBDIRS
= include libxfs
62 LIBFROG_SUBDIR
= libfrog
63 DLIB_SUBDIRS
= libxlog libxcmd libhandle
64 LIB_SUBDIRS
= libxfs
$(DLIB_SUBDIRS
)
65 TOOL_SUBDIRS
= copy db estimate fsck fsr growfs io logprint mkfs quota \
66 mdrestore repair rtcp m4 man doc debian spaceman
68 ifeq ("$(ENABLE_SCRUB)","yes")
72 ifneq ("$(XGETTEXT)","")
76 # If we are on OS X, use glibtoolize from MacPorts, as OS X doesn't have
77 # libtoolize binary itself.
78 LIBTOOLIZE_TEST
=$(shell libtoolize
--version
>/dev
/null
2>&1 && echo found
)
79 LIBTOOLIZE_BIN
=libtoolize
80 ifneq ("$(LIBTOOLIZE_TEST)","found")
81 LIBTOOLIZE_BIN
=glibtoolize
84 # include is listed last so it is processed last in clean rules.
85 SUBDIRS
= $(LIBFROG_SUBDIR
) $(LIB_SUBDIRS
) $(TOOL_SUBDIRS
) include
87 default
: include/builddefs
include/platform_defs.h
88 ifeq ($(HAVE_BUILDDEFS
), no
)
89 $(Q
)$(MAKE
) $(MAKEOPTS
) -C .
$@
91 $(Q
)$(MAKE
) $(MAKEOPTS
) headers
92 $(Q
)$(MAKE
) $(MAKEOPTS
) $(SUBDIRS
)
95 # tool/lib dependencies
96 # note: include/xfs is set up by libxfs, too, so everything is dependent on it.
97 $(LIBFROG_SUBDIR
): include
98 $(LIB_SUBDIRS
) $(TOOL_SUBDIRS
): include libfrog
99 $(DLIB_SUBDIRS
) $(TOOL_SUBDIRS
): libxfs
103 io
: libxcmd libhandle
105 repair
: libxlog libxcmd
109 scrub
: libhandle libxcmd
112 ifeq ($(HAVE_BUILDDEFS
), yes
)
113 include $(BUILDRULES
)
115 clean: # if configure hasn't run, nothing to clean
119 # Recent versions of libtool require the -i option for copying auxiliary
120 # files (config.sub, config.guess, install-sh, ltmain.sh), while older
121 # versions will copy those files anyway, and don't understand -i.
122 LIBTOOLIZE_INSTALL
= `$(LIBTOOLIZE_BIN) -n -i >/dev/null 2>/dev/null && echo -i`
124 configure
: configure.ac
125 $(LIBTOOLIZE_BIN
) -c
$(LIBTOOLIZE_INSTALL
) -f
126 cp
include/install-sh .
130 include/builddefs
: configure
131 .
/configure
$$LOCAL_CONFIGURE_OPTIONS
133 include/platform_defs.h
: include/builddefs
134 ## Recover from the removal of $@
135 @if
test -f
$@
; then
:; else \
136 rm -f
include/builddefs
; \
137 $(MAKE
) $(MAKEOPTS
) $(AM_MAKEFLAGS
) include/builddefs
; \
140 install: $(addsuffix -install,$(SUBDIRS
))
141 $(INSTALL
) -m
755 -d
$(PKG_DOC_DIR
)
142 $(INSTALL
) -m
644 README
$(PKG_DOC_DIR
)
144 install-dev
: $(addsuffix -install-dev
,$(SUBDIRS
))
147 @echo
"Installing $@"
148 $(Q
)$(MAKE
) $(MAKEOPTS
) -C
$* install
151 @echo
"Installing $@"
152 $(Q
)$(MAKE
) $(MAKEOPTS
) -C
$* install-dev
158 $(Q
)rm -f
$(CONFIGURE
) .gitcensus
161 # All this gunk is to allow for a make dist on an unconfigured tree
163 dist: include/builddefs
include/platform_defs.h default
164 ifeq ($(HAVE_BUILDDEFS
), no
)
165 $(Q
)$(MAKE
) $(MAKEOPTS
) -C .
$@
167 $(Q
)$(MAKE
) $(MAKEOPTS
) $(SRCTAR
)
170 deb
: include/builddefs
include/platform_defs.h
171 ifeq ($(HAVE_BUILDDEFS
), no
)
172 $(Q
)$(MAKE
) $(MAKEOPTS
) -C .
$@
174 # need to build translations before the source tarball
175 $(Q
)$(MAKE
) $(MAKEOPTS
) -C po
176 $(Q
)$(MAKE
) $(MAKEOPTS
) $(SRCDIR
)
177 $(Q
)rm -f
$(PKG_NAME
)_
$(PKG_VERSION
).orig.
tar.gz
178 $(Q
)$(LN_S
) $(SRCTAR
) $(PKG_NAME
)_
$(PKG_VERSION
).orig.
tar.gz
179 $(Q
)cd
$(SRCDIR
) && dpkg-buildpackage
$$LOCAL_DPKG_OPTIONS # -sa -S
182 $(SRCDIR
) : $(_FORCE
) $(SRCTAR
)
184 $(Q
)$(TAR
) -zxvf
$(SRCTAR
)
186 $(SRCTAR
) : default
$(SRCTARINC
) .gitcensus
187 $(Q
)$(TAR
) --transform
"s,^,$(SRCDIR)/," -zcf
$(SRCDIR
).
tar.gz \
188 `cat .gitcensus` $(SRCTARINC
)
191 $(SRCTARXZ
) : default
$(SRCTARINC
) .gitcensus
192 $(Q
)$(TAR
) --transform
"s,^,$(SRCDIR)/," -Jcf
$(SRCDIR
).
tar.xz \
193 `cat .gitcensus` $(SRCTARINC
)
196 .gitcensus
: $(_FORCE
)
197 $(Q
)if
test -d .git
; then \
198 git ls-files
> .gitcensus
&& echo
"new .gitcensus"; \