]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/C/GNUmakefile
BaseTools: Add Brotli algorithm tool
[mirror_edk2.git] / BaseTools / Source / C / GNUmakefile
1 ## @file
2 # GNU/Linux makefile for C tools build.
3 #
4 # Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
5 #
6 # This program and the accompanying materials
7 # are licensed and made available under the terms and conditions of the BSD License
8 # which accompanies this distribution. The full text of the license may be found at
9 # http://opensource.org/licenses/bsd-license.php
10 #
11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 #
14
15 ifndef ARCH
16 #
17 # If ARCH is not defined, then we use 'uname -m' to attempt
18 # try to figure out the appropriate ARCH.
19 #
20 uname_m = $(shell uname -m)
21 $(info Attempting to detect ARCH from 'uname -m': $(uname_m))
22 ifneq (,$(strip $(filter $(uname_m), x86_64 amd64)))
23 ARCH=X64
24 endif
25 ifeq ($(patsubst i%86,IA32,$(uname_m)),IA32)
26 ARCH=IA32
27 endif
28 ifneq (,$(findstring aarch64,$(uname_m)))
29 ARCH=AARCH64
30 endif
31 ifneq (,$(findstring arm,$(uname_m)))
32 ARCH=ARM
33 endif
34 ifndef ARCH
35 $(info Could not detected ARCH from uname results)
36 $(error ARCH is not defined!)
37 endif
38 $(info Detected ARCH of $(ARCH) using uname.)
39 endif
40
41 export ARCH
42
43 MAKEROOT = .
44
45 include Makefiles/header.makefile
46
47 all: makerootdir subdirs $(MAKEROOT)/libs
48 @echo Finished building BaseTools C Tools with ARCH=$(ARCH)
49
50 LIBRARIES = Common
51 # NON_BUILDABLE_APPLICATIONS = GenBootSector BootSectImage
52 APPLICATIONS = \
53 GnuGenBootSector \
54 BootSectImage \
55 BrotliCompress \
56 EfiLdrImage \
57 EfiRom \
58 GenFfs \
59 GenFv \
60 GenFw \
61 GenPage \
62 GenSec \
63 GenCrc32 \
64 GenVtf \
65 LzmaCompress \
66 Split \
67 TianoCompress \
68 VolInfo \
69 VfrCompile
70
71 SUBDIRS := $(LIBRARIES) $(APPLICATIONS)
72
73 .PHONY: outputdirs
74 makerootdir:
75 -mkdir -p $(MAKEROOT)
76
77 .PHONY: subdirs $(SUBDIRS)
78 subdirs: $(SUBDIRS)
79 $(SUBDIRS):
80 $(MAKE) -C $@
81
82 .PHONY: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
83 $(patsubst %,%-clean,$(sort $(SUBDIRS))):
84 -$(MAKE) -C $(@:-clean=) clean
85
86 clean: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
87
88 clean: localClean
89
90 localClean:
91 rm -f $(MAKEROOT)/bin/*
92 -rmdir $(MAKEROOT)/libs $(MAKEROOT)/bin
93
94 include Makefiles/footer.makefile