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