]>
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 |
10a41599 | 31 | LSRCFILES = configure.in release.sh README VERSION $(CONFIGURE) |
f937adac | 32 | |
932b0ba9 AE |
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 | |
10a41599 CH |
36 | |
37 | ifeq ($(HAVE_BUILDDEFS), yes) | |
38 | LDIRDIRT = $(SRCDIR) | |
39 | LDIRT += $(SRCTAR) | |
40 | endif | |
f937adac | 41 | |
a90dd971 | 42 | LIB_SUBDIRS = libxfs libxlog libxcmd libhandle libdisk |
c988ea91 | 43 | TOOL_SUBDIRS = copy db estimate fsck fsr growfs io logprint mkfs quota \ |
10a41599 | 44 | mdrestore repair rtcp m4 man doc po debian |
fc49813f | 45 | |
bf3256b2 | 46 | SUBDIRS = include $(LIB_SUBDIRS) $(TOOL_SUBDIRS) |
2a519b73 | 47 | |
1eb10ccb | 48 | default: include/builddefs include/platform_defs.h |
fc49813f | 49 | ifeq ($(HAVE_BUILDDEFS), no) |
35714853 | 50 | $(Q)$(MAKE) $(MAKEOPTS) -C . $@ |
fc49813f | 51 | else |
35714853 | 52 | $(Q)$(MAKE) $(MAKEOPTS) $(SUBDIRS) |
fc49813f NS |
53 | endif |
54 | ||
2a519b73 | 55 | # tool/lib dependencies |
bf3256b2 | 56 | $(LIB_SUBDIRS) $(TOOL_SUBDIRS): include |
2a519b73 BN |
57 | copy mdrestore: libxfs |
58 | db logprint: libxfs libxlog | |
bf3256b2 | 59 | fsr: libhandle |
2a519b73 BN |
60 | growfs: libxfs libxcmd |
61 | io: libxcmd libhandle | |
e4da9941 | 62 | mkfs: libxfs |
2a519b73 BN |
63 | quota: libxcmd |
64 | repair: libxfs libxlog | |
65 | ||
e4da9941 CH |
66 | ifneq ($(ENABLE_BLKID), yes) |
67 | mkfs: libdisk | |
68 | endif | |
69 | ||
fc49813f NS |
70 | ifeq ($(HAVE_BUILDDEFS), yes) |
71 | include $(BUILDRULES) | |
72 | else | |
73 | clean: # if configure hasn't run, nothing to clean | |
74 | endif | |
75 | ||
07c561fe AG |
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 | ||
1eb10ccb | 81 | configure: |
07c561fe AG |
82 | libtoolize -c $(LIBTOOLIZE_INSTALL) -f |
83 | cp include/install-sh . | |
84 | aclocal -I m4 | |
fc49813f | 85 | autoconf |
1eb10ccb CH |
86 | |
87 | include/builddefs: configure | |
595e27db | 88 | ./configure $$LOCAL_CONFIGURE_OPTIONS |
fc49813f | 89 | |
2a519b73 BN |
90 | include/platform_defs.h: include/builddefs |
91 | ## Recover from the removal of $@ | |
92 | @if test -f $@; then :; else \ | |
93 | rm -f include/builddefs; \ | |
35714853 | 94 | $(MAKE) $(MAKEOPTS) $(AM_MAKEFLAGS) include/builddefs; \ |
2a519b73 BN |
95 | fi |
96 | ||
91128e4c | 97 | install: $(addsuffix -install,$(SUBDIRS)) |
fc49813f NS |
98 | $(INSTALL) -m 755 -d $(PKG_DOC_DIR) |
99 | $(INSTALL) -m 644 README $(PKG_DOC_DIR) | |
100 | ||
91128e4c | 101 | install-dev: $(addsuffix -install-dev,$(SUBDIRS)) |
2a519b73 BN |
102 | |
103 | install-qa: install $(addsuffix -install-qa,$(SUBDIRS)) | |
104 | ||
105 | %-install: | |
91128e4c DC |
106 | @echo "Installing $@" |
107 | $(Q)$(MAKE) $(MAKEOPTS) -C $* install | |
2a519b73 BN |
108 | |
109 | %-install-dev: | |
91128e4c DC |
110 | @echo "Installing $@" |
111 | $(Q)$(MAKE) $(MAKEOPTS) -C $* install-dev | |
fc49813f | 112 | |
2a519b73 | 113 | %-install-qa: |
91128e4c DC |
114 | @echo "Installing $@" |
115 | $(Q)$(MAKE) $(MAKEOPTS) -C $* install-qa | |
5e656dbb | 116 | |
1eb10ccb | 117 | distclean: clean |
35714853 | 118 | $(Q)rm -f $(LDIRT) |
1eb10ccb CH |
119 | |
120 | realclean: distclean | |
35714853 | 121 | $(Q)rm -f $(CONFIGURE) |
10a41599 CH |
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) | |
35714853 | 128 | $(Q)$(MAKE) $(MAKEOPTS) -C . $@ |
10a41599 | 129 | else |
35714853 | 130 | $(Q)$(MAKE) $(MAKEOPTS) $(SRCTAR) |
10a41599 CH |
131 | endif |
132 | ||
133 | deb: include/builddefs include/platform_defs.h | |
134 | ifeq ($(HAVE_BUILDDEFS), no) | |
35714853 | 135 | $(Q)$(MAKE) $(MAKEOPTS) -C . $@ |
10a41599 | 136 | else |
35714853 DC |
137 | $(Q)$(MAKE) $(MAKEOPTS) $(SRCDIR) |
138 | $(Q)$(MAKE) $(MAKEOPTS) -C po | |
139 | $(Q)$(MAKE) $(MAKEOPTS) source-link | |
140 | $(Q)cd $(SRCDIR) && dpkg-buildpackage | |
10a41599 CH |
141 | endif |
142 | ||
143 | $(SRCDIR) : $(_FORCE) | |
144 | rm -fr $@ | |
145 | mkdir -p $@ | |
146 | ||
147 | $(SRCTAR) : default $(SRCDIR) | |
35714853 | 148 | $(Q)$(MAKE) $(MAKEOPTS) source-link |
10a41599 CH |
149 | unset TAPE; $(TAR) -cf - $(SRCDIR) | $(ZIP) --best > $@ && \ |
150 | echo Wrote: $@ |