binutils: fix default
[openadk.git] / package / Makefile
blob8b72511825d95eff580840f5b7ac6c277ea366e5
1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 # Main makefile for the packages
6 include $(ADK_TOPDIR)/rules.mk
8 ifeq (${ADK_TARGET_LIB_GLIBC},y)
9 package-$(ADK_PACKAGE_GLIBC) += glibc
10 gcc-compile: glibc-compile
11 endif
13 ifeq (${ADK_TARGET_LIB_MUSL},y)
14 package-$(ADK_PACKAGE_MUSL) += musl
15 gcc-compile: musl-compile
16 endif
18 ifeq (${ADK_TARGET_LIB_UCLIBC_NG},y)
19 package-$(ADK_PACKAGE_UCLIBC_NG) += uclibc-ng
20 gcc-compile: uclibc-ng-compile
21 endif
23 include $(ADK_TOPDIR)/package/Depends.mk
25 COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y))
26 HOST_COMPILE_PACKAGES:=$(patsubst %,%-host-compile,$(hostpackage-y))
27 INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
29 ifeq ($(ADK_PACKAGE_LIBICONV),y)
30 COMPILE_ICONV:=libiconv-compile
31 INSTALL_ICONV:=libiconv-install
32 endif
34 all: compile
35 download: $(patsubst %,%-download,$(package-y))
36 clean: $(patsubst %,%-clean,$(package-) $(package-y) base-files)
37 hostcompile: $(HOST_COMPILE_PACKAGES)
38 ifeq ($(ADK_APPLIANCE_TOOLCHAIN),y)
39 compile: $(COMPILE_PACKAGES)
40 install: $(INSTALL_PACKAGES)
41 else
42 compile: base-files-compile $(COMPILE_ICONV) $(COMPILE_PACKAGES)
43 install: base-files-install $(INSTALL_ICONV) $(INSTALL_PACKAGES)
44 endif
46 %-download:
47 $(START_TRACE) "package/$(patsubst %-download,%,$@)-download.. "
48 $(MAKE) -C $(patsubst %-download,%,$@) fetch
49 $(CMD_TRACE) " done"
50 $(END_TRACE)
52 %-host-compile:
53 $(START_TRACE) "package/$(patsubst %-host-compile,%,$@)-host.. "
54 $(MAKE) -C $(patsubst %-host-compile,%,$@) hostpackage
55 $(CMD_TRACE) " done"
56 $(END_TRACE)
58 %-compile:
59 $(START_TRACE) "package/$(patsubst %-compile,%,$@).. "
60 @if test -f $(ADK_TOPDIR)/.rebuild.$(patsubst %-compile,%,$@); then \
61 $(MAKE) -C $(patsubst %-compile,%,$@) clean ; \
62 rm $(ADK_TOPDIR)/.rebuild.$(patsubst %-compile,%,$@) ; \
64 $(MAKE) -C $(patsubst %-compile,%,$@) fake build-all-pkgs
65 $(CMD_TRACE) " done"
66 $(END_TRACE)
68 %-install:
69 $(START_TRACE) "package/$(patsubst %-install,%,$@)-install.. "
70 $(MAKE) -C $(patsubst %-install,%,$@) install
71 $(CMD_TRACE) " done"
72 $(END_TRACE)
74 %-clean:
75 $(START_TRACE) "package/$(patsubst %-clean,%,$@)-clean.. "
76 $(MAKE) -C $(patsubst %-clean,%,$@) clean
77 $(CMD_TRACE) " done"
78 $(END_TRACE)