Modest/Makefile.cfg
2017-03-11 22:53:26 +03:00

119 lines
2.7 KiB
INI

MODEST_BUILD_OS := UNDEF
#********************
# Version
#***************
MODEST_VERSION_MAJOR := 1
MODEST_VERSION_MINOR := 0
MODEST_VERSION_PATCH := 0
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
#********************
# Binaries
#***************
# binaries dirs
BINARY_DIR_BASE := bin
# DEFAULT
MODEST_DIR_SEPARATOR ?= /
# names
# This variables used with "call" $(call MODEST_LIBRARY_WITH_VERSION),
# for use actual variables like a LIB_NAME_SUFFIX
MODEST_LIBRARY ?= $(LIB_DIR_BASE)/lib$(LIB_NAME)$(LIB_NAME_SUFFIX)
MODEST_LIBRARY_STATIC ?= $(LIB_DIR_BASE)/lib$(LIB_NAME)$(LIB_NAME_SUFFIX_STATIC)
MODEST_LIBRARY_WITH_VERSION = $(LIB_DIR_BASE)/lib$(LIB_NAME).$(MODEST_VERSION_STRING)$(LIB_NAME_SUFFIX)
MODEST_PORT_NAME ?= posix
# flags
MODEST_OPTIMIZATION_LEVEL ?= -O2
MODEST_CFLAGS += -I$(INCLUDE_DIR)
MODEST_LDFLAGS +=
OS ?= $(shell uname -s)
#*******************************
# Windows_NT
#*******************
ifeq ($(OS),Windows_NT)
LIB_NAME_SUFFIX := .dll
LIB_NAME_SUFFIX_STATIC := .dll.a
MODEST_CFLAGS += -Wno-unused-variable -Wno-unused-function --std=c99
MODEST_LDFLAGS += -Wl,--out-implib,$(call MODEST_LIBRARY_STATIC)
# 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
# build without threads
ifeq ($(MODEST_BUILD_WITHOUT_THREADS),YES)
MODEST_CFLAGS += -DMODEST_BUILD_WITHOUT_THREADS
endif
# 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
# build without threads
ifeq ($(MODEST_BUILD_WITHOUT_THREADS),YES)
MODEST_CFLAGS += -DMODEST_BUILD_WITHOUT_THREADS
else
MODEST_LDFLAGS += -pthread
endif
# Need set
MODEST_BUILD_OS := $(OS)
# this name eq source/myport/<namedir>
MODEST_PORT_NAME := posix
endif
# end of POSIX