Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Makefile examples

This example shows a makefile for a project that contains two subprojects: projectOne and projectTwo.

The following is the main project makefile:

###############################################################################
#        Copyright ©) 2010 QUALCOMM Incorporated.
#               All Rights Reserved.
#            QUALCOMM Confidential and Proprietary
###############################################################################

__updirs=$(if $(1),$(call __updirs,$(patsubst %/,%,$(1:..=))) $(1))
DEFINES_MIN=$(firstword \
               $(wildcard $(addsuffix /make.d/defines.min, .\
                  $(call __updirs,../../../../../../../../../../../../../..))))

include $(DEFINES_MIN)
 
BUILD_SUBDIRS = projectOne projectTwo

include $(RULES_MIN)

The following is the makefile for projectOne:

###############################################################################
#        Copyright ©) 2010 QUALCOMM Incorporated.
#               All Rights Reserved.
#            QUALCOMM Confidential and Proprietary
###############################################################################

__updirs=$(if $(1),$(call __updirs,$(patsubst %/,%,$(1:..=))) $(1))
DEFINES_MIN=$(firstword \
               $(wildcard $(addsuffix /make.d/defines.min, .\
                  $(call __updirs,../../../../../../../../../../../../../..))))

include $(DEFINES_MIN)

BUILD_MODS = projectOne

projectOne_C_SRCS = file1 file2

projectOne_INCDIRS= \
    $(SYSTEM_DIR)/inc \
  $(SECURITY_DIR)/inc \
  $(MEDIA_DIR)/inc \
  $(NETWORKING_DIR)/inc \
  $(TELEPHONY_DIR)/inc \
  $(UI_DIR)/inc \
  $(DEPRECATED_DIR)/inc

include $(RULES_MIN)

The makefile is similar for projectTwo.

Makefile .cpp example

This example shows a makefile for a project that contains .cpp files.

The following is the makefile for CPPproject.

###############################################################################
#        Copyright ©) 2010 QUALCOMM Incorporated.
#               All Rights Reserved.
#            QUALCOMM Confidential and Proprietary
###############################################################################

__updirs=$(if $(1),$(call __updirs,$(patsubst %/,%,$(1:..=))) $(1)) DEFINES_MIN=$(firstword \
               $(wildcard $(addsuffix /make.d/defines.min, .\
                  $(call __updirs,../../../../../../../../../../../../../..))))

include $(DEFINES_MIN)

BUILD_MODS = CPPproject

CPPproject_CPP_SRCS = file1 file2

# uncomment these if CPPproject has exceptions or STL used and the variant selected is armgcc.           
#CPPproject_C_SRCS +=      
#    glibc_stubs \
#    mod_malloc

# uncomment these if CPPproject has exceptions or STL used and the variant selected is RVCT.           
#CPPproject_C_SRCS +=      
#    mod_malloc

CPPproject_INCDIRS= \
    $(SYSTEM_DIR)/inc \
  $(SECURITY_DIR)/inc \
  $(MEDIA_DIR)/inc \
  $(NETWORKING_DIR)/inc \
  $(TELEPHONY_DIR)/inc \
  $(UI_DIR)/inc \
  $(DEPRECATED_DIR)/inc

# uncomment these if CPPproject is referring to  glibc_stubs.c or mod_malloc.c.
#VPATH += $(BREWMP_PLATFORM_DIR)/system/src/  

include $(RULES_MIN)