]>
Commit | Line | Data |
---|---|---|
fc49813f | 1 | # |
82805b60 | 2 | # Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved. |
dfc130f3 | 3 | # |
fc49813f | 4 | |
35714853 DC |
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 | ||
fc49813f NS |
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 | ||
10a41599 CH |
27 | SRCDIR = $(PKG_NAME)-$(PKG_VERSION) |
28 | SRCTAR = $(PKG_NAME)-$(PKG_VERSION).tar.gz | |
29 | ||
42e5b5df | 30 | CONFIGURE = aclocal.m4 configure config.guess config.sub install-sh ltmain.sh |
81fba137 | 31 | LSRCFILES = configure.ac release.sh README VERSION $(CONFIGURE) |
56c84e02 | 32 | SRCTARINC = m4/libtool.m4 m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 \ |
48212a30 | 33 | m4/ltversion.m4 po/xfsprogs.pot .gitcensus $(CONFIGURE) |
932b0ba9 AE |
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 | |
10a41599 CH |
37 | |
38 | ifeq ($(HAVE_BUILDDEFS), yes) | |
39 | LDIRDIRT = $(SRCDIR) | |
40 | LDIRT += $(SRCTAR) | |
41 | endif | |
f937adac | 42 | |
337d9a24 DC |
43 | # header install rules to populate include/xfs correctly |
44 | HDR_SUBDIRS = include libxfs | |
636b4d91 | 45 | |
2a3a4942 | 46 | DLIB_SUBDIRS = libxlog libxcmd libhandle |
636b4d91 | 47 | LIB_SUBDIRS = libxfs $(DLIB_SUBDIRS) |
ec0a99fa | 48 | TOOL_SUBDIRS = copy db estimate fsck growfs io logprint mkfs quota \ |
dd30c0ae JT |
49 | mdrestore repair rtcp m4 man doc debian |
50 | ||
ec0a99fa FJ |
51 | ifneq ("$(PKG_PLATFORM)","darwin") |
52 | TOOL_SUBDIRS += fsr | |
53 | endif | |
54 | ||
dd30c0ae JT |
55 | ifneq ("$(XGETTEXT)","") |
56 | TOOL_SUBDIRS += po | |
57 | endif | |
fc49813f | 58 | |
5d87ed9d JT |
59 | # If we are on OS X, use glibtoolize from MacPorts, as OS X doesn't have |
60 | # libtoolize binary itself. | |
61 | LIBTOOLIZE_TEST=$(shell libtoolize --version >/dev/null 2>&1 && echo found) | |
62 | LIBTOOLIZE_BIN=libtoolize | |
63 | ifneq ("$(LIBTOOLIZE_TEST)","found") | |
64 | LIBTOOLIZE_BIN=glibtoolize | |
65 | endif | |
66 | ||
cebd3912 DC |
67 | # include is listed last so it is processed last in clean rules. |
68 | SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS) include | |
2a519b73 | 69 | |
1eb10ccb | 70 | default: include/builddefs include/platform_defs.h |
fc49813f | 71 | ifeq ($(HAVE_BUILDDEFS), no) |
35714853 | 72 | $(Q)$(MAKE) $(MAKEOPTS) -C . $@ |
fc49813f | 73 | else |
337d9a24 | 74 | $(Q)$(MAKE) $(MAKEOPTS) headers |
35714853 | 75 | $(Q)$(MAKE) $(MAKEOPTS) $(SUBDIRS) |
fc49813f NS |
76 | endif |
77 | ||
2a519b73 | 78 | # tool/lib dependencies |
636b4d91 | 79 | # note: include/xfs is set up by libxfs, too, so everything is dependent on it. |
bf3256b2 | 80 | $(LIB_SUBDIRS) $(TOOL_SUBDIRS): include |
636b4d91 DC |
81 | $(DLIB_SUBDIRS) $(TOOL_SUBDIRS): libxfs |
82 | db logprint: libxlog | |
bf3256b2 | 83 | fsr: libhandle |
636b4d91 | 84 | growfs: libxcmd |
2a519b73 | 85 | io: libxcmd libhandle |
2a519b73 | 86 | quota: libxcmd |
1b1b5359 | 87 | repair: libxlog libxcmd |
3616eb86 | 88 | copy: libxlog |
82c3a179 | 89 | mkfs: libxcmd |
2a519b73 | 90 | |
fc49813f NS |
91 | ifeq ($(HAVE_BUILDDEFS), yes) |
92 | include $(BUILDRULES) | |
93 | else | |
94 | clean: # if configure hasn't run, nothing to clean | |
95 | endif | |
96 | ||
5d87ed9d | 97 | |
07c561fe AG |
98 | # Recent versions of libtool require the -i option for copying auxiliary |
99 | # files (config.sub, config.guess, install-sh, ltmain.sh), while older | |
100 | # versions will copy those files anyway, and don't understand -i. | |
5d87ed9d | 101 | LIBTOOLIZE_INSTALL = `$(LIBTOOLIZE_BIN) -n -i >/dev/null 2>/dev/null && echo -i` |
07c561fe | 102 | |
1eb10ccb | 103 | configure: |
5d87ed9d | 104 | $(LIBTOOLIZE_BIN) -c $(LIBTOOLIZE_INSTALL) -f |
07c561fe AG |
105 | cp include/install-sh . |
106 | aclocal -I m4 | |
fc49813f | 107 | autoconf |
1eb10ccb CH |
108 | |
109 | include/builddefs: configure | |
595e27db | 110 | ./configure $$LOCAL_CONFIGURE_OPTIONS |
fc49813f | 111 | |
2a519b73 BN |
112 | include/platform_defs.h: include/builddefs |
113 | ## Recover from the removal of $@ | |
114 | @if test -f $@; then :; else \ | |
115 | rm -f include/builddefs; \ | |
35714853 | 116 | $(MAKE) $(MAKEOPTS) $(AM_MAKEFLAGS) include/builddefs; \ |
2a519b73 BN |
117 | fi |
118 | ||
91128e4c | 119 | install: $(addsuffix -install,$(SUBDIRS)) |
fc49813f NS |
120 | $(INSTALL) -m 755 -d $(PKG_DOC_DIR) |
121 | $(INSTALL) -m 644 README $(PKG_DOC_DIR) | |
122 | ||
91128e4c | 123 | install-dev: $(addsuffix -install-dev,$(SUBDIRS)) |
2a519b73 | 124 | |
2a519b73 | 125 | %-install: |
91128e4c DC |
126 | @echo "Installing $@" |
127 | $(Q)$(MAKE) $(MAKEOPTS) -C $* install | |
2a519b73 BN |
128 | |
129 | %-install-dev: | |
91128e4c DC |
130 | @echo "Installing $@" |
131 | $(Q)$(MAKE) $(MAKEOPTS) -C $* install-dev | |
fc49813f | 132 | |
1eb10ccb | 133 | distclean: clean |
35714853 | 134 | $(Q)rm -f $(LDIRT) |
1eb10ccb CH |
135 | |
136 | realclean: distclean | |
48212a30 | 137 | $(Q)rm -f $(CONFIGURE) .gitcensus |
10a41599 CH |
138 | |
139 | # | |
140 | # All this gunk is to allow for a make dist on an unconfigured tree | |
141 | # | |
142 | dist: include/builddefs include/platform_defs.h default | |
143 | ifeq ($(HAVE_BUILDDEFS), no) | |
35714853 | 144 | $(Q)$(MAKE) $(MAKEOPTS) -C . $@ |
10a41599 | 145 | else |
35714853 | 146 | $(Q)$(MAKE) $(MAKEOPTS) $(SRCTAR) |
10a41599 CH |
147 | endif |
148 | ||
149 | deb: include/builddefs include/platform_defs.h | |
150 | ifeq ($(HAVE_BUILDDEFS), no) | |
35714853 | 151 | $(Q)$(MAKE) $(MAKEOPTS) -C . $@ |
10a41599 | 152 | else |
8a70f64c DC |
153 | # need to build translations before the source tarball |
154 | $(Q)$(MAKE) $(MAKEOPTS) -C po | |
35714853 | 155 | $(Q)$(MAKE) $(MAKEOPTS) $(SRCDIR) |
35714853 | 156 | $(Q)cd $(SRCDIR) && dpkg-buildpackage |
10a41599 CH |
157 | endif |
158 | ||
48212a30 | 159 | $(SRCDIR) : $(_FORCE) $(SRCTAR) |
10a41599 | 160 | rm -fr $@ |
48212a30 | 161 | $(Q)$(TAR) -zxvf $(SRCTAR) |
10a41599 | 162 | |
48212a30 BM |
163 | $(SRCTAR) : default $(SRCTARINC) .gitcensus |
164 | $(Q)$(TAR) --transform "s,^,$(SRCDIR)/," -zcf $(SRCDIR).tar.gz \ | |
165 | `cat .gitcensus` $(SRCTARINC) | |
10a41599 | 166 | echo Wrote: $@ |
48212a30 BM |
167 | |
168 | .gitcensus: $(_FORCE) | |
169 | $(Q)if test -d .git; then \ | |
170 | git ls-files > .gitcensus && echo "new .gitcensus"; \ | |
171 | fi |