summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/Scripts
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2012-09-26 20:12:55 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2012-09-26 20:12:55 +0000
commite349327f1a7dbe91a9c6d23aceaae1bf5761ff82 (patch)
tree346a4bdddd57502118d17ca23d76aa46fb914ada /ArmPlatformPkg/Scripts
parent98b241d634c652bb615e1fd33cc2e4bb8efc7216 (diff)
downloadedk2-platforms-e349327f1a7dbe91a9c6d23aceaae1bf5761ff82.tar.xz
ArmPlatformPkg: Added 'Makefile' to build EDK2 from Makefile based IDE
This makefile can be used to build EDK2 from Eclipse CDT plug-in. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13743 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/Scripts')
-rw-r--r--ArmPlatformPkg/Scripts/Makefile66
1 files changed, 66 insertions, 0 deletions
diff --git a/ArmPlatformPkg/Scripts/Makefile b/ArmPlatformPkg/Scripts/Makefile
new file mode 100644
index 0000000000..31bed29646
--- /dev/null
+++ b/ArmPlatformPkg/Scripts/Makefile
@@ -0,0 +1,66 @@
+#/* @file
+# Copyright (c) 2011-2012, ARM Limited. All rights reserved.
+#
+# This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+#*/
+
+# Define the following variables to specify an alternative toolchain to the one located in your PATH:
+# - RVCT_TOOLS_PATH: for RVCT and RVCTLINUX toolchains
+# - ARMGCC_TOOLS_PATH: for ARMGCC toolchain
+# - ARMLINUXGCC_TOOLS_PATH: for ARMLINUXGCC
+
+EDK2_TOOLCHAIN ?= RVCTLINUX
+EDK2_ARCH ?= ARM
+EDK2_BUILD ?= DEBUG
+
+ifeq ($(EDK2_DSC),"")
+ $(error The Makfile macro 'EDK2_DSC' must be defined with an EDK2 DSC file.)
+endif
+
+ifeq ("$(OS)","Windows_NT")
+WORKSPACE?=$(PWD)
+EDK_TOOLS_PATH ?= $(WORKSPACE)\BaseTools
+endif
+
+SHELL := /bin/bash
+SILENT ?= @
+ECHO ?= echo
+MAKE ?= make -i -k
+RM ?= rm -f
+
+.PHONY: all clean
+
+EDK2_CONF = Conf/BuildEnv.sh Conf/build_rule.txt Conf/target.txt Conf/tools_def.txt
+
+all: $(EDK2_CONF)
+ifeq ("$(OS)","Windows_NT")
+ echo %PATH%
+ build -a $(EDK2_ARCH) -p $(EDK2_PKG) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS)
+else
+ . ./edksetup.sh `pwd`/BaseTools; build -a $(EDK2_ARCH) -p $(EDK2_DSC) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS)
+endif
+
+$(EDK2_CONF):
+ifeq ("$(OS)","Windows_NT")
+ copy $(EDK_TOOLS_PATH)\Conf\build_rule.template Conf\build_rule.txt
+ copy $(EDK_TOOLS_PATH)\Conf\FrameworkDatabase.template Conf\FrameworkDatabase.txt
+ copy $(EDK_TOOLS_PATH)\Conf\target.template Conf\target.txt
+ copy $(EDK_TOOLS_PATH)\Conf\tools_def.template Conf\tools_def.txt
+else
+ . ./edksetup.sh `pwd`/BaseTools; $(MAKE) -C BaseTools
+endif
+
+clean:
+ifeq ("$(OS)","Windows_NT")
+ build -a $(EDK2_ARCH) -p $(EDK2_PKG) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS) cleanall
+else
+ . ./edksetup.sh `pwd`/BaseTools; build -a $(EDK2_ARCH) -p $(EDK2_DSC) -t $(EDK2_TOOLCHAIN) -b $(EDK2_BUILD) $(EDK2_MACROS) cleanall; \
+ rm -Rf $(EDK2_CONF) Conf/.cache
+endif