]>
Commit | Line | Data |
---|---|---|
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 | |
15 | ifndef 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 | |
39 | endif\r | |
40 | \r | |
41 | export ARCH\r | |
42 | \r | |
43 | MAKEROOT = .\r | |
44 | \r | |
45 | include Makefiles/header.makefile\r | |
46 | \r | |
47 | all: makerootdir subdirs $(MAKEROOT)/libs\r | |
48 | @echo Finished building BaseTools C Tools with ARCH=$(ARCH)\r | |
49 | \r | |
50 | LIBRARIES = Common\r | |
51 | # NON_BUILDABLE_APPLICATIONS = GenBootSector BootSectImage\r | |
52 | APPLICATIONS = \\r | |
53 | GnuGenBootSector \\r | |
54 | BootSectImage \\r | |
55 | EfiLdrImage \\r | |
56 | EfiRom \\r | |
57 | GenFfs \\r | |
58 | GenFv \\r | |
59 | GenFw \\r | |
60 | GenPage \\r | |
61 | GenSec \\r | |
62 | GenCrc32 \\r | |
63 | GenVtf \\r | |
64 | LzmaCompress \\r | |
65 | Split \\r | |
66 | TianoCompress \\r | |
67 | VolInfo \\r | |
68 | VfrCompile\r | |
69 | \r | |
70 | SUBDIRS := $(LIBRARIES) $(APPLICATIONS)\r | |
71 | \r | |
72 | .PHONY: outputdirs\r | |
73 | makerootdir:\r | |
74 | -mkdir -p $(MAKEROOT)\r | |
75 | \r | |
76 | .PHONY: subdirs $(SUBDIRS)\r | |
77 | subdirs: $(SUBDIRS)\r | |
78 | $(SUBDIRS):\r | |
79 | $(MAKE) -C $@\r | |
80 | \r | |
81 | .PHONY: $(patsubst %,%-clean,$(sort $(SUBDIRS)))\r | |
82 | $(patsubst %,%-clean,$(sort $(SUBDIRS))):\r | |
83 | -$(MAKE) -C $(@:-clean=) clean\r | |
84 | \r | |
85 | clean: $(patsubst %,%-clean,$(sort $(SUBDIRS)))\r | |
86 | \r | |
87 | clean: localClean\r | |
88 | \r | |
89 | localClean:\r | |
90 | rm -f $(MAKEROOT)/bin/*\r | |
91 | -rmdir $(MAKEROOT)/libs $(MAKEROOT)/bin\r | |
92 | \r | |
93 | include Makefiles/footer.makefile\r |