Check In tool source code based on Build tool project revision r1655.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8964 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4
2009-07-17 09:10:31 +00:00
parent 577e30cdb4
commit 30fdf1140b
532 changed files with 231447 additions and 32 deletions

View File

@@ -0,0 +1,28 @@
@echo off
setlocal
SET NMAKE_COMMAND=%1
SHIFT
:loop
if "%1"=="" goto success
ECHO Building %1
pushd %1
nmake %NMAKE_COMMAND%
if ERRORLEVEL 1 goto error
ECHO %1 built successfully (%NMAKE_COMMAND%)
ECHO.
shift
popd
goto loop
:success
goto exit
:error
popd
ENDLOCAL
ECHO Error while making %1!
VERIFY OTHER 2>NUL
:exit

View File

@@ -0,0 +1,13 @@
MAKEROOT ?= ../..
include $(MAKEROOT)/Makefiles/header.makefile
APPLICATION = $(MAKEROOT)/bin/$(APPNAME)
.PHONY:all
all: $(MAKEROOT)/bin $(APPLICATION)
$(APPLICATION): $(OBJECTS)
$(LINKER) -o $(APPLICATION) $(OBJECTS) -L$(MAKEROOT)/libs $(LIBS)
include $(MAKEROOT)/Makefiles/footer.makefile

View File

@@ -0,0 +1,23 @@
DEPFILES = $(OBJECTS:%.o=%.d)
$(MAKEROOT)/libs-$(ARCH):
mkdir -p $(MAKEROOT)/libs-$(ARCH)
.PHONY: install
install: $(MAKEROOT)/libs-$(ARCH) $(LIBRARY)
cp $(LIBRARY) $(MAKEROOT)/libs-$(ARCH)
$(LIBRARY): $(OBJECTS)
$(AR) crs $@ $^
%.o : %.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
%.o : %.S
$(AS) -c $(ASFLAGS) $< -o $@
.PHONY: clean
clean:
@rm -f $(OBJECTS) $(LIBRARY) $(DEPFILES)
-include $(DEPFILES)

View File

@@ -0,0 +1,40 @@
# The makefile can be invoked with
# ARCH = x86_64 or x64 for EM64T build
# ARCH = ia32 or IA32 for IA32 build
# ARCH = ia64 or IA64 for IA64 build
#
ARCH ?= IA32
CYGWIN:=$(findstring CYGWIN, $(shell uname -s))
LINUX:=$(findstring Linux, $(shell uname -s))
DARWIN:=$(findstring Darwin, $(shell uname -s))
CC = gcc
CXX = g++
AS = gcc
AR = ar
LD = ld
LINKER ?= $(CC)
ifeq ($(ARCH), IA32)
ARCH_INCLUDE = -I $(MAKEROOT)/Include/Ia32/
endif
ifeq ($(ARCH), X64)
ARCH_INCLUDE = -I $(MAKEROOT)/Include/X64/
endif
INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE)
CPPFLAGS = $(INCLUDE)
CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fno-merge-constants -nostdlib -Wall -c -g
.PHONY: all
.PHONY: install
.PHONY: clean
all:
$(MAKEROOT)/libs:
mkdir $(MAKEROOT)/libs
$(MAKEROOT)/bin:
mkdir $(MAKEROOT)/bin

View File

@@ -0,0 +1,7 @@
include $(MAKEROOT)/Makefiles/header.makefile
LIBRARY = $(MAKEROOT)/libs/lib$(LIBNAME).a
all: $(MAKEROOT)/libs $(LIBRARY)
include $(MAKEROOT)/Makefiles/footer.makefile

View File

