]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - Makefile
libxfs: sync files with 2.6.38 kernel code
[thirdparty/xfsprogs-dev.git] / Makefile
1 #
2 # Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved.
3 #
4
5 ifeq ("$(origin V)", "command line")
6 BUILD_VERBOSE = $(V)
7 endif
8 ifndef BUILD_VERBOSE
9 BUILD_VERBOSE = 0
10 endif
11
12 ifeq ($(BUILD_VERBOSE),1)
13 Q =
14 else
15 Q = @
16 endif
17
18 MAKEOPTS = --no-print-directory Q=$(Q)
19
20 TOPDIR = .
21 HAVE_BUILDDEFS = $(shell test -f $(TOPDIR)/include/builddefs && echo yes || echo no)
22
23 ifeq ($(HAVE_BUILDDEFS), yes)
24 include $(TOPDIR)/include/builddefs
25 endif
26
27 SRCDIR = $(PKG_NAME)-$(PKG_VERSION)
28 SRCTAR = $(PKG_NAME)-$(PKG_VERSION).tar.gz
29
30 CONFIGURE = aclocal.m4 configure config.guess config.sub install-sh ltmain.sh
31 LSRCFILES = configure.in release.sh README VERSION $(CONFIGURE)
32
33 LDIRT = config.log .ltdep .dep config.status config.cache confdefs.h \
34 conftest* built .census install.* install-dev.* *.gz \
35 autom4te.cache/* libtool include/builddefs include/platform_defs.h
36
37 ifeq ($(HAVE_BUILDDEFS), yes)
38 LDIRDIRT = $(SRCDIR)
39 LDIRT += $(SRCTAR)
40 endif
41
42 LIB_SUBDIRS = libxfs libxlog libxcmd libhandle libdisk
43 TOOL_SUBDIRS = copy db estimate fsck fsr growfs io logprint mkfs quota \
44 mdrestore repair rtcp m4 man doc po debian
45
46 SUBDIRS = include $(LIB_SUBDIRS) $(TOOL_SUBDIRS)
47
48 default: include/builddefs include/platform_defs.h
49 ifeq ($(HAVE_BUILDDEFS), no)
50 $(Q)$(MAKE) $(MAKEOPTS) -C . $@
51 else
52 $(Q)$(MAKE) $(MAKEOPTS) $(SUBDIRS)
53 endif
54
55 # tool/lib dependencies
56 $(LIB_SUBDIRS) $(TOOL_SUBDIRS): include
57 copy mdrestore: libxfs
58 db logprint: libxfs libxlog
59 fsr: libhandle
60 growfs: libxfs libxcmd
61 io: libxcmd libhandle
62 mkfs: libxfs
63 quota: libxcmd
64 repair: libxfs libxlog
65
66 ifneq ($(ENABLE_BLKID), yes)
67 mkfs: libdisk
68 endif
69
70 ifeq ($(HAVE_BUILDDEFS), yes)
71 include $(BUILDRULES)
72 else
73 clean: # if configure hasn't run, nothing to clean
74 endif
75
76 # Recent versions of libtool require the -i option for copying auxiliary
77 # files (config.sub, config.guess, install-sh, ltmain.sh), while older
78 # versions will copy those files anyway, and don't understand -i.
79 LIBTOOLIZE_INSTALL = `libtoolize -n -i >/dev/null 2>/dev/null && echo -i`
80
81 configure:
82 libtoolize -c $(LIBTOOLIZE_INSTALL) -f
83 cp include/install-sh .
84 aclocal -I m4
85 autoconf
86
87 include/builddefs: configure
88 ./configure $$LOCAL_CONFIGURE_OPTIONS
89
90 include/platform_defs.h: include/builddefs
91 ## Recover from the removal of $@
92 @if test -f $@; then :; else \
93 rm -f include/builddefs; \
94 $(MAKE) $(MAKEOPTS) $(AM_MAKEFLAGS) include/builddefs; \
95 fi
96
97 install: $(addsuffix -install,$(SUBDIRS))
98 $(INSTALL) -m 755 -d $(PKG_DOC_DIR)
99 $(INSTALL) -m 644 README $(PKG_DOC_DIR)
100
101 install-dev: $(addsuffix -install-dev,$(SUBDIRS))
102
103 install-qa: install $(addsuffix -install-qa,$(SUBDIRS))
104
105 %-install:
106 @echo "Installing $@"
107 $(Q)$(MAKE) $(MAKEOPTS) -C $* install
108
109 %-install-dev:
110 @echo "Installing $@"
111 $(Q)$(MAKE) $(MAKEOPTS) -C $* install-dev
112
113 %-install-qa:
114 @echo "Installing $@"
115 $(Q)$(MAKE) $(MAKEOPTS) -C $* install-qa
116
117 distclean: clean
118 $(Q)rm -f $(LDIRT)
119
120 realclean: distclean
121 $(Q)rm -f $(CONFIGURE)
122
123 #
124 # All this gunk is to allow for a make dist on an unconfigured tree
125 #
126 dist: include/builddefs include/platform_defs.h default
127 ifeq ($(HAVE_BUILDDEFS), no)
128 $(Q)$(MAKE) $(MAKEOPTS) -C . $@
129 else
130 $(Q)$(MAKE) $(MAKEOPTS) $(SRCTAR)
131 endif
132
133 deb: include/builddefs include/platform_defs.h
134 ifeq ($(HAVE_BUILDDEFS), no)
135 $(Q)$(MAKE) $(MAKEOPTS) -C . $@
136 else
137 $(Q)$(MAKE) $(MAKEOPTS) $(SRCDIR)
138 $(Q)$(MAKE) $(MAKEOPTS) -C po
139 $(Q)$(MAKE) $(MAKEOPTS) source-link
140 $(Q)cd $(SRCDIR) && dpkg-buildpackage
141 endif
142
143 $(SRCDIR) : $(_FORCE)
144 rm -fr $@
145 mkdir -p $@
146
147 $(SRCTAR) : default $(SRCDIR)
148 $(Q)$(MAKE) $(MAKEOPTS) source-link
149 unset TAPE; $(TAR) -cf - $(SRCDIR) | $(ZIP) --best > $@ && \
150 echo Wrote: $@