VirtualBox

source: kBuild/trunk/Config.kmk@ 1466

Last change on this file since 1466 was 1460, checked in by bird, 17 years ago

0.1.3

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.0 KB
Line 
1# $Id: Config.kmk 1460 2008-03-31 09:46:26Z bird $
2## @file
3#
4# Build Configuration.
5#
6# Copyright (c) 2005-2007 knut st. osmundsen <[email protected]>
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
27# Enable automatic installation of what's built.
28KBUILD_DO_AUTO_INSTALL := 1
29
30
31#
32# The kBuild version.
33#
34KBUILD_VERSION_MAJOR = 0
35KBUILD_VERSION_MINOR = 1
36KBUILD_VERSION_PATCH = 3
37KBUILD_VERSION = "0.1.3"
38DEFS += \
39 KBUILD_VERSION_MAJOR=$(KBUILD_VERSION_MAJOR) \
40 KBUILD_VERSION_MINOR=$(KBUILD_VERSION_MINOR) \
41 KBUILD_VERSION_PATCH=$(KBUILD_VERSION_PATCH)
42
43#
44# The OS and Architecture indicators.
45#
46DEFS.darwin += KBUILD_OS_DARWIN
47DEFS.freebsd += KBUILD_OS_FREEBSD
48DEFS.linux += KBUILD_OS_LINUX
49DEFS.netbsd += KBUILD_OS_NETBSD
50DEFS.openbsd += KBUILD_OS_OPENBSD
51DEFS.os2 += KBUILD_OS_OS2
52DEFS.solaris += KBUILD_OS_SOLARIS
53DEFS.win += KBUILD_OS_WINDOWS
54
55DEFS.x86 += KBUILD_ARCH_X86
56DEFS.amd64 += KBUILD_ARCH_AMD64
57
58
59#
60# Check if we're building a *nix installation.
61#
62ifdef NIX_INSTALL_DIR
63NIX_INSTALL_DIR_BIN := $(patsubst /%,%,$(NIX_INSTALL_DIR))/bin
64NIX_INSTALL_DIR_SHARE := $(patsubst /%,%,$(NIX_INSTALL_DIR))/share/kBuild
65DEFS += \
66 PATH_KBUILD=\"/$(NIX_INSTALL_DIR_SHARE)\" \
67 PATH_KBUILD_BIN=\"/$(NIX_INSTALL_DIR_BIN)\"
68endif
69
70#
71# Where to fine the GNU Make stuff (for FreeBSD and Windows).
72#
73PATH_GNUMAKE_SRC ?= $(PATH_ROOT)/src/kmk
74
75
76#
77# Template for building commandline tools.
78#
79TEMPLATE_BIN = Commandline binary
80
81TEMPLATE_BIN_INCS = $(PATH_ROOT)/src/lib
82
83ifeq ($(BUILD_TARGET),os2)
84TEMPLATE_BIN_TOOL = GCC3OMF
85TEMPLATE_BIN_CFLAGS.profile = -pg
86TEMPLATE_BIN_CFLAGS.release = -O3
87TEMPLATE_BIN_LDFLAGS = -Zhigh-mem -Zstack=1024
88 ifdef NIX_INSTALL_DIR
89TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
90 else
91TEMPLATE_BIN_INST = kBuild/bin/os2.x86/
92 endif
93endif
94
95ifeq ($(BUILD_TARGET),darwin)
96TEMPLATE_BIN_TOOL = GCC4MACHO
97TEMPLATE_BIN_CFLAGS.profile =
98TEMPLATE_BIN_CFLAGS.release = -O3
99TEMPLATE_BIN_LDFLAGS =
100 ifdef NIX_INSTALL_DIR
101TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
102 else
103TEMPLATE_BIN_INST = kBuild/bin/$(BUILD_TARGET).$(BUILD_TARGET_ARCH)/
104 endif
105endif
106
107ifeq ($(filter-out win nt,$(BUILD_TARGET)),)
108 ifeq ($(BUILD_TARGET_ARCH),x86)
109 include $(PATH_KBUILD)/tools/VCC70.kmk # fixme! template expanding does something bad to _LIBS /me thinks.
110 TEMPLATE_BIN_TOOL = VCC70
111 TEMPLATE_BIN_DEFS = WINDOWS32 _CONSOLE __WIN__ WIN32 __WIN32__
112 else ifeq ($(BUILD_TARGET_ARCH),amd64)
113 TEMPLATE_BIN_TOOL = VCC80AMD64
114 TEMPLATE_BIN_DEFS = WINDOWS32 _CONSOLE __WIN__ WIN32 __WIN32__ __WIN64__ WIN64 \
115 _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_WARNINGS
116 endif
117 TEMPLATE_BIN_DEFS.release = NDEBUG
118 TEMPLATE_BIN_SDKS = WINPSDK
119 TEMPLATE_BIN_CFLAGS = -W3 -Zi -Zl
120 TEMPLATE_BIN_CFLAGS.release = -O2
121 TEMPLATE_BIN_CFLAGS.profile = -O2 -GH -Gh
122 TEMPLATE_BIN_INCS += \
123 . \
124 $(PATH_GNUMAKE_SRC)/w32/include \
125 $(PATH_GNUMAKE_SRC)/glob
126 TEMPLATE_BIN_LDFLAGS = /SUBSYSTEM:console /INCREMENTAL:no /NOD /DEBUG
127 ifeq (1,0)
128 TEMPLATE_BIN_CFLAGS += -MT
129 TEMPLATE_BIN_LIBS = \
130 $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/oldnames.lib \
131 $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/libcmt.lib \
132 $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/libcpmt.lib
133 else
134 TEMPLATE_BIN_CFLAGS += -MD
135 TEMPLATE_BIN_LIBS = \
136 $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/oldnames.lib \
137 $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/msvcrt.lib
138 # $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/msvcprt.lib - avoid this to save space!
139 endif
140 TEMPLATE_BIN_LIBS.profile = Y:/coding/libc/svn/trunk/out/win.$(BUILD_TARGET_ARCH)/debug/kStuff/lib/kPrf2.lib
141 ifdef NIX_INSTALL_DIR
142 TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
143 else
144 TEMPLATE_BIN_INST = kBuild/bin/win.$(BUILD_TARGET_ARCH)/
145 endif
146endif
147
148ifndef TEMPLATE_BIN_TOOL
149 # Use GCC3 when we're certain that the system is using GNU ld and ar.
150 ifeq ($(filter-out linux freebsd openbsd netbsd,$(BUILD_TARGET)),)
151 TEMPLATE_BIN_TOOL = GCC3
152 else
153 TEMPLATE_BIN_TOOL = GCC3PLAIN
154 endif
155 TEMPLATE_BIN_CFLAGS.release = -O3
156 ifeq ($(BUILD_TARGET),freebsd)
157 TEMPLATE_BIN_INCS += $(PATH_GNUMAKE_SRC)/glob /usr/local/include
158 endif
159 ifeq ($(BUILD_TARGET),linux)
160 TEMPLATE_BIN_LIBS += rt
161 endif
162 ifeq ($(BUILD_TARGET),solaris)
163 TEMPLATE_BIN_CFLAGS.x86 += -m32
164 TEMPLATE_BIN_CFLAGS.amd64 += -m64
165 TEMPLATE_BIN_CXXFLAGS.x86 += -m32
166 TEMPLATE_BIN_CXXFLAGS.amd64 += -m64
167 TEMPLATE_BIN_LDFLAGS.x86 += -m32
168 TEMPLATE_BIN_LDFLAGS.amd64 += -m64
169 TEMPLATE_BIN_LIBS += rt
170 TEMPLATE_BIN_LDFLAGS += -Wl,-i
171 endif
172 ifdef NIX_INSTALL_DIR
173 TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
174 else
175 TEMPLATE_BIN_INST = kBuild/bin/$(BUILD_TARGET).$(BUILD_TARGET_ARCH)/
176 endif
177endif
178
179#
180# Template for building libraries for the tools.
181#
182TEMPLATE_LIB = Library for Commandline binary
183TEMPLATE_LIB_EXTENDS = BIN
184TEMPLATE_LIB_INST = lib/
185# for LIB_KDEP
186TEMPLATE_LIB_TOOL = $(TEMPLATE_BIN_TOOL)
187
188
189LIB_KDEP = $(PATH_OBJ)/src/lib/kDep/$(TOOL_$(TEMPLATE_LIB_TOOL)_ARLIBPREF)kDep$(TOOL_$(TEMPLATE_LIB_TOOL)_ARLIBSUFF)
190LIB_KUTIL = $(PATH_OBJ)/src/lib/kUtil/$(TOOL_$(TEMPLATE_LIB_TOOL)_ARLIBPREF)kUtil$(TOOL_$(TEMPLATE_LIB_TOOL)_ARLIBSUFF)
191
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette