Fix 8 space tab formatting for non-C files
[akaros.git] / tools / dev-libs / elfutils / Makefile
1 # Copyright (c) 2016 Google Inc
2 # Barret Rhoden <brho@cs.berkeley.edu>
3 # See LICENSE for details.
4 #
5 # Makefile for elfutils
6 #
7 # Most of this is not specific to this library.  You can copy the bulk of it,
8 # modify the variables at the top, and maybe change the configure/make commands
9 # to suit your package.
10
11 include ../../Makefrag
12
13 ########## Package-specific variables
14 # 0.165 needs glibc > 2.22 and zlib
15 version := 0.164
16 build-dir = elfutils-$(version)
17 tarball = elfutils-$(version).tar.bz2
18 fetch-url = https://fedorahosted.org/releases/e/l/elfutils/$(version)/$(tarball)
19 config-opts = --host=$(AKAROS_PREFIX) \
20               --without-zlib \
21               --prefix=$(AKAROS_SYSROOT)/usr
22
23 ########## Generic Infrastructure
24
25 PHONY := all
26 all: make
27
28 %.tar.bz2 %.tar.gz %.tbz:
29         $(Q)wget $(fetch-url)
30
31 akaros-patches := $(sort $(wildcard akaros-patches/$(version)/*))
32
33 $(build-dir): $(tarball) $(akaros-patches)
34         $(Q)rm -rf $@
35         tar -xf $<
36         $(Q)cd $@ &&                                                           \
37         for i in $(akaros-patches); do                                         \
38                 patch -p1 < ../$$i;                                            \
39         done
40
41 PHONY += config
42 $(build-dir)/Makefile config: $(build-dir)
43         $(Q)cd $(build-dir) && ./configure $(config-opts)
44
45 PHONY += make
46 make: config
47         $(Q)$(MAKE) -C $(build-dir) all
48
49 PHONY += install
50 install: make
51         $(Q)$(MAKE) -C $(build-dir) install
52
53 PHONY += clean
54 clean:
55         $(Q)[ -d $(build-dir) ] &&                                             \
56             [ -f $(build-dir)/Makefile ] &&                                    \
57             $(MAKE) -C $(build-dir) clean || true
58
59 PHONY += mrproper
60 mrproper:
61         $(Q)[ -d $(build-dir) ] &&                                             \
62             [ -f $(build-dir)/Makefile ] &&                                    \
63             $(MAKE) -C $(build-dir) uninstall || true
64         $(Q)rm -rf $(build-dir)
65
66 .PHONY: $(PHONY)