]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/C/GNUmakefile
3b370eb4cecddf8864eb5b1763fb0dbcf1c14cad
[mirror_edk2.git] / BaseTools / Source / C / GNUmakefile
1 ## @file
2 # GNU Make makefile for BaseTools/Source/C.
3 #
4 # Copyright (c) 2007 - 2009, Intel Corporation
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
15 ifndef 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.)
36 endif
37
38 export ARCH
39
40 MAKEROOT = .
41
42 include Makefiles/header.makefile
43
44 all: makerootdir subdirs $(MAKEROOT)/libs
45 @echo Finished building BaseTools C Tools with ARCH=$(ARCH)
46
47 LIBRARIES = Common
48 # NON_BUILDABLE_APPLICATIONS = GenBootSector BootSectImage
49 APPLICATIONS = \
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
67 SUBDIRS := $(LIBRARIES) $(APPLICATIONS)
68
69 .PHONY: outputdirs
70 makerootdir:
71 -mkdir $(MAKEROOT)
72
73 .PHONY: subdirs $(SUBDIRS)
74 subdirs: $(SUBDIRS)
75 $(SUBDIRS):
76 $(MAKE) -C $@
77
78 .PHONY: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
79 $(patsubst %,%-clean,$(sort $(SUBDIRS))):
80 -$(MAKE) -C $(@:-clean=) clean
81
82 clean: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
83
84 clean: localClean
85
86 localClean:
87 rm -f $(MAKEROOT)/bin/*
88 -rmdir $(MAKEROOT)/libs $(MAKEROOT)/bin
89
90 include Makefiles/footer.makefile