Modest/Makefile.cfg

168 lines
5.1 KiB
INI

MODEST_BUILD_OS := UNDEF
#********************
# Version
#***************
MODEST_VERSION_MAJOR := 0
MODEST_VERSION_MINOR := 0
MODEST_VERSION_PATCH := 6
MODEST_VERSION_STRING := $(MODEST_VERSION_MAJOR).$(MODEST_VERSION_MINOR).$(MODEST_VERSION_PATCH)
#********************
# Flags
#***************
MODEST_CFLAGS ?= -Wall -Werror
MODEST_LFLAGS ?=
#********************
# Include
#***************
# include dirs
INCLUDE_DIR := $(TARGET)
INCLUDE_DIR_API := include
#********************
# Libraries
#***************
# lib name
LIB_NAME := modest
LIB_NAME_SUFFIX := .so
LIB_NAME_SUFFIX_STATIC := _static.a
# lib dirs
LIB_DIR_BASE := lib
# This variables used with "call" $(call MODEST_LIBRARY_WITH_VERSION),
# for use actual variables like a LIB_NAME_SUFFIX
MODEST_LIBRARY_NAME ?= lib$(LIB_NAME)$(LIB_NAME_SUFFIX)
MODEST_LIBRARY_NAME_STATIC ?=lib$(LIB_NAME)$(LIB_NAME_SUFFIX_STATIC)
MODEST_LIBRARY_NAME_WITH_VERSION = lib$(LIB_NAME)-$(MODEST_VERSION_STRING)$(LIB_NAME_SUFFIX)
MODEST_LIBRARY ?= $(LIB_DIR_BASE)/$(MODEST_LIBRARY_NAME)
MODEST_LIBRARY_STATIC ?= $(LIB_DIR_BASE)/$(MODEST_LIBRARY_NAME_STATIC)
MODEST_LIBRARY_WITH_VERSION = $(LIB_DIR_BASE)/$(MODEST_LIBRARY_NAME_WITH_VERSION)
MODEST_LIBRARY_WITH_VERSION_MAJOR = $(LIB_DIR_BASE)/lib$(LIB_NAME)-$(MODEST_VERSION_MAJOR)$(LIB_NAME_SUFFIX)
MODEST_LIBRARY_WITH_VERSION_MAJOR_MINOR = $(LIB_DIR_BASE)/lib$(LIB_NAME)-$(MODEST_VERSION_MAJOR).$(MODEST_VERSION_MINOR)$(LIB_NAME_SUFFIX)
#********************
# Binaries
#***************
# binaries dirs
BINARY_DIR_BASE := bin
#********************
# Build
#***************
MODEST_BUILD_SHARED_AFTER :=
MODEST_BUILD_STATIC_AFTER :=
MODEST_BUILD_CLEAN_AFTER :=
#********************
# DEFAULT
#***************
MODEST_DIR_SEPARATOR ?= /
MODEST_PORT_NAME ?= posix
# flags
MODEST_OPTIMIZATION_LEVEL ?= -O2
MODEST_CFLAGS += -I$(INCLUDE_DIR)
MODEST_LDFLAGS +=
OS ?= $(shell uname -s)
#********************
# Set -D
#***************
ifeq ($(MyCORE_BUILD_DEBUG),YES)
MODEST_CFLAGS += -g3 -ggdb3 -O0 -fno-omit-frame-pointer -DMyCORE_BUILD_DEBUG
endif
ifeq ($(MyCORE_BUILD_WITHOUT_THREADS),YES)
MODEST_CFLAGS += -DMyCORE_BUILD_WITHOUT_THREADS
endif
#********************
# Utils
#***************
define MODEST_UTILS_NEW_LINE
endef
#*******************************
# Windows_NT
#*******************
ifeq ($(OS),Windows_NT)
LIB_NAME_SUFFIX := .dll
LIB_NAME_SUFFIX_STATIC := .dll.a
MODEST_LIBRARY_NAME_WITH_VERSION := lib$(LIB_NAME)-$(MODEST_VERSION_MAJOR)$(LIB_NAME_SUFFIX)
MODEST_CFLAGS += -Wno-unused-variable -Wno-unused-function --std=c99
MODEST_LDFLAGS += -Wl,--out-implib,$(call MODEST_LIBRARY_STATIC)
MODEST_BUILD_SHARED_AFTER += cp $(call MODEST_LIBRARY_WITH_VERSION) $(BINARY_DIR_BASE) $(MODEST_UTILS_NEW_LINE)
MODEST_BUILD_CLEAN_AFTER += rm -f $(BINARY_DIR_BASE)/$(call MODEST_LIBRARY_NAME_WITH_VERSION) $(MODEST_UTILS_NEW_LINE)
# Need set
MODEST_BUILD_OS := $(OS)
# this name eq source/myport/<namedir>
MODEST_PORT_NAME := windows_nt
endif
# end of Windows_NT
#*******************************
# Darwin, Mac OS X
#*******************
ifeq ($(OS),Darwin)
MODEST_CFLAGS += -fPIC
MODEST_CFLAGS += $(MODEST_OPTIMIZATION_LEVEL) -Wno-unused-variable -Wno-unused-function --std=c99
LIB_NAME_SUFFIX := .dylib
MODEST_BUILD_SHARED_AFTER += ln -s $(call MODEST_LIBRARY_WITH_VERSION) $(call MODEST_LIBRARY) $(MODEST_UTILS_NEW_LINE)
MODEST_BUILD_SHARED_AFTER += ln -s $(call MODEST_LIBRARY_WITH_VERSION) $(call MODEST_LIBRARY_WITH_VERSION_MAJOR) $(MODEST_UTILS_NEW_LINE)
MODEST_BUILD_SHARED_AFTER += ln -s $(call MODEST_LIBRARY_WITH_VERSION) $(call MODEST_LIBRARY_WITH_VERSION_MAJOR_MINOR) $(MODEST_UTILS_NEW_LINE)
MODEST_BUILD_CLEAN_AFTER += rm -f $(call MODEST_LIBRARY) $(MODEST_UTILS_NEW_LINE)
MODEST_BUILD_CLEAN_AFTER += rm -f $(call MODEST_LIBRARY_WITH_VERSION_MAJOR) $(MODEST_UTILS_NEW_LINE)
MODEST_BUILD_CLEAN_AFTER += rm -f $(call MODEST_LIBRARY_WITH_VERSION_MAJOR_MINOR) $(MODEST_UTILS_NEW_LINE)
# Need set
MODEST_BUILD_OS := $(OS)
# this name eq source/myport/<namedir>
MODEST_PORT_NAME := posix
endif
# end of Darwin, Mac OS X
#*******************************
# POSIX
#*******************
ifeq ($(MODEST_BUILD_OS),UNDEF)
MODEST_CFLAGS += -fPIC
MODEST_CFLAGS += -D_POSIX_C_SOURCE=199309L
MODEST_CFLAGS += $(MODEST_OPTIMIZATION_LEVEL) -Wno-unused-variable -Wno-unused-function --std=c99
MODEST_BUILD_SHARED_AFTER += ln -s $(call MODEST_LIBRARY_WITH_VERSION) $(call MODEST_LIBRARY) $(MODEST_UTILS_NEW_LINE)
MODEST_BUILD_SHARED_AFTER += ln -s $(call MODEST_LIBRARY_WITH_VERSION) $(call MODEST_LIBRARY_WITH_VERSION_MAJOR) $(MODEST_UTILS_NEW_LINE)
MODEST_BUILD_SHARED_AFTER += ln -s $(call MODEST_LIBRARY_WITH_VERSION) $(call MODEST_LIBRARY_WITH_VERSION_MAJOR_MINOR) $(MODEST_UTILS_NEW_LINE)
MODEST_BUILD_CLEAN_AFTER += rm -f $(call MODEST_LIBRARY) $(MODEST_UTILS_NEW_LINE)
MODEST_BUILD_CLEAN_AFTER += rm -f $(call MODEST_LIBRARY_WITH_VERSION_MAJOR) $(MODEST_UTILS_NEW_LINE)
MODEST_BUILD_CLEAN_AFTER += rm -f $(call MODEST_LIBRARY_WITH_VERSION_MAJOR_MINOR) $(MODEST_UTILS_NEW_LINE)
# build without threads
ifneq ($(MyCORE_BUILD_WITHOUT_THREADS),YES)
MODEST_LDFLAGS += -pthread
endif
# Need set
MODEST_BUILD_OS := $(OS)
# this name eq source/myport/<namedir>
MODEST_PORT_NAME := posix
endif
# end of POSIX