2 # Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved.
5 ifeq ("$(origin V)", "command line")
12 ifeq ($(BUILD_VERBOSE
),1)
18 MAKEOPTS
= --no-print-directory Q
=$(Q
)
21 HAVE_BUILDDEFS
= $(shell test -f
$(TOPDIR
)/include/builddefs
&& echo yes || echo no
)
23 ifeq ($(HAVE_BUILDDEFS
), yes
)
24 include $(TOPDIR
)/include/builddefs
27 SRCDIR
= $(PKG_NAME
)-$(PKG_VERSION
)
28 SRCTAR
= $(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
30 CONFIGURE
= aclocal.m4 configure config.guess config.sub install-sh ltmain.sh
31 LSRCFILES
= configure.ac release.sh README VERSION
$(CONFIGURE
)
32 SRCTARINC
= m4
/libtool.m4 m4
/lt~obsolete.m4 m4
/ltoptions.m4 m4
/ltsugar.m4 \
33 m4
/ltversion.m4 po
/xfsprogs.pot .gitcensus
$(CONFIGURE
)
34 LDIRT
= config.log .ltdep .dep config.status config.cache confdefs.h \
35 conftest
* built .census
install.
* install-dev.
* *.gz \
36 autom4te.cache
/* libtool
include/builddefs
include/platform_defs.h
38 ifeq ($(HAVE_BUILDDEFS
), yes
)
43 # header install rules to populate include/xfs correctly
44 HDR_SUBDIRS
= include libxfs
46 DLIB_SUBDIRS
= libxlog libxcmd libhandle libdisk
47 LIB_SUBDIRS
= libxfs
$(DLIB_SUBDIRS
)
48 TOOL_SUBDIRS
= copy db estimate fsck fsr growfs io logprint mkfs quota \
49 mdrestore repair rtcp m4 man doc po debian
51 # include is listed last so it is processed last in clean rules.
52 SUBDIRS
= $(LIB_SUBDIRS
) $(TOOL_SUBDIRS
) include
54 default
: include/builddefs
include/platform_defs.h
55 ifeq ($(HAVE_BUILDDEFS
), no
)
56 $(Q
)$(MAKE
) $(MAKEOPTS
) -C .
$@
58 $(Q
)$(MAKE
) $(MAKEOPTS
) headers
59 $(Q
)$(MAKE
) $(MAKEOPTS
) $(SUBDIRS
)
62 # tool/lib dependencies
63 # note: include/xfs is set up by libxfs, too, so everything is dependent on it.
64 $(LIB_SUBDIRS
) $(TOOL_SUBDIRS
): include
65 $(DLIB_SUBDIRS
) $(TOOL_SUBDIRS
): libxfs
74 ifneq ($(ENABLE_BLKID
), yes
)
78 ifeq ($(HAVE_BUILDDEFS
), yes
)
81 clean: # if configure hasn't run, nothing to clean
84 # Recent versions of libtool require the -i option for copying auxiliary
85 # files (config.sub, config.guess, install-sh, ltmain.sh), while older
86 # versions will copy those files anyway, and don't understand -i.
87 LIBTOOLIZE_INSTALL
= `libtoolize -n -i >/dev/null 2>/dev/null && echo -i`
90 libtoolize
-c
$(LIBTOOLIZE_INSTALL
) -f
91 cp
include/install-sh .
95 include/builddefs
: configure
96 .
/configure
$$LOCAL_CONFIGURE_OPTIONS
98 include/platform_defs.h
: include/builddefs
99 ## Recover from the removal of $@
100 @if
test -f
$@
; then
:; else \
101 rm -f
include/builddefs
; \
102 $(MAKE
) $(MAKEOPTS
) $(AM_MAKEFLAGS
) include/builddefs
; \
105 install: $(addsuffix -install,$(SUBDIRS
))
106 $(INSTALL
) -m
755 -d
$(PKG_DOC_DIR
)
107 $(INSTALL
) -m
644 README
$(PKG_DOC_DIR
)
109 install-dev
: $(addsuffix -install-dev
,$(SUBDIRS
))
111 install-qa
: install $(addsuffix -install-qa
,$(SUBDIRS
))
114 @echo
"Installing $@"
115 $(Q
)$(MAKE
) $(MAKEOPTS
) -C
$* install
118 @echo
"Installing $@"
119 $(Q
)$(MAKE
) $(MAKEOPTS
) -C
$* install-dev
122 @echo
"Installing $@"
123 $(Q
)$(MAKE
) $(MAKEOPTS
) -C
$* install-qa
129 $(Q
)rm -f
$(CONFIGURE
) .gitcensus
132 # All this gunk is to allow for a make dist on an unconfigured tree
134 dist: include/builddefs
include/platform_defs.h default
135 ifeq ($(HAVE_BUILDDEFS
), no
)
136 $(Q
)$(MAKE
) $(MAKEOPTS
) -C .
$@
138 $(Q
)$(MAKE
) $(MAKEOPTS
) $(SRCTAR
)
141 deb
: include/builddefs
include/platform_defs.h
142 ifeq ($(HAVE_BUILDDEFS
), no
)
143 $(Q
)$(MAKE
) $(MAKEOPTS
) -C .
$@
145 # need to build translations before the source tarball
146 $(Q
)$(MAKE
) $(MAKEOPTS
) -C po
147 $(Q
)$(MAKE
) $(MAKEOPTS
) $(SRCDIR
)
148 $(Q
)cd
$(SRCDIR
) && dpkg-buildpackage
151 $(SRCDIR
) : $(_FORCE
) $(SRCTAR
)
153 $(Q
)$(TAR
) -zxvf
$(SRCTAR
)
155 $(SRCTAR
) : default
$(SRCTARINC
) .gitcensus
156 $(Q
)$(TAR
) --transform
"s,^,$(SRCDIR)/," -zcf
$(SRCDIR
).
tar.gz \
157 `cat .gitcensus` $(SRCTARINC
)
160 .gitcensus
: $(_FORCE
)
161 $(Q
)if
test -d .git
; then \
162 git ls-files
> .gitcensus
&& echo
"new .gitcensus"; \