Fix 8 space tab formatting for non-C files
[akaros.git] / tools / sys-apps / bash / Makefile
1 include ../../Makefrag
2
3 ########## Package-specific variables
4 version := 4.3.30
5 src-dir = bash-$(version)
6 build-dir = $(src-dir)/build
7 tarball = bash-$(version).tar.gz
8 fetch-url = http://ftp.gnu.org/gnu/bash/$(tarball)
9 config-opts = --prefix=/usr \
10               --bindir=/bin \
11               --without-bash-malloc \
12               --disable-nls \
13               --host=x86_64-ucb-akaros \
14               --build=i686-pc-linux-gnu
15
16 ########## Generic Infrastructure
17
18 PHONY := all
19 all: make
20
21 %.tar.gz:
22         $(Q)wget $(fetch-url)
23
24 akaros-patches := $(sort $(wildcard akaros-patches/$(version)/*))
25
26 $(build-dir): $(tarball) $(akaros-patches)
27         rm -fr $(src-dir)
28         tar -xf $<
29         $(Q)mkdir $(build-dir) &&                                              \
30         for i in $(akaros-patches); do                                         \
31                 (cd $(src-dir) && patch -p1 < ../$$i);                         \
32         done
33
34 PHONY += config
35 $(build-dir)/Makefile config: $(build-dir)
36         cd $(build-dir) && env ../configure $(config-opts)
37
38 PHONY += make
39 make: config
40         $(Q)$(MAKE) -C $(build-dir)
41
42 PHONY += install
43 install: make
44         rm -f $(KFS_ROOT)/bin/bash
45         $(Q)$(MAKE) -C $(build-dir) install DESTDIR=$(KFS_ROOT)
46
47 PHONY += clean
48 clean:
49         $(Q)[ -d $(build-dir) ] &&                                             \
50             [ -f $(build-dir)/Makefile ] &&                                    \
51             $(MAKE) -C $(build-dir) clean || true
52
53 PHONY += mrproper
54 mrproper:
55         $(Q)rm -rf $(src-dir)
56
57 .PHONY: $(PHONY)