| # Copyright 2010 by Nest Labs, Inc. All rights reserved. |
| # |
| # This program is confidential and proprietary to Nest Labs, Inc., |
| # and may not be reproduced, published or disclosed to others without |
| # company authorization. |
| # |
| |
| # the setup below is for gcc on a unix-like platform. |
| |
| BUILD_DIR ?= $(DEPTH).build |
| OBJ_DIR = $(BUILD_DIR)/objs |
| LIB_DIR = $(BUILD_DIR)/lib |
| BIN_DIR = $(BUILD_DIR)/bin |
| |
| OS_ARCH := $(shell uname -s | sed -e 's|/|_|g') |
| |
| ifeq ($(OS_ARCH),Darwin) |
| CC = @echo $@; gcc -Os -DNL_DARWIN |
| OPT_INCLUDE = /opt/local/include |
| OPT_LIB = /opt/local/lib |
| else |
| CC = @echo $@; gcc -DNL_LINUX -Os |
| OPT_INCLUDE = /usr/local/include |
| OPT_LIB = /usr/local/lib -L/usr/lib |
| endif |
| |
| #LINK = @echo $@; g++ -dead_strip |
| LINK = echo $@;gcc -Wl,--gc-sections |
| |
| ARCHIVE = @echo $@; ar -rucs |
| |
| RANLIB = ranlib |
| |
| #MAKE = make -s |
| |
| RM = rm -rf |
| |
| MKDIR = mkdir -p |
| |
| CP = cp |
| |
| WFLAGS = \ |
| -Wunused \ |
| -Wimplicit \ |
| -Wreturn-type \ |
| -Wparentheses \ |
| -Wformat \ |
| -Wchar-subscripts \ |
| -Wno-c++-compat \ |
| -Wsequence-point |
| |
| # -Wmissing-prototypes \ |
| # -pedantic \ |
| |
| CFLAGS = $(CPPFLAGS) \ |
| $(WFLAGS) \ |
| -ffunction-sections \ |
| -fdata-sections \ |
| -c \ |
| -g \ |
| $(DEFINES) \ |
| -I ./ \ |
| -I $(DEPTH) \ |
| -I $(OPT_INCLUDE) \ |
| -I $(DEPTH)include \ |
| -I $(DEPTH)openssl \ |
| -I $(DEPTH)polarssl \ |
| -I include \ |
| $(INCLUDES) |
| |
| LIBS = -L$(LIB_DIR) \ |
| -L$(OPT_LIB) \ |
| |