Blob Blame History Raw
# BEGIN_ICS_COPYRIGHT8 ****************************************
# 
# Copyright (c) 2015, Intel Corporation
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 
#     * Redistributions of source code must retain the above copyright notice,
#       this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in the
#       documentation and/or other materials provided with the distribution.
#     * Neither the name of Intel Corporation nor the names of its contributors
#       may be used to endorse or promote products derived from this software
#       without specific prior written permission.
# 
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# 
# END_ICS_COPYRIGHT8   ****************************************
# Sample makefile for building a shared library for a proxy, from an idl file 
# for windows com objects

# Include Make Control Settings
include $(TL_DIR)/$(PROJ_FILE_DIR)/Makesettings.project

#=============================================================================#
# Definitions:
#-----------------------------------------------------------------------------#

# Name of SubProjects
DS_SUBPROJECTS = FILL IN SUB PROJECTS as directories relative to project dir
# name of executable or downloadable image
EXECUTABLE		= 
# list of sub directories to build
DIRS			= 
# C files (.c)
CFILES			= $(IDLFILE:.idl=_i.c)
# .c files - for proxy/stub .dll
PS_CFILES		= $(IDLFILE:.idl=_p.c) \
			  $(IDLFILE:.idl=_dlldata.c)
# C++ files (.cpp)
CCFILES			= 
# lex files (.lex)
LFILES			= 
# Windows Resource Files (.rc)
RSCFILES		= $(IDLFILE:.idl=_ps.rc)
# Windows IDL File (.idl)
IDLFILE			= MYFILE.idl
# Windows Linker Module Definitions (.def) file for dll's
DEFFILE			= $(IDLFILE:.idl=_ps.def)
# targets to build during INCLUDES phase (add public includes here)
INCLUDE_TARGETS		=
# Non-compiled files
MISC_FILES		= 
# all source files
SOURCES			= $(CFILES) $(CCFILES) $(LFILES) $(RSCFILES) $(IDLFILE)
# Source files to include in DSP File
DSP_SOURCES		= $(INCLUDE_TARGETS) $(SOURCES) $(MISC_FILES) \
				  $(RSCFILES) $(DEFFILE) $(MAKEFILE)
# all object files
OBJECTS			= $(CFILES:.c=$(OBJ_SUFFIX)) $(CCFILES:.cpp=$(OBJ_SUFFIX)) \
				  $(LFILES:.lex=$(OBJ_SUFFIX))
# all object files - for proxy/stub .dll
PS_OBJECTS		= $(PS_CFILES:.c=$(OBJ_SUFFIX)) $(PS_CCFILES:.cpp=$(OBJ_SUFFIX))
RSCOBJECTS		= $(RSCFILES:.rc=$(RES_SUFFIX))
# targets to build during LIBS phase
LIB_TARGETS_IMPLIB	=
LIB_TARGETS_ARLIB	= 
LIB_TARGETS_ARLIB	= $(DS_PROJECT)$(ARLIB_SUFFIX)
LIB_TARGETS_EXP		= $(LIB_TARGETS_IMPLIB:$(ARLIB_SUFFIX)=$(EXP_SUFFIX))
LIB_TARGETS_MISC	= 
# targets to build during CMDS phase
CMD_TARGETS_PSSHLIB	= $(IDLFILE:.idl=_ps$(SHLIB_SUFFIX))
CMD_TARGETS_SHLIB	= 
CMD_TARGETS_EXE		= $(EXECUTABLE)
CMD_TARGETS_MISC	=
CMD_TARGETS_DRIVER	=
CMD_TARGETS_KEXT	=
# files to remove during clean phase
CLEAN_TARGETS_MISC=
CLEAN_TARGETS		= $(OBJECTS) $(RSCOBJECTS) $(IDL_TARGETS) $(CLEAN_TARGETS_MISC) $(PS_OBJECTS)
# other files to remove during clobber phase
CLOBBER_TARGETS_MISC= $(CMD_TARGETS_PSSHLIB)
# sub-directory to install to within bin
BIN_SUBDIR		= 
# sub-directory to install to within include
INCLUDE_SUBDIR		=

# Include Make Rules definitions and rules
include $(TL_DIR)/$(PROJ_FILE_DIR)/Makerules.project

#=============================================================================#
# Overrides:
#-----------------------------------------------------------------------------#
#CLOCALDEBUG	= User defined C debugging compilation flags [Empty]
#CCLOCALDEBUG	= User defined C++ debugging compilation flags [Empty]
#CLOCAL	= User defined C flags for compiling [Empty]
#CCLOCAL	= User defined C++ flags for compiling [Empty]
#BSCLOCAL	= User flags for Browse File Builder [Empty]
#CCOPT			=	# C++ optimization flags, default lets build config decide
#COPT			=	# C optimization flags, default lets build config decide
#DEPENDLOCAL	= user defined makedepend flags [Empty]
#LINTLOCAL	= User defined lint flags [Empty]
#LOCAL_INCLUDE_DIRS	= User include directories to search for C/C++ headers [Empty]
#LDLOCAL	= User defined C flags for linking [Empty]
#IMPLIBLOCAL	= User flags for Object Lirary Manager [Empty]
#MIDLLOCAL	= User flags for IDL compiler [Empty]
#RSCLOCAL	= User flags for resource compiler [Empty]
#LOCALDEPLIBS	= User libraries to include in dependencies [Empty]
#LOCALLIBS		= User libraries to use when linking [Empty]
#				(in addition to LOCALDEPLIBS)
#LOCAL_LIB_DIRS	= User library directories for libpaths [Empty]
#SUBSYSTEM = Subsystem to build for (none, console or windows) [none]
#					 (Windows Only)
#USEMFC	= How Windows MFC should be used (none, static, shared, no_mfc) [none]
#				(Windows Only)

LOCALDEPLIBS			= 
CLOCAL			= /D "_USRDLL" /D "REGISTER_PROXY_DLL" /D "_WIN32_WINNT=0x400"

CCLOCAL			= $(CLOCAL)

LOCALLIBS			= MYFILE rpcndr rpcns4 rpcrt4 oleaut32
#=============================================================================#

#=============================================================================#
# Rules:
#-----------------------------------------------------------------------------#
# process Sub-directories
include $(TL_DIR)/Makerules/Maketargets.toplevel

# build cmds and libs
include $(TL_DIR)/Makerules/Maketargets.build

LIBS:: $(CMD_TARGETS_PSSHLIB)
$(CMD_TARGETS_PSSHLIB): $(PS_OBJECTS) $(EXP_TARGET) $(RSCOBJECTS) $(DEPLIBS_TARGETS)
	@echo Linking dynamic library...
	$(VS)$(MKSHLIB) $(LDFLAGS)$@ $(PS_OBJECTS) $(EXP_TARGET) $(RSCOBJECT) $(LDLIBS)

# install for includes, libs and cmds phases
include $(TL_DIR)/Makerules/Maketargets.install
CMDS::
	$(VS)$(INSTALL) -d $(PROJ_BIN_DIR)/$(BIN_SUBDIR) $(CMD_TARGETS_PSSHLIB)


# install for stage phase
include $(TL_DIR)/Makerules/Maketargets.stage
STAGE::
	$(VS)$(INSTALL) -d $(PROJ_STAGE_BIN_DIR)/$(BIN_SUBDIR) $(CMD_TARGETS_PSSHLIB)

# Unit test execution
#include $(TL_DIR)/Makerules/Maketargets.runtest

#=============================================================================#

#=============================================================================#
# DO NOT DELETE THIS LINE -- make depend depends on it.
#=============================================================================#