]>
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 | |
636b4d91 DC |
43 | |
44 | DLIB_SUBDIRS = libxlog libxcmd libhandle libdisk | |
45 | LIB_SUBDIRS = libxfs $(DLIB_SUBDIRS) | |
c988ea91 | 46 | TOOL_SUBDIRS = copy db estimate fsck fsr growfs io logprint mkfs quota \ |
10a41599 | 47 | mdrestore repair rtcp m4 man doc po debian |
fc49813f | 48 | |
bf3256b2 | 49 | SUBDIRS = include $(LIB_SUBDIRS) $(TOOL_SUBDIRS) |
2a519b73 | 50 | |
1eb10ccb | 51 | default: include/builddefs include/platform_defs.h |
fc49813f | 52 | ifeq ($(HAVE_BUILDDEFS), no) |
35714853 | 53 | $(Q)$(MAKE) $(MAKEOPTS) -C . $@ |
fc49813f | 54 | else |
35714853 | 55 | $(Q)$(MAKE) $(MAKEOPTS) $(SUBDIRS) |
fc49813f NS |
56 | endif |
57 | ||
2a519b73 | 58 | # tool/lib dependencies |
636b4d91 | 59 | # note: include/xfs is set up by libxfs, too, so everything is dependent on it. |
bf3256b2 | 60 | $(LIB_SUBDIRS) $(TOOL_SUBDIRS): include |
636b4d91 DC |
61 | $(DLIB_SUBDIRS) $(TOOL_SUBDIRS): libxfs |
62 | db logprint: libxlog | |
bf3256b2 | 63 | fsr: libhandle |
636b4d91 | 64 | growfs: libxcmd |
2a519b73 | 65 | io: libxcmd libhandle |
2a519b73 | 66 | quota: libxcmd |
636b4d91 DC |
67 | repair: libxlog |
68 | ||
2a519b73 | 69 | |
e4da9941 CH |
70 | ifneq ($(ENABLE_BLKID), yes) |
71 | mkfs: libdisk | |
72 | endif | |
73 | ||
fc49813f NS |
74 | ifeq ($(HAVE_BUILDDEFS), yes) |
75 | include $(BUILDRULES) | |
76 | else | |
77 | clean: # if configure hasn't run, nothing to clean | |
78 | endif | |
79 | ||
07c561fe AG |
80 | # Recent versions of libtool require the -i option for copying auxiliary |
81 | # files (config.sub, config.guess, install-sh, ltmain.sh), while older | |
82 | # versions will copy those files anyway, and don't understand -i. | |
83 | LIBTOOLIZE_INSTALL = `libtoolize -n -i >/dev/null 2>/dev/null && echo -i` | |
84 | ||
1eb10ccb | 85 | configure: |
07c561fe AG |
86 | libtoolize -c $(LIBTOOLIZE_INSTALL) -f |
87 | cp include/install-sh . | |
88 | aclocal -I m4 | |
fc49813f | 89 | autoconf |
1eb10ccb CH |
90 | |
91 | include/builddefs: configure | |
595e27db | 92 | ./configure $$LOCAL_CONFIGURE_OPTIONS |
fc49813f | 93 | |
2a519b73 BN |
94 | include/platform_defs.h: include/builddefs |
95 | ## Recover from the removal of $@ | |
96 | @if test -f $@; then :; else \ | |
97 | rm -f include/builddefs; \ | |
35714853 | 98 | $(MAKE) $(MAKEOPTS) $(AM_MAKEFLAGS) include/builddefs; \ |
2a519b73 BN |
99 | fi |
100 | ||
91128e4c | 101 | install: $(addsuffix -install,$(SUBDIRS)) |
fc49813f NS |
102 | $(INSTALL) -m 755 -d $(PKG_DOC_DIR) |
103 | $(INSTALL) -m 644 README $(PKG_DOC_DIR) | |
104 | ||
91128e4c | 105 | install-dev: $(addsuffix -install-dev,$(SUBDIRS)) |
2a519b73 BN |
106 | |
107 | install-qa: install $(addsuffix -install-qa,$(SUBDIRS)) | |
108 | ||
109 | %-install: | |
91128e4c DC |
110 | @echo "Installing $@" |
111 | $(Q)$(MAKE) $(MAKEOPTS) -C $* install | |
2a519b73 BN |
112 | |
113 | %-install-dev: | |
91128e4c DC |
114 | @echo "Installing $@" |
115 | $(Q)$(MAKE) $(MAKEOPTS) -C $* install-dev | |
fc49813f | 116 | |
2a519b73 | 117 | %-install-qa: |
91128e4c DC |
118 | @echo "Installing $@" |
119 | $(Q)$(MAKE) $(MAKEOPTS) -C $* install-qa | |
5e656dbb | 120 | |
1eb10ccb | 121 | distclean: clean |
35714853 | 122 | $(Q)rm -f $(LDIRT) |
1eb10ccb CH |
123 | |
124 | realclean: distclean | |
48212a30 | 125 | $(Q)rm -f $(CONFIGURE) .gitcensus |
10a41599 CH |
126 | |
127 | # | |
128 | # All this gunk is to allow for a make dist on an unconfigured tree | |
129 | # | |
130 | dist: include/builddefs include/platform_defs.h default | |
131 | ifeq ($(HAVE_BUILDDEFS), no) | |
35714853 | 132 | $(Q)$(MAKE) $(MAKEOPTS) -C . $@ |
10a41599 | 133 | else |
35714853 | 134 | $(Q)$(MAKE) $(MAKEOPTS) $(SRCTAR) |
10a41599 CH |
135 | endif |
136 | ||
137 | deb: include/builddefs include/platform_defs.h | |
138 | ifeq ($(HAVE_BUILDDEFS), no) | |
35714853 | 139 | $(Q)$(MAKE) $(MAKEOPTS) -C . $@ |
10a41599 | 140 | else |
8a70f64c DC |
141 | # need to build translations before the source tarball |
142 | $(Q)$(MAKE) $(MAKEOPTS) -C po | |
35714853 | 143 | $(Q)$(MAKE) $(MAKEOPTS) $(SRCDIR) |
35714853 | 144 | $(Q)cd $(SRCDIR) && dpkg-buildpackage |
10a41599 CH |
145 | endif |
146 | ||
48212a30 | 147 | $(SRCDIR) : $(_FORCE) $(SRCTAR) |
10a41599 | 148 | rm -fr $@ |
48212a30 | 149 | $(Q)$(TAR) -zxvf $(SRCTAR) |
10a41599 | 150 | |
48212a30 BM |
151 | $(SRCTAR) : default $(SRCTARINC) .gitcensus |
152 | $(Q)$(TAR) --transform "s,^,$(SRCDIR)/," -zcf $(SRCDIR).tar.gz \ | |
153 | `cat .gitcensus` $(SRCTARINC) | |
10a41599 | 154 | echo Wrote: $@ |
48212a30 BM |
155 | |
156 | .gitcensus: $(_FORCE) | |
157 | $(Q)if test -d .git; then \ | |
158 | git ls-files > .gitcensus && echo "new .gitcensus"; \ | |
159 | fi |