]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Source/C/GNUmakefile
Sync EDKII BaseTools to BaseTools project r1913.
[mirror_edk2.git] / BaseTools / Source / C / GNUmakefile
CommitLineData
30fdf114 1## @file
c69f724d 2# GNU Make makefile for C tools build.
30fdf114 3#
c69f724d 4# Copyright (c) 2007 - 2010, Intel Corporation
30fdf114
LG
5#
6# All rights reserved. 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
15ifndef 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 ifeq ($(uname_m),x86_64)
23 ARCH=X64
24 endif
25 ifeq ($(uname_m),i386)
26 ARCH=IA32
27 endif
28 ifeq ($(uname_m),i686)
29 ARCH=IA32
30 endif
31 ifndef ARCH
32 $(info Could not detected ARCH from uname results)
33 $(error ARCH is not defined!)
34 endif
35 $(info Detected ARCH of $(ARCH) using uname.)
36endif
37
38export ARCH
39
40MAKEROOT = .
41
42include Makefiles/header.makefile
43
44all: makerootdir subdirs $(MAKEROOT)/libs
45 @echo Finished building BaseTools C Tools with ARCH=$(ARCH)
46
47LIBRARIES = Common
48# NON_BUILDABLE_APPLICATIONS = GenBootSector BootSectImage
49APPLICATIONS = \
50 GnuGenBootSector \
51 BootSectImage \
52 EfiLdrImage \
53 EfiRom \
54 GenFfs \
55 GenFv \
56 GenFw \
57 GenPage \
58 GenSec \
59 GenCrc32 \
60 GenVtf \
61 LzmaCompress \
62 Split \
63 TianoCompress \
64 VolInfo \
65 VfrCompile
66
67SUBDIRS := $(LIBRARIES) $(APPLICATIONS)
68
69.PHONY: outputdirs
70makerootdir:
71 -mkdir $(MAKEROOT)
72
73.PHONY: subdirs $(SUBDIRS)
74subdirs: $(SUBDIRS)
75$(SUBDIRS):
76 $(MAKE) -C $@
77
78.PHONY: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
79$(patsubst %,%-clean,$(sort $(SUBDIRS))):
80 -$(MAKE) -C $(@:-clean=) clean
81
82clean: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
83
84clean: localClean
85
86localClean:
87 rm -f $(MAKEROOT)/bin/*
88 -rmdir $(MAKEROOT)/libs $(MAKEROOT)/bin
89
90include Makefiles/footer.makefile