| 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 |
| 22 | ifneq (,$(strip $(filter $(uname_m), x86_64 amd64)))\r |
| 23 | ARCH=X64\r |
| 24 | endif\r |
| 25 | ifeq ($(patsubst i%86,IA32,$(uname_m)),IA32)\r |
| 26 | ARCH=IA32\r |
| 27 | endif\r |
| 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 |
| 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 | BrotliCompress \\r |
| 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 |
| 71 | SUBDIRS := $(LIBRARIES) $(APPLICATIONS)\r |
| 72 | \r |
| 73 | .PHONY: outputdirs\r |
| 74 | makerootdir:\r |
| 75 | -mkdir -p $(MAKEROOT)\r |
| 76 | \r |
| 77 | .PHONY: subdirs $(SUBDIRS)\r |
| 78 | subdirs: $(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 |
| 86 | clean: $(patsubst %,%-clean,$(sort $(SUBDIRS)))\r |
| 87 | \r |
| 88 | clean: localClean\r |
| 89 | \r |
| 90 | localClean:\r |
| 91 | rm -f $(MAKEROOT)/bin/*\r |
| 92 | -rmdir $(MAKEROOT)/libs $(MAKEROOT)/bin\r |
| 93 | \r |
| 94 | include Makefiles/footer.makefile\r |