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 # include is listed last so it is processed last in clean rules.
77 SUBDIRS
= $(LIBFROG_SUBDIR
) $(LIB_SUBDIRS
) $(TOOL_SUBDIRS
) include
79 default
: include/builddefs
include/platform_defs.h
80 ifeq ($(HAVE_BUILDDEFS
), no
)
81 $(Q
)$(MAKE
) $(MAKEOPTS
) -C .
$@
83 $(Q
)$(MAKE
) $(MAKEOPTS
) headers
84 $(Q
)$(MAKE
) $(MAKEOPTS
) $(SUBDIRS
)
87 # tool/lib dependencies
88 # note: include/xfs is set up by libxfs, too, so everything is dependent on it.
89 $(LIBFROG_SUBDIR
): include
90 $(LIB_SUBDIRS
) $(TOOL_SUBDIRS
): include libfrog
91 $(DLIB_SUBDIRS
) $(TOOL_SUBDIRS
): libxfs
97 repair
: libxlog libxcmd
101 scrub
: libhandle libxcmd
104 ifeq ($(HAVE_BUILDDEFS
), yes
)
105 include $(BUILDRULES
)
107 clean: # if configure hasn't run, nothing to clean
110 configure
: configure.ac
112 cp
include/install-sh .
116 include/builddefs
: configure
117 .
/configure
$$LOCAL_CONFIGURE_OPTIONS
119 include/platform_defs.h
: include/builddefs
120 ## Recover from the removal of $@
121 @if
test -f
$@
; then
:; else \
122 rm -f
include/builddefs
; \
123 $(MAKE
) $(MAKEOPTS
) $(AM_MAKEFLAGS
) include/builddefs
; \
126 install: $(addsuffix -install,$(SUBDIRS
))
127 $(INSTALL
) -m
755 -d
$(PKG_DOC_DIR
)
128 $(INSTALL
) -m
644 README
$(PKG_DOC_DIR
)
130 install-dev
: $(addsuffix -install-dev
,$(SUBDIRS
))
133 @echo
"Installing $@"
134 $(Q
)$(MAKE
) $(MAKEOPTS
) -C
$* install
137 @echo
"Installing $@"
138 $(Q
)$(MAKE
) $(MAKEOPTS
) -C
$* install-dev
144 $(Q
)rm -f
$(CONFIGURE
) .gitcensus
147 # All this gunk is to allow for a make dist on an unconfigured tree
149 dist: include/builddefs
include/platform_defs.h default
150 ifeq ($(HAVE_BUILDDEFS
), no
)
151 $(Q
)$(MAKE
) $(MAKEOPTS
) -C .
$@
153 $(Q
)$(MAKE
) $(MAKEOPTS
) $(SRCTAR
)
156 deb
: include/builddefs
include/platform_defs.h
157 ifeq ($(HAVE_BUILDDEFS
), no
)
158 $(Q
)$(MAKE
) $(MAKEOPTS
) -C .
$@
160 # need to build translations before the source tarball
161 $(Q
)$(MAKE
) $(MAKEOPTS
) -C po
162 $(Q
)$(MAKE
) $(MAKEOPTS
) $(SRCDIR
)
163 $(Q
)rm -f
$(PKG_NAME
)_
$(PKG_VERSION
).orig.
tar.gz
164 $(Q
)$(LN_S
) $(SRCTAR
) $(PKG_NAME
)_
$(PKG_VERSION
).orig.
tar.gz
165 $(Q
)cd
$(SRCDIR
) && dpkg-buildpackage
$$LOCAL_DPKG_OPTIONS # -sa -S
168 $(SRCDIR
) : $(_FORCE
) $(SRCTAR
)
170 $(Q
)$(TAR
) -zxvf
$(SRCTAR
)
172 $(SRCTAR
) : default
$(SRCTARINC
) .gitcensus
173 $(Q
)$(TAR
) --transform
"s,^,$(SRCDIR)/," -zcf
$(SRCDIR
).
tar.gz \
174 `cat .gitcensus` $(SRCTARINC
)
177 $(SRCTARXZ
) : default
$(SRCTARINC
) .gitcensus
178 $(Q
)$(TAR
) --transform
"s,^,$(SRCDIR)/," -Jcf
$(SRCDIR
).
tar.xz \
179 `cat .gitcensus` $(SRCTARINC
)
182 .gitcensus
: $(_FORCE
)
183 $(Q
)if
test -d .git
; then \
184 git ls-files
> .gitcensus
&& echo
"new .gitcensus"; \