2 # GNU Make makefile for C tools build.
4 # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
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
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.
17 # If ARCH is not defined, then we use 'uname -m' to attempt
18 # try to figure out the appropriate ARCH.
20 uname_m = $(shell uname -m)
21 $(info Attempting to detect ARCH from 'uname -m': $(uname_m))
22 ifeq ($(uname_m),x86_64)
25 ifeq ($(uname_m),i386)
28 ifeq ($(uname_m),i686)
32 $(info Could not detected ARCH from uname results)
33 $(error ARCH is not defined!)
35 $(info Detected ARCH of $(ARCH) using uname.)
42 include Makefiles/header.makefile
44 all: makerootdir subdirs $(MAKEROOT)/libs
45 @echo Finished building BaseTools C Tools with ARCH=$(ARCH)
48 # NON_BUILDABLE_APPLICATIONS = GenBootSector BootSectImage
67 SUBDIRS := $(LIBRARIES) $(APPLICATIONS)
73 .PHONY: subdirs $(SUBDIRS)
78 .PHONY: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
79 $(patsubst %,%-clean,$(sort $(SUBDIRS))):
80 -$(MAKE) -C $(@:-clean=) clean
82 clean: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
87 rm -f $(MAKEROOT)/bin/*
88 -rmdir $(MAKEROOT)/libs $(MAKEROOT)/bin
90 include Makefiles/footer.makefile