⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makefile.def

📁 s3c2440在wince4.2下的SDK,实时操作系统用
💻 DEF
📖 第 1 页 / 共 4 页
字号:
!if 0
Copyright (c) Microsoft Corporation.  All rights reserved.
!endif
!if 0
Use of this source code is subject to the terms of the Microsoft end-user
license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
If you did not accept the terms of the EULA, you are not authorized to use
this source code. For a copy of the EULA, please see the LICENSE.RTF on your
install media.
!endif
!IF 0


Module Name:

    makefile.def

Abstract:

    This is the standard makefile for the components of the WINCE project.
    It includes the following files:

     .\sources.      - developer supplies this file.  It defines required and
                 optional macros that control the compiler and linker.

     $(_OBJDIR)\_objects.mac  - built by BUILD.EXE from .\sources.

Targets:

    all       - Builds all targets in this make file

    clean     - Erase all targets that can be produced by this make
          file, ignoring errors.  Also rebuilds the depend target.

!ENDIF

#
# Pick a copy command to use
#
!IF "$(BUILDREL_USE_COPY)"=="1"
#use real copy command
__COPYCMD=copy
!ELSE
# use copylink instead
__COPYCMD=copylink /S:a /D:f /E:a /R:n
!ENDIF



#
# Include the developer supplied file that defines the TARGETNAME,
# TARGETTYPE and SOURCES macros.
#

# Local variable which gets set to the tree being built currently
WINCETREE=$(_CURSLMTREE)

!IF "$(BUILDROOT)"==""
!ERROR BUILDROOT must be defined
!ENDIF
!MESSAGE makefile.def: BUILDROOT is $(BUILDROOT)

!IF EXIST($(BUILDROOT)\sources.cmn)
!MESSAGE makefile.def: including $(BUILDROOT)\sources.cmn
!INCLUDE $(BUILDROOT)\sources.cmn
!ENDIF

# Figure out the appropriate directory for public common. Do this before
# including the sources file so they can be used in there. Note there are
# OS & non-OS projects. OS projects are those that have WINCETREE explicitly
# set in sources.cmn and where public\WINCETREE\cesysgen\makefile exists,
#
# There are 4 cases:
# (1) OS projects during sysgen (2) OS projects during compile
# (3) WINCEPROJ projects (4) Other projects.

!if "$(_IN_CESYSGEN)" != ""
# OS projects during SYSGEN (which get unsysgened input libs & build into projectroot\cesysgen)
_COMMONPUBROOT=$(_PUBLICROOT)\common
__PROJROOT = $(_PROJECTROOT)\cesysgen
!else if ("$(WINCETREE)" == "winceos") || EXIST($(_PUBLICROOT)\$(WINCETREE)\cesysgen\makefile)
# OS projects during compile (which always get the full unfiltered headers & build into their own public tree)
_COMMONPUBROOT=$(_PUBLICROOT)\common
__PROJROOT = $(_PUBLICROOT)\$(WINCEPROJ)
!else if "$(WINCEPROJ)" != ""
# WINCEPROJ projects (which want sysgened headers & libs, but want to build into their *own* public trees)
_COMMONPUBROOT=$(_PROJECTROOT)\cesysgen
__PROJROOT = $(_PUBLICROOT)\$(WINCEPROJ)
!else
# regular user projects (which get sysgened headers & libs & build into the final project public tree)
_COMMONPUBROOT=$(_PROJECTROOT)\cesysgen
__PROJROOT = $(_PROJECTROOT)
!endif

# Construct the CPU's qualified instruction set architecture name (e.g., ARMV4)
TGTCPUISANAME=$(_TGTCPUFAMILY)$(_TGTCPUISA)

# Build all binaries into cpu dependent dirs for simplicity
_CPUINDPATH=$(_TGTCPU)\$(WINCEDEBUG)
_CPUDEPPATH=$(_TGTCPU)\$(WINCEDEBUG)

# Use these to get sysgened (or not sysgened) headers and libs as described above
_COMMONSDKROOT=$(_COMMONPUBROOT)\sdk
_COMMONOAKROOT=$(_COMMONPUBROOT)\oak
_COMMONDDKROOT=$(_COMMONPUBROOT)\ddk

