source: trunk/Config.kmk@ 989

Last change on this file since 989 was 952, checked in by bird, 18 years ago

The GNU make source has moved to src/kmk.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.3 KB
RevLine 
[270]1# $Id: Config.kmk 952 2007-05-27 11:37:24Z bird $
2## @file
3#
4# Build Configuration.
5#
[785]6# Copyright (c) 2005-2007 knut st. osmundsen <bird-kBuild-spam@anduin.net>
[270]7#
8#
9# This file is part of kBuild.
10#
11# kBuild is free software; you can redistribute it and/or modify
12# it under the terms of the GNU General Public License as published by
13# the Free Software Foundation; either version 2 of the License, or
14# (at your option) any later version.
15#
16# kBuild is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with kBuild; if not, write to the Free Software
23# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24#
25#
26
[467]27# Enable automatic installation of what's built.
28KBUILD_DO_AUTO_INSTALL := 1
[576]29
30
31#
32# The kBuild version.
33#
34KBUILD_VERSION_MAJOR = 0
35KBUILD_VERSION_MINOR = 1
36KBUILD_VERSION_PATCH = 0
37KBUILD_VERSION = "0.1.0"
38DEFS += \
39 KBUILD_VERSION_MAJOR=$(KBUILD_VERSION_MAJOR) \
40 KBUILD_VERSION_MINOR=$(KBUILD_VERSION_MINOR) \
41 KBUILD_VERSION_PATCH=$(KBUILD_VERSION_PATCH)
[587]42
43#
44# Check if we're building a *nix installation.
45#
46ifdef NIX_INSTALL_DIR
[590]47NIX_INSTALL_DIR_BIN := $(patsubst /%,%,$(NIX_INSTALL_DIR))/bin
48NIX_INSTALL_DIR_SHARE := $(patsubst /%,%,$(NIX_INSTALL_DIR))/share/kBuild
[587]49DEFS += \
[590]50 PATH_KBUILD=\"/$(NIX_INSTALL_DIR_SHARE)\" \
[587]51 PATH_KBUILD_BIN=\"/$(NIX_INSTALL_DIR_BIN)\"
52endif
[766]53
[270]54#
[906]55# Where to fine the GNU Make stuff (for FreeBSD and Windows).
56#
[952]57PATH_GNUMAKE_SRC ?= $(PATH_ROOT)/src/kmk
[906]58
59
60#
[270]61# Template for building commandline tools.
[766]62#
[270]63TEMPLATE_BIN = Commandline binary
64
[400]65TEMPLATE_BIN_INCS = $(PATH_ROOT)/src/lib
66
[270]67ifeq ($(BUILD_TARGET),os2)
68TEMPLATE_BIN_TOOL = GCC3OMF
[427]69TEMPLATE_BIN_CFLAGS.profile = -pg
[270]70TEMPLATE_BIN_CFLAGS.release = -O3
71TEMPLATE_BIN_LDFLAGS = -Zhigh-mem -Zstack=1024
[587]72 ifdef NIX_INSTALL_DIR
73TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
74 else
[731]75TEMPLATE_BIN_INST = kBuild/bin/os2.x86/
[587]76 endif
[270]77endif
78
[557]79ifeq ($(BUILD_TARGET),darwin)
[565]80TEMPLATE_BIN_TOOL = GCC4MACHO
[557]81TEMPLATE_BIN_CFLAGS.profile =
82TEMPLATE_BIN_CFLAGS.release = -O3
[766]83TEMPLATE_BIN_LDFLAGS =
[587]84 ifdef NIX_INSTALL_DIR
85TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
86 else
[731]87TEMPLATE_BIN_INST = kBuild/bin/$(BUILD_TARGET).$(BUILD_TARGET_ARCH)/
[587]88 endif
[557]89endif
90
[731]91ifeq ($(filter-out win nt,$(BUILD_TARGET)),)
[861]92 ifeq ($(BUILD_TARGET_ARCH),x86)
93 include $(PATH_KBUILD)/tools/VCC70.kmk # fixme! template expanding does something bad to _LIBS /me thinks.
94 TEMPLATE_BIN_TOOL = VCC70
95 TEMPLATE_BIN_DEFS = WINDOWS32 _CONSOLE __WIN__ WIN32 __WIN32__
96 else ifeq ($(BUILD_TARGET_ARCH),amd64)
97 TEMPLATE_BIN_TOOL = VCC80AMD64
98 TEMPLATE_BIN_DEFS = WINDOWS32 _CONSOLE __WIN__ WIN32 __WIN32__ __WIN64__ WIN64 _CRT_SECURE_NO_DEPRECATE
99 endif
[809]100 TEMPLATE_BIN_DEFS.release = NDEBUG
101 TEMPLATE_BIN_SDKS = WINPSDK
102 TEMPLATE_BIN_CFLAGS = -W3 -Zi -Zl
103 TEMPLATE_BIN_CFLAGS.release = -O2
104 TEMPLATE_BIN_CFLAGS.profile = -O2 -GH -Gh
105 TEMPLATE_BIN_INCS += \
[270]106 . \
[906]107 $(PATH_GNUMAKE_SRC)/w32/include \
108 $(PATH_GNUMAKE_SRC)/glob
[809]109 TEMPLATE_BIN_LDFLAGS = /SUBSYSTEM:console /INCREMENTAL:no /NOD /DEBUG
110 ifeq (1,0)
111 TEMPLATE_BIN_CFLAGS += -MT
112 TEMPLATE_BIN_LIBS = \
[861]113 $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/oldnames.lib \
114 $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/libcmt.lib \
115 $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/libcpmt.lib
[809]116 else
117 TEMPLATE_BIN_CFLAGS += -MD
118 TEMPLATE_BIN_LIBS = \
[861]119 $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/oldnames.lib \
120 $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/msvcrt.lib
121 # $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/msvcprt.lib - avoid this to save space!
[809]122 endif
123 TEMPLATE_BIN_LIBS.profile = g:/coding/vbox/trunk/out/win32/debug/lib/kPrf2.lib
[587]124 ifdef NIX_INSTALL_DIR
[809]125 TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
[587]126 else
[809]127 TEMPLATE_BIN_INST = kBuild/bin/win.$(BUILD_TARGET_ARCH)/
[587]128 endif
[270]129endif
130
131ifndef TEMPLATE_BIN_TOOL
[826]132 # Use GCC3 when we're certain that the system is using GNU ld and ar.
133 ifeq ($(filter-out linux freebsd openbsd netbsd,$(BUILD_TARGET)),)
134 TEMPLATE_BIN_TOOL = GCC3
135 else
136 TEMPLATE_BIN_TOOL = GCC3PLAIN
137 endif
[810]138 TEMPLATE_BIN_CFLAGS.release = -O3
[809]139 ifeq ($(BUILD_TARGET),freebsd)
[810]140 TEMPLATE_BIN_LIBS += iconv intl
141 TEMPLATE_BIN_LIBPATH += /usr/local/lib
[906]142 TEMPLATE_BIN_INCS += $(PATH_GNUMAKE_SRC)/glob /usr/local/include
[809]143 endif
144 ifeq ($(BUILD_TARGET),linux)
[810]145 TEMPLATE_BIN_LIBS += rt
146 endif
[809]147 ifeq ($(BUILD_TARGET),solaris)
[810]148 TEMPLATE_BIN_LIBS += rt
[869]149 TEMPLATE_BIN_LDFLAGS += -Wl,-i
[809]150 endif
[587]151 ifdef NIX_INSTALL_DIR
[810]152 TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
[587]153 else
[810]154 TEMPLATE_BIN_INST = kBuild/bin/$(BUILD_TARGET).$(BUILD_TARGET_ARCH)/
[587]155 endif
[270]156endif
157
[393]158#
159# Template for building libraries for the tools.
160#
161TEMPLATE_LIB = Library for Commandline binary
[557]162TEMPLATE_LIB_EXTENDS = BIN
163TEMPLATE_LIB_INST = lib/
164# for LIB_KDEP
165TEMPLATE_LIB_TOOL = $(TEMPLATE_BIN_TOOL)
[393]166
167
[587]168LIB_KDEP = $(PATH_OBJ)/src/lib/kDep/$(TOOL_$(TEMPLATE_LIB_TOOL)_ARLIBPREF)kDep$(TOOL_$(TEMPLATE_LIB_TOOL)_ARLIBSUFF)
[393]169
Note: See TracBrowser for help on using the repository browser.