From ba4e280e45d8f8b1d7bbd01d046122a6fb2b9f42 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Sun, 18 Jan 2009 21:40:24 +0100 Subject: [PATCH] Added definition of important variables from old rules --- snippets/Makefile.rules.test | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/snippets/Makefile.rules.test b/snippets/Makefile.rules.test index c5b684a..f058504 100644 --- a/snippets/Makefile.rules.test +++ b/snippets/Makefile.rules.test @@ -26,6 +26,43 @@ KERN_OBJS_DIR = $(KERN_BUILD_DIR)$(RELATIVE_DIR:%=/%) # Programs # ############ +ifeq ($(BUILD_OS),) + # Check for target + ifeq ($(OS),Windows_NT) + BUILD_OS := win32 + else + BUILD_OS := $(shell uname | tr '[A-Z]' '[a-z]' ) + #$(warning BUILD_OS=$(BUILD_OS)) + endif +endif + +ifeq ($(TARGET_OS),) + TARGET_OS := $(BUILD_OS) +endif + +export TARGET_OS +export BUILD_OS + +# Assign default values to CFLAGS variable. If the variable is defined +# earlier (i.g. in config.omk), it is not overriden here. +CFLAGS ?= -O2 -Wall +CXXFLAGS ?= -O2 -Wall + + +CPPFLAGS += -I $(USER_INCLUDE_DIR) +LOADLIBES += -L$(USER_LIB_DIR) +LOADLIBES += $(lib_LOADLIBES:%=-l%) + +LIB_CPPFLAGS += $(CPPFLAGS) +LIB_CFLAGS += $(CFLAGS) + +ifeq ($(TARGET_OS),win32) + SOLIB_EXT = dll +else + SOLIB_EXT = so + SOLIB_PICFLAGS += -fpic +endif + # Check GCC version for user build ifndef CC_MAJOR_VERSION CC_MAJOR_VERSION := $(shell $(CC) -dumpversion | sed -e 's/\([^.]\)\..*/\1/') -- 2.39.2