@@ -0,0 +1,21 @@
!INCLUDE ..\Makefiles\ms.common
APPLICATION = $(BIN_PATH)\$(APPNAME).exe
all: $(APPLICATION)
$(APPLICATION) : $(OBJECTS)
-@if not exist $(BIN_PATH) mkdir $(BIN_PATH)
$(LD) /nologo /debug /incremental:no /nodefaultlib:libc.lib /out:$@ $(LIBS) $**
.PHONY:clean
.PHONY:cleanall
clean:
del /f /q $(OBJECTS) *.pdb > nul
cleanall:
del /f /q $(OBJECTS) $(APPLICATION) *.pdb $(BIN_PATH)\*.pdb > nul
!INCLUDE ..\Makefiles\ms.rule

View File

@@ -0,0 +1,49 @@
!IFNDEF EDK_TOOLS_PATH
!ERROR "Please set your EDK_TOOLS_PATH!"
!ENDIF
!IFNDEF BASE_TOOLS_PATH
!ERROR "BASE_TOOLS_PATH is not set! Please run build_tools.bat at first!"
!ENDIF
!IFNDEF ARCH
ARCH = IA32
!ENDIF
MAKE = nmake -nologo
SOURCE_PATH = $(BASE_TOOLS_PATH)\Source\C
BIN_PATH = $(BASE_TOOLS_PATH)\Bin
LIB_PATH = $(BASE_TOOLS_PATH)\Lib
SYS_BIN_PATH=$(EDK_TOOLS_PATH)\Bin
SYS_LIB_PATH=$(EDK_TOOLS_PATH)\Lib
!IF "$(ARCH)"=="IA32"
ARCH_INCLUDE = $(SOURCE_PATH)\Include\Ia32
BIN_PATH = $(BASE_TOOLS_PATH)\Bin\Win32
LIB_PATH = $(BASE_TOOLS_PATH)\Lib\Win32
SYS_BIN_PATH = $(EDK_TOOLS_PATH)\Bin\Win32
SYS_LIB_PATH = $(EDK_TOOLS_PATH)\Lib\Win32
!ENDIF
!IF "$(ARCH)"=="X64"
ARCH_INCLUDE = $(SOURCE_PATH)\Include\X64
BIN_PATH = $(BASE_TOOLS_PATH)\Bin\Win64
LIB_PATH = $(BASE_TOOLS_PATH)\Lib\Win64
SYS_BIN_PATH = $(EDK_TOOLS_PATH)\Bin\Win64
SYS_LIB_PATH = $(EDK_TOOLS_PATH)\Lib\Win64
!ENDIF
CC = cl.exe
CXX = cl.exe
AS = ml.exe
AR = lib.exe
LD = link.exe
LINKER = $(LD)
INC = -I . -I $(SOURCE_PATH)\Include -I $(ARCH_INCLUDE) -I $(SOURCE_PATH)\Common $(INC)
CFLAGS = $(CFLAGS) /nologo /c /Zi /Od /RTC1 /D _DEBUG /MTd /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
CPPFLAGS = $(CPPFLAGS) /EHsc /nologo /c /Zi /Od /RTC1 /D _DEBUG /MTd /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE

View File

@@ -0,0 +1,20 @@
!INCLUDE ..\Makefiles\ms.common
LIBRARY = $(LIB_PATH)\$(LIBNAME).lib
all: $(LIBRARY)
$(LIBRARY) : $(OBJECTS)
-@if not exist $(LIB_PATH) mkdir $(LIB_PATH)
$(AR) /nologo /out:$@ $**
.PHONY:clean
clean:
del /f /q $(OBJECTS) *.pdb > nul
.PHONY:cleanall
cleanall:
del /f /q $(OBJECTS) $(LIBRARY) *.pdb > nul
!INCLUDE ..\Makefiles\ms.rule

View File

@@ -0,0 +1,13 @@
#DEPFILES = $(OBJECTS:%.o=%.d)
.c.obj :
$(CC) -c $(CFLAGS) $(INC) $< -Fo$@
.S.obj :
$(AS) -c $(ASFLAGS) $< -Fo$@
.cpp.obj :
$(CXX) -c $(CPPFLAGS) $(INC) $< -Fo$@
#-include $(DEPFILES)