# $Id: Config.kmk 738 2006-12-17 06:01:46Z bird $ ## @file # # Build Configuration. # # Copyright (c) 2005-2006 knut st. osmundsen # # # This file is part of kBuild. # # kBuild is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # kBuild is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with kBuild; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # # Enable automatic installation of what's built. KBUILD_DO_AUTO_INSTALL := 1 # # The kBuild version. # KBUILD_VERSION_MAJOR = 0 KBUILD_VERSION_MINOR = 1 KBUILD_VERSION_PATCH = 0 KBUILD_VERSION = "0.1.0" DEFS += \ KBUILD_VERSION_MAJOR=$(KBUILD_VERSION_MAJOR) \ KBUILD_VERSION_MINOR=$(KBUILD_VERSION_MINOR) \ KBUILD_VERSION_PATCH=$(KBUILD_VERSION_PATCH) # # Check if we're building a *nix installation. # ifdef NIX_INSTALL_DIR NIX_INSTALL_DIR_BIN := $(patsubst /%,%,$(NIX_INSTALL_DIR))/bin NIX_INSTALL_DIR_SHARE := $(patsubst /%,%,$(NIX_INSTALL_DIR))/share/kBuild DEFS += \ PATH_KBUILD=\"/$(NIX_INSTALL_DIR_SHARE)\" \ PATH_KBUILD_BIN=\"/$(NIX_INSTALL_DIR_BIN)\" endif # # Template for building commandline tools. # TEMPLATE_BIN = Commandline binary TEMPLATE_BIN_INCS = $(PATH_ROOT)/src/lib ifeq ($(BUILD_TARGET),os2) TEMPLATE_BIN_TOOL = GCC3OMF TEMPLATE_BIN_CFLAGS.profile = -pg TEMPLATE_BIN_CFLAGS.release = -O3 TEMPLATE_BIN_LDFLAGS = -Zhigh-mem -Zstack=1024 ifdef NIX_INSTALL_DIR TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/ else TEMPLATE_BIN_INST = kBuild/bin/os2.x86/ endif endif ifeq ($(BUILD_TARGET),darwin) TEMPLATE_BIN_TOOL = GCC4MACHO TEMPLATE_BIN_CFLAGS.profile = TEMPLATE_BIN_CFLAGS.release = -O3 TEMPLATE_BIN_LDFLAGS = ifdef NIX_INSTALL_DIR TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/ else TEMPLATE_BIN_INST = kBuild/bin/$(BUILD_TARGET).$(BUILD_TARGET_ARCH)/ endif endif ifeq ($(filter-out win nt,$(BUILD_TARGET)),) include $(PATH_KBUILD)/tools/VCC70.kmk # fixme! template expanding does something bad to _LIBS /me thinks. TEMPLATE_BIN_TOOL = VCC70 TEMPLATE_BIN_DEFS = WINDOWS32 _CONSOLE WIN32 __WIN32__ TEMPLATE_BIN_DEFS.release = NDEBUG TEMPLATE_BIN_SDKS = WINPSDK TEMPLATE_BIN_CFLAGS = -MT -W3 -Zi -Zl TEMPLATE_BIN_CFLAGS.release = -O2 TEMPLATE_BIN_CFLAGS.profile = -O2 -GH -Gh TEMPLATE_BIN_INCS += \ . \ $(PATH_ROOT)/src/gmake/w32/include \ $(PATH_ROOT)/src/gmake/glob TEMPLATE_BIN_LDFLAGS = /SUBSYSTEM:console /INCREMENTAL:no /NOD /DEBUG TEMPLATE_BIN_LIBS = \ $(PATH_TOOL_VCC70_LIB)/oldnames.lib \ $(PATH_TOOL_VCC70_LIB)/libcmt.lib \ $(PATH_TOOL_VCC70_LIB)/libcpmt.lib TEMPLATE_BIN_LIBS.profile = g:/coding/vbox/trunk/out/win32/debug/lib/kPrf2.lib ifdef NIX_INSTALL_DIR TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/ else TEMPLATE_BIN_INST = kBuild/bin/win.$(BUILD_TARGET_ARCH)/ endif endif ifndef TEMPLATE_BIN_TOOL TEMPLATE_BIN_TOOL = GCC3 TEMPLATE_BIN_CFLAGS.release = -O3 ifeq ($(BUILD_TARGET),linux) TEMPLATE_BIN_LDFLAGS = -static TEMPLATE_BIN_LIBS += rt endif ifeq ($(BUILD_TARGET),freebsd) TEMPLATE_BIN_LIBS += iconv intl TEMPLATE_BIN_LIBPATH += /usr/local/lib TEMPLATE_BIN_INCS += $(PATH_ROOT)/src/gmake/glob /usr/local/include endif ifdef NIX_INSTALL_DIR TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/ else TEMPLATE_BIN_INST = kBuild/bin/$(BUILD_TARGET).$(BUILD_TARGET_ARCH)/ endif endif # # Template for building libraries for the tools. # TEMPLATE_LIB = Library for Commandline binary TEMPLATE_LIB_EXTENDS = BIN TEMPLATE_LIB_INST = lib/ # for LIB_KDEP TEMPLATE_LIB_TOOL = $(TEMPLATE_BIN_TOOL) LIB_KDEP = $(PATH_OBJ)/src/lib/kDep/$(TOOL_$(TEMPLATE_LIB_TOOL)_ARLIBPREF)kDep$(TOOL_$(TEMPLATE_LIB_TOOL)_ARLIBSUFF)