Fix 8 space tab formatting for non-C files
[akaros.git] / tools / sys-apps / grep / Makefile
1 include ../../Makefrag
2
3 ########## Package-specific variables
4 version := 3.1
5 src-dir = grep-$(version)
6 build-dir = $(src-dir)/build
7 tarball = grep-$(version).tar.xz
8 fetch-url = http://ftp.gnu.org/gnu/grep/$(tarball)
9 config-opts = --prefix=/usr \
10               --bindir=/bin \
11               --disable-nls \
12               --host=x86_64-ucb-akaros \
13               --build=i686-pc-linux-gnu
14
15 ########## Generic Infrastructure
16
17 PHONY := all
18 all: make
19
20 %.tar.xz:
21         $(Q)wget $(fetch-url)
22
23 akaros-patches := $(sort $(wildcard akaros-patches/$(version)/*))
24
25 $(build-dir): $(tarball) $(akaros-patches)
26         rm -fr $(src-dir)
27         tar -xf $<
28         $(Q)mkdir $(build-dir) &&                                              \
29         for i in $(akaros-patches); do                                         \
30                 (cd $(src-dir) && patch -p1 < ../$$i);                         \
31         done
32
33 PHONY += config
34 $(build-dir)/Makefile config: $(build-dir)
35         cd $(build-dir) && env ../configure $(config-opts) && \
36         sed -i '/^.run_help2man = .*dummy-man/s/^.//' Makefile &&  \
37         sed -i '/^run_help2man = .*help2man/d' Makefile
38
39 PHONY += make
40 make: config
41         $(Q)$(MAKE) -C $(build-dir)
42
43 PHONY += install
44 install: make
45         $(Q)$(MAKE) -C $(build-dir) install-exec 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)