# Use these to explicitly get sysgened headers and libs
_SYSGENSDKROOT=$(_PROJECTROOT)\cesysgen\sdk
_SYSGENOAKROOT=$(_PROJECTROOT)\cesysgen\oak
_SYSGENDDKROOT=$(_PROJECTROOT)\cesysgen\ddk

!INCLUDE .\sources.

!IF EXIST($(_PROJECTROOT)\oak\misc\makefile.inc)
!MESSAGE makefile.def: including $(_PROJECTROOT)\oak\misc\makefile.inc
!INCLUDE $(_PROJECTROOT)\oak\misc\makefile.inc
!ENDIF

!IFNDEF TARGETNAME
!ERROR Your .\sources. file must define the TARGETNAME= macro
!ENDIF

!IFNDEF TARGETTYPE
!ERROR Your .\sources. file must define the TARGETTYPE= macro
!ENDIF

# TARGETTHREADMODEL should be ST for single-threaded, MT for multi-threaded
!IFNDEF TARGETTHREADMODEL
TARGETTHREADMODEL=ST
!ENDIF

!IFNDEF SOURCES
!ERROR Your .\sources. file must define the SOURCES= macro
!ENDIF

# Recalculate the appropriate directory for public common. We are redoing
# this in case they tried to override something in their sources file.
# (See detailed notes above)

!if "$(_IN_CESYSGEN)" != ""
# OS projects during SYSGEN (which get unsysgened input libs & build into projectroot\cesysgen)
_COMMONPUBROOT=$(_PUBLICROOT)\common
__PROJROOT = $(_PROJECTROOT)\cesysgen
!else if ("$(WINCETREE)" == "winceos") || EXIST($(_PUBLICROOT)\$(WINCETREE)\cesysgen\makefile)
# OS projects during compile (which always get the full unfiltered headers & build into their own public tree)
_COMMONPUBROOT=$(_PUBLICROOT)\common
__PROJROOT = $(_PUBLICROOT)\$(WINCEPROJ)
!else if "$(WINCEPROJ)" != ""
# WINCEPROJ projects (which want sysgened headers & libs, but want to build into their *own* public trees)
_COMMONPUBROOT=$(_PROJECTROOT)\cesysgen
__PROJROOT = $(_PUBLICROOT)\$(WINCEPROJ)
!else
# regular user projects (which get sysgened headers & libs & build into the final project public tree)
_COMMONPUBROOT=$(_PROJECTROOT)\cesysgen
__PROJROOT = $(_PROJECTROOT)
!endif

#!ERROR Paths are commonpubroot=$(_COMMONPUBROOT) and projroot=$(__PROJROOT)

# Include generated source variables
!IF !EXIST($(BUILDROOT)\sources.gen)
!IF [call srcgen $(BUILDROOT) $(WINCETREE) $(_COMMONPUBROOT)]
!ENDIF
!ENDIF
!INCLUDE $(BUILDROOT)\sources.gen

!IFNDEF _ISVINCPATH
!ERROR Sources.gen did not include an ISV include path
!ENDIF

# validate WINCEDEBUG since it's used for paths
!IF (("$(WINCEDEBUG)" != "retail") && ("$(WINCEDEBUG)" != "debug"))
!ERROR You must set WINCEDEBUG to retail or debug
!ENDIF

#
# Set up the release directories.
#
_SRCDIR = $(_TGTCPUFAMILY)

!IF "$(WINCECPU)" == ""
__CPUDIR = $(_CPUINDPATH)
!ELSE
__CPUDIR = $(_CPUDEPPATH)
!ENDIF
_OBJDIR = obj\$(__CPUDIR)

!IF "$(RELEASETYPE)" == "SDK"
_RELEASEDIR=$(__PROJROOT)\oak\target\$(__CPUDIR)
_RELEASELIBDIR=$(__PROJROOT)\sdk\lib\$(__CPUDIR)
!ELSEIF "$(RELEASETYPE)" == "DDK"
_RELEASEDIR=$(__PROJROOT)\oak\target\$(__CPUDIR)
_RELEASELIBDIR=$(__PROJROOT)\ddk\lib\$(__CPUDIR)
!ELSEIF "$(RELEASETYPE)" == "PLATFORM"
_RELEASEDIR=$(_TARGETPLATROOT)\target\$(__CPUDIR)
_RELEASELIBDIR=$(_TARGETPLATROOT)\lib\$(__CPUDIR)
!ELSEIF "$(RELEASETYPE)" == "LOCAL"
_RELEASEDIR=$(_OBJDIR)
_RELEASELIBDIR=$(_OBJDIR)
!ELSEIF "$(RELEASETYPE)" == "CUSTOM"
_RELEASEDIR=$(TARGETPATH)
_RELEASELIBDIR=$(TARGETPATH)
!ELSE
_RELEASEDIR=$(__PROJROOT)\oak\target\$(__CPUDIR)
_RELEASELIBDIR=$(__PROJROOT)\oak\lib\$(__CPUDIR)
!ENDIF


#
# Include the list of object files (defined as the OBJECTS macro) that was
# built by BUILD program, using the SOURCES= macro defined in the sources.
# file.  Use macro substitution to build the supported target objects.
#

!IFNDEF NOINCLUDEOBJMAC
!INCLUDE $(_OBJDIR)\_objects.mac
!ENDIF

!IF "$(_TGTOS)"=="CE"
!IFNDEF LINKER_SUBSYSTEM
LINKER_SUBSYSTEM=-subsystem:windowsce,4.20
!ENDIF
!ENDIF

!IFDEF RCADDNULL
RCFLAGS=-n
!ELSE
RCFLAGS=
!ENDIF

!IFDEF DLLENTRY
DLLENTRYOPTION=-entry:$(DLLENTRY)
!ELSE
# Default DLLENTRY for CE is broken.  Provide a correct default entry
!IF "$(_TGTOS)"=="CE"
DLLENTRYOPTION=-entry:_DllMainCRTStartup
!ELSE
DLLENTRYOPTION=
!ENDIF
!ENDIF

!IFDEF EXEENTRY
EXEENTRYOPTION=-entry:$(EXEENTRY)
!ELSE
# Default EXEENTRY for CE is broken.  Provide a correct default entry
!IF "$(_TGTOS)"=="CE"
EXEENTRYOPTION=-entry:WinMainCRTStartup
!ELSE
EXEENTRYOPTION=
!ENDIF
!ENDIF

!IFDEF NODLLENTRY
DLLENTRYOPTION=-NOENTRY
!ENDIF


#
# If BUILDMSG is not defined, the define it as the empty string to make
# the conditionals easier to write.
#

!IFNDEF BUILDMSG
BUILDMSG=
!ENDIF

!IF "$(_TGTCPUFAMILY)"=="x86"
TARGETOBJFILES=$(x86_OBJECTS)
!ELSEIF "$(_TGTCPUFAMILY)"=="MIPS"
TARGETOBJFILES=$(MIPS_OBJECTS)
!ELSEIF "$(_TGTCPUFAMILY)"=="SH"
TARGETOBJFILES=$(SH_OBJECTS)
!ELSEIF "$(_TGTCPUFAMILY)"=="ARM"
TARGETOBJFILES=$(ARM_OBJECTS)
!ENDIF

!IF DEFINED(LINT_TYPE)

!IF "$(LINT_TYPE)" == "all"
!ELSEIF "$(LINT_TYPE)" == "lob"
!ELSEIF "$(LINT_TYPE)" == "ind"
!ELSE
!ERROR LINT_TYPE must be all | lob | ind
!ENDIF

!IF !DEFINED(LINT_PATH)
!ERROR LINT_PATH not set
!ENDIF

!IF !DEFINED(LINT_APP)
!ERROR LINT_APP not set
!ENDIF

!IF !DEFINED(LINT_OUTPUT)
LINT_OUTPUT=$(TARGETNAME)
!ENDIF

!IF !DEFINED(LINT_EXT)
LINT_EXT=Lint
!ENDIF

!IF "$(LINT_TYPE)" == "all"
LINT_TARGETLOBFILES=$(_OBJDIR)\$(LINT_OUTPUT).$(LINT_EXT)
!ELSE
# Don't use TARGETOBJFILES because that'll pull in the precompiled
# header object file which will cause an error because there's
# no inference rule that matches

!IF "$(_TGTCPUFAMILY)"=="x86"
LINT_TARGETLOBFILES=$(x86_OBJECTS:.obj=.lob)
!ELSEIF "$(_TGTCPUFAMILY)"=="MIPS"
LINT_TARGETLOBFILES=$(MIPS_OBJECTS:.obj=.lob)
!ELSEIF "$(_TGTCPUFAMILY)"=="SH"
LINT_TARGETLOBFILES=$(SH_OBJECTS:.obj=.lob)
!ELSEIF "$(_TGTCPUFAMILY)"=="ARM"
LINT_TARGETLOBFILES=$(ARM_OBJECTS:.obj=.lob)
!ENDIF
!ENDIF
!ELSE
LINT_TARGETLOBFILES=
!ENDIF


!IF ("$(TARGETTYPE)" == "LIBRARY") || ("$(TARGETTYPE)" == "DYNLINK")
TARGETLIBFILES=$(_RELEASELIBDIR)\$(TARGETNAME).lib
!ENDIF

TARGETEXEFILES=
!IF "$(NOLINK)" == ""
!    IF "$(TARGETTYPE)" == "DYNLINK"
TARGETEXEFILES=$(_RELEASEDIR)\$(TARGETNAME).dll
!    ELSE
!        IF "$(TARGETTYPE)" == "PROGRAM"
TARGETEXEFILES=$(_RELEASEDIR)\$(TARGETNAME).exe
!        ENDIF
!    ENDIF
!ENDIF

#
# Standard inference rules for C files that produce object files.
#
.SUFFIXES: .cxx .cpp .c .asm .s .src .rc .obj .ire .res .h .odl .tlb .i

!IFDEF PASS0ONLY
# Clear the suffixes list so we can ensure only pass zero stuff will be built
.SUFFIXES:
!ENDIF

!IFNDEF NOPASS0
# Pass Zero Inference Rules: IDL files (MIDL) and MC files
.SUFFIXES: .idl .mc .odl .tdl .asn .thk

!IF "$(_TGTCPUFAMILY)"=="x86"
PASS0_OBJECTS=$(PASS0_x86_OBJECTS)
!ELSEIF "$(_TGTCPUFAMILY)"=="MIPS"
PASS0_OBJECTS=$(PASS0_MIPS_OBJECTS)
!ELSEIF "$(_TGTCPUFAMILY)"=="SH"
PASS0_OBJECTS=$(PASS0_SH_OBJECTS)
!ELSEIF "$(_TGTCPUFAMILY)"=="ARM"
PASS0_OBJECTS=$(PASS0_ARM_OBJECTS)
!ENDIF

!ENDIF  # IFNDEF NOPASS0

!IFDEF USE_OLE_MC
MC = mc -o
!ELSE
MC = mc
!ENDIF

!IF "$(PRECOMPILED_OPTION)" == ""
! IF "$(PRECOMPILED_INCLUDE)" != ""
!  IF "$(PRECOMPILED_INCLUDE)" != "$(PRECOMPILED_INCLUDE:.hxx=)"
PRECOMPILED_CXX=1
!  ENDIF
!  IF "$(PRECOMPILED_INCLUDE)" != "$(PRECOMPILED_INCLUDE:.cxx=)"
PRECOMPILED_CXX=1
!  ENDIF
!  IF "$(PRECOMPILED_INCLUDE)" != "$(PRECOMPILED_INCLUDE:.cpp=)"
PRECOMPILED_CXX=1
!  ENDIF
!  IF "$(PRECOMPILED_PCH)" == ""
PRECOMPILED_PCH=$(PRECOMPILED_INCLUDE:.hxx=.pch)
PRECOMPILED_PCH=$(PRECOMPILED_PCH:.h=.pch)
PRECOMPILED_PCH=$(PRECOMPILED_PCH:.cxx=.pch)
PRECOMPILED_PCH=$(PRECOMPILED_PCH:.cpp=.pch)
PRECOMPILED_PCH=$(PRECOMPILED_PCH:.c=.pch)
PRECOMPILED_PCH=$(PRECOMPILED_PCH:..\=)
!  ENDIF
!  IF "$(PRECOMPILED_OBJ)" == ""
PRECOMPILED_OBJ=$(PRECOMPILED_PCH:.pch=.obj)
!  ENDIF
! ENDIF
!ENDIF

!IF "$(PRECOMPILED_OPTION)" == ""
! IF "$(PRECOMPILED_INCLUDE)" != ""
!  IF "$(PRECOMPILED_PCH)" != ""
HEADERFILE=/Fp$(_OBJDIR)\$(PRECOMPILED_PCH)
!  ENDIF
!  IF "$(PRECOMPILED_OBJ)" != ""
HEADEROBJNAME=$(_OBJDIR)\$(PRECOMPILED_OBJ)
HEADEROBJ=/Fo$(MAKEDIR)\$(HEADEROBJNAME)
!  ENDIF
!  IF "$(PRECOMPILED_CXX)" == ""
PRECOMPILED=/Yu$(PRECOMPILED_INCLUDE:..\=) $(HEADERFILE)
PRECOMPILED_CXX=
!  ELSE
PRECOMPILED=
PRECOMPILED_CXX=/Yu$(PRECOMPILED_INCLUDE:..\=) $(HEADERFILE)
!  ENDIF
PRECOMPILED_TARGET=$(_OBJDIR)\$(PRECOMPILED_PCH)
! ELSE
!  IF "$(PRECOMPILED_INCLUDE)" != ""
!   IF "$(PRECOMPILED_CXX)" == ""
PRECOMPILED=/Yu$(PRECOMPILED_INCLUDE)
PRECOMPILED_CXX=
!   ELSE
PRECOMPILED=
PRECOMPILED_CXX=/Yu$(PRECOMPILED_INCLUDE)
!   ENDIF
!  ENDIF
! ENDIF
!ELSE
! IF "$(PRECOMPILED_CXX)" == ""
PRECOMPILED=$(PRECOMPILED_OPTION)
PRECOMPILED_CXX=
! ELSE
PRECOMPILED=
PRECOMPILED_CXX=$(PRECOMPILED_OPTION)
! ENDIF
PRECOMPILED_TARGET=$(PRECOMPILED_TARGET)
! IF "$(PRECOMPILED_TARGET)" != ""
HEADERFILE=/Fp$(PRECOMPILED_TARGET)
! ENDIF
! IF "$(PRECOMPILED_OBJ)" != ""
HEADEROBJNAME=$(PRECOMPILED_OBJ)
HEADEROBJ=/Fo$(HEADEROBJNAME)
! ENDIF
!ENDIF

!IF ("$(PRECOMPILED_CXX)" == "") && ("$(USECXX_FLAG)" == "")
PRECOMPILED_FLAG=$(PRECOMPILED_FLAG) /Tc
!ELSE
PRECOMPILED_FLAG=$(PRECOMPILED_FLAG) /Tp
!ENDIF

!IF "$(NTNOPCH)" != ""
PRECOMPILED=
PRECOMPILED_CXX=
!ENDIF

# make sure we include the precompiled object if we have one
TARGETOBJFILES=$(TARGETOBJFILES) $(HEADEROBJNAME)

#
# Standard list of targets: all, clean and loc.  all is the default target.
#

!IF "$(SKIPBUILD)" != ""

#empty all: target to not build anything for the current subdir
all:


!ELSE IFNDEF PASS0ONLY

all: \
!IFNDEF NOINCLUDEOBJMAC
    $(_OBJDIR)\_objects.mac \
!ENDIF
    $(WINCETARGETFILE0)  \
    $(PASS0_OBJECTS) \
    $(PRECOMPILED_TARGET) \
    $(HEADEROBJNAME) \
    $(TARGETOBJFILES) \
!IF DEFINED(LINT_TYPE) && ( "$(LINT_TYPE)" == "lob" )
    $(LINT_TARGETLOBFILES) \
!ENDIF
    $(TARGETLIBFILES) \
!IF DEFINED(LINT_TYPE) && ( "$(LINT_TYPE)" != "lob" )
    $(LINT_TARGETLOBFILES) \
!ENDIF
    $(TARGETEXEFILES) \
    $(WINCETARGETFILES)
!IF "$(BUILDMSG)" != ""
    -@echo $(BUILDMSG)
!ENDIF

!ELSE   # PASS0ONLY

all: \
    $(WINCETARGETFILE0)  \
    $(PASS0_OBJECTS)
!IF "$(BUILDMSG)" != ""
    -@echo $(BUILDMSG)
!ENDIF

!ENDIF  # PASS0ONLY


!IFNDEF PASS0_HEADERDIR
PASS0_HEADERDIR=.
!ENDIF

! IFNDEF PASS0_SOURCEDIR
PASS0_SOURCEDIR=.
! ENDIF

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -