# $Id: Config.kmk 952 2007-05-27 11:37:24Z bird $ ## @file # # Build Configuration. # # Copyright (c) 2005-2007 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 # # Where to fine the GNU Make stuff (for FreeBSD and Windows). # PATH_GNUMAKE_SRC ?= $(PATH_ROOT)/src/kmk # # 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)),) ifeq ($(BUILD_TARGET_ARCH),x86) 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 __WIN__ WIN32 __WIN32__ else ifeq ($(BUILD_TARGET_ARCH),amd64) TEMPLATE_BIN_TOOL = VCC80AMD64 TEMPLATE_BIN_DEFS = WINDOWS32 _CONSOLE __WIN__ WIN32 __WIN32__ __WIN64__ WIN64 _CRT_SECURE_NO_DEPRECATE endif TEMPLATE_BIN_DEFS.release = NDEBUG TEMPLATE_BIN_SDKS = WINPSDK TEMPLATE_BIN_CFLAGS = -W3 -Zi -Zl TEMPLATE_BIN_CFLAGS.release = -O2 TEMPLATE_BIN_CFLAGS.profile = -O2 -GH -Gh TEMPLATE_BIN_INCS += \ . \ $(PATH_GNUMAKE_SRC)/w32/include \ $(PATH_GNUMAKE_SRC)/glob TEMPLATE_BIN_LDFLAGS = /SUBSYSTEM:console /INCREMENTAL:no /NOD /DEBUG ifeq (1,0) TEMPLATE_BIN_CFLAGS += -MT TEMPLATE_BIN_LIBS = \ $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/oldnames.lib \ $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/libcmt.lib \ $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/libcpmt.lib else TEMPLATE_BIN_CFLAGS += -MD TEMPLATE_BIN_LIBS = \ $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/oldnames.lib \ $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/msvcrt.lib # $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/msvcprt.lib - avoid this to save space! endif 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 # Use GCC3 when we're certain that the system is using GNU ld and ar. ifeq ($(filter-out linux freebsd openbsd netbsd,$(BUILD_TARGET)),) TEMPLATE_BIN_TOOL = GCC3 else TEMPLATE_BIN_TOOL = GCC3PLAIN endif TEMPLATE_BIN_CFLAGS.release = -O3 ifeq ($(BUILD_TARGET),freebsd) TEMPLATE_BIN_LIBS += iconv intl TEMPLATE_BIN_LIBPATH += /usr/local/lib TEMPLATE_BIN_INCS += $(PATH_GNUMAKE_SRC)/glob /usr/local/include endif ifeq ($(BUILD_TARGET),linux) TEMPLATE_BIN_LIBS += rt endif ifeq ($(BUILD_TARGET),solaris) TEMPLATE_BIN_LIBS += rt TEMPLATE_BIN_LDFLAGS += -Wl,-i 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)