VirtualBox

source: kBuild/trunk/Config.kmk@ 1200

Last change on this file since 1200 was 1182, checked in by bird, 17 years ago

0.1.1

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.4 KB
Line 
1# $Id: Config.kmk 1182 2007-10-05 20:41:37Z 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 = 1
37KBUILD_VERSION = "0.1.1"
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# Check if we're building a *nix installation.
45#
46ifdef NIX_INSTALL_DIR
47NIX_INSTALL_DIR_BIN := $(patsubst /%,%,$(NIX_INSTALL_DIR))/bin
48NIX_INSTALL_DIR_SHARE := $(patsubst /%,%,$(NIX_INSTALL_DIR))/share/kBuild
49DEFS += \
50 PATH_KBUILD=\"/$(NIX_INSTALL_DIR_SHARE)\" \
51 PATH_KBUILD_BIN=\"/$(NIX_INSTALL_DIR_BIN)\"
52endif
53
54#
55# Where to fine the GNU Make stuff (for FreeBSD and Windows).
56#
57PATH_GNUMAKE_SRC ?= $(PATH_ROOT)/src/kmk
58
59
60#
61# Template for building commandline tools.
62#
63TEMPLATE_BIN = Commandline binary
64
65TEMPLATE_BIN_INCS = $(PATH_ROOT)/src/lib
66
67ifeq ($(BUILD_TARGET),os2)
68TEMPLATE_BIN_TOOL = GCC3OMF
69TEMPLATE_BIN_CFLAGS.profile = -pg
70TEMPLATE_BIN_CFLAGS.release = -O3
71TEMPLATE_BIN_LDFLAGS = -Zhigh-mem -Zstack=1024
72 ifdef NIX_INSTALL_DIR
73TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
74 else
75TEMPLATE_BIN_INST = kBuild/bin/os2.x86/
76 endif
77endif
78
79ifeq ($(BUILD_TARGET),darwin)
80TEMPLATE_BIN_TOOL = GCC4MACHO
81TEMPLATE_BIN_CFLAGS.profile =
82TEMPLATE_BIN_CFLAGS.release = -O3
83TEMPLATE_BIN_LDFLAGS =
84 ifdef NIX_INSTALL_DIR
85TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
86 else
87TEMPLATE_BIN_INST = kBuild/bin/$(BUILD_TARGET).$(BUILD_TARGET_ARCH)/
88 endif
89endif
90
91ifeq ($(filter-out win nt,$(BUILD_TARGET)),)
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 \
99 _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_WARNINGS
100 endif
101 TEMPLATE_BIN_DEFS.release = NDEBUG
102 TEMPLATE_BIN_SDKS = WINPSDK
103 TEMPLATE_BIN_CFLAGS = -W3 -Zi -Zl
104 TEMPLATE_BIN_CFLAGS.release = -O2
105 TEMPLATE_BIN_CFLAGS.profile = -O2 -GH -Gh
106 TEMPLATE_BIN_INCS += \
107 . \
108 $(PATH_GNUMAKE_SRC)/w32/include \
109 $(PATH_GNUMAKE_SRC)/glob
110 TEMPLATE_BIN_LDFLAGS = /SUBSYSTEM:console /INCREMENTAL:no /NOD /DEBUG
111 ifeq (1,0)
112 TEMPLATE_BIN_CFLAGS += -MT
113 TEMPLATE_BIN_LIBS = \
114 $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/oldnames.lib \
115 $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/libcmt.lib \
116 $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/libcpmt.lib
117 else
118 TEMPLATE_BIN_CFLAGS += -MD
119 TEMPLATE_BIN_LIBS = \
120 $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/oldnames.lib \
121 $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/msvcrt.lib
122 # $(PATH_TOOL_$(TEMPLATE_BIN_TOOL)_LIB)/msvcprt.lib - avoid this to save space!
123 endif
124 TEMPLATE_BIN_LIBS.profile = Y:/coding/libc/svn/trunk/out/win.$(BUILD_TARGET_ARCH)/debug/kStuff/lib/kPrf2.lib
125 ifdef NIX_INSTALL_DIR
126 TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
127 else
128 TEMPLATE_BIN_INST = kBuild/bin/win.$(BUILD_TARGET_ARCH)/
129 endif
130endif
131
132ifndef TEMPLATE_BIN_TOOL
133 # Use GCC3 when we're certain that the system is using GNU ld and ar.
134 ifeq ($(filter-out linux freebsd openbsd netbsd,$(BUILD_TARGET)),)
135 TEMPLATE_BIN_TOOL = GCC3
136 else
137 TEMPLATE_BIN_TOOL = GCC3PLAIN
138 endif
139 TEMPLATE_BIN_CFLAGS.release = -O3
140 ifeq ($(BUILD_TARGET),freebsd)
141 TEMPLATE_BIN_INCS += $(PATH_GNUMAKE_SRC)/glob /usr/local/include
142 endif
143 ifeq ($(BUILD_TARGET),linux)
144 TEMPLATE_BIN_LIBS += rt
145 endif
146 ifeq ($(BUILD_TARGET),solaris)
147 TEMPLATE_BIN_LIBS += rt
148 TEMPLATE_BIN_LDFLAGS += -Wl,-i
149 endif
150 ifdef NIX_INSTALL_DIR
151 TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
152 else
153 TEMPLATE_BIN_INST = kBuild/bin/$(BUILD_TARGET).$(BUILD_TARGET_ARCH)/
154 endif
155endif
156
157#
158# Template for building libraries for the tools.
159#
160TEMPLATE_LIB = Library for Commandline binary
161TEMPLATE_LIB_EXTENDS = BIN
162TEMPLATE_LIB_INST = lib/
163# for LIB_KDEP
164TEMPLATE_LIB_TOOL = $(TEMPLATE_BIN_TOOL)
165
166
167LIB_KDEP = $(PATH_OBJ)/src/lib/kDep/$(TOOL_$(TEMPLATE_LIB_TOOL)_ARLIBPREF)kDep$(TOOL_$(TEMPLATE_LIB_TOOL)_ARLIBSUFF)
168LIB_KUTIL = $(PATH_OBJ)/src/lib/kUtil/$(TOOL_$(TEMPLATE_LIB_TOOL)_ARLIBPREF)kUtil$(TOOL_$(TEMPLATE_LIB_TOOL)_ARLIBSUFF)
169
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