1 | # $Id: Config.kmk 785 2007-01-24 22:21:56Z 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.
|
---|
28 | KBUILD_DO_AUTO_INSTALL := 1
|
---|
29 |
|
---|
30 |
|
---|
31 | #
|
---|
32 | # The kBuild version.
|
---|
33 | #
|
---|
34 | KBUILD_VERSION_MAJOR = 0
|
---|
35 | KBUILD_VERSION_MINOR = 1
|
---|
36 | KBUILD_VERSION_PATCH = 0
|
---|
37 | KBUILD_VERSION = "0.1.0"
|
---|
38 | DEFS += \
|
---|
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 | #
|
---|
46 | ifdef NIX_INSTALL_DIR
|
---|
47 | NIX_INSTALL_DIR_BIN := $(patsubst /%,%,$(NIX_INSTALL_DIR))/bin
|
---|
48 | NIX_INSTALL_DIR_SHARE := $(patsubst /%,%,$(NIX_INSTALL_DIR))/share/kBuild
|
---|
49 | DEFS += \
|
---|
50 | PATH_KBUILD=\"/$(NIX_INSTALL_DIR_SHARE)\" \
|
---|
51 | PATH_KBUILD_BIN=\"/$(NIX_INSTALL_DIR_BIN)\"
|
---|
52 | endif
|
---|
53 |
|
---|
54 | #
|
---|
55 | # Template for building commandline tools.
|
---|
56 | #
|
---|
57 | TEMPLATE_BIN = Commandline binary
|
---|
58 |
|
---|
59 | TEMPLATE_BIN_INCS = $(PATH_ROOT)/src/lib
|
---|
60 |
|
---|
61 | ifeq ($(BUILD_TARGET),os2)
|
---|
62 | TEMPLATE_BIN_TOOL = GCC3OMF
|
---|
63 | TEMPLATE_BIN_CFLAGS.profile = -pg
|
---|
64 | TEMPLATE_BIN_CFLAGS.release = -O3
|
---|
65 | TEMPLATE_BIN_LDFLAGS = -Zhigh-mem -Zstack=1024
|
---|
66 | ifdef NIX_INSTALL_DIR
|
---|
67 | TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
|
---|
68 | else
|
---|
69 | TEMPLATE_BIN_INST = kBuild/bin/os2.x86/
|
---|
70 | endif
|
---|
71 | endif
|
---|
72 |
|
---|
73 | ifeq ($(BUILD_TARGET),darwin)
|
---|
74 | TEMPLATE_BIN_TOOL = GCC4MACHO
|
---|
75 | TEMPLATE_BIN_CFLAGS.profile =
|
---|
76 | TEMPLATE_BIN_CFLAGS.release = -O3
|
---|
77 | TEMPLATE_BIN_LDFLAGS =
|
---|
78 | ifdef NIX_INSTALL_DIR
|
---|
79 | TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
|
---|
80 | else
|
---|
81 | TEMPLATE_BIN_INST = kBuild/bin/$(BUILD_TARGET).$(BUILD_TARGET_ARCH)/
|
---|
82 | endif
|
---|
83 | endif
|
---|
84 |
|
---|
85 | ifeq ($(filter-out win nt,$(BUILD_TARGET)),)
|
---|
86 | include $(PATH_KBUILD)/tools/VCC70.kmk # fixme! template expanding does something bad to _LIBS /me thinks.
|
---|
87 | TEMPLATE_BIN_TOOL = VCC70
|
---|
88 | TEMPLATE_BIN_DEFS = WINDOWS32 _CONSOLE WIN32 __WIN32__
|
---|
89 | TEMPLATE_BIN_DEFS.release = NDEBUG
|
---|
90 | TEMPLATE_BIN_SDKS = WINPSDK
|
---|
91 | TEMPLATE_BIN_CFLAGS = -MT -W3 -Zi -Zl
|
---|
92 | TEMPLATE_BIN_CFLAGS.release = -O2
|
---|
93 | TEMPLATE_BIN_CFLAGS.profile = -O2 -GH -Gh
|
---|
94 | TEMPLATE_BIN_INCS += \
|
---|
95 | . \
|
---|
96 | $(PATH_ROOT)/src/gmake/w32/include \
|
---|
97 | $(PATH_ROOT)/src/gmake/glob
|
---|
98 | TEMPLATE_BIN_LDFLAGS = /SUBSYSTEM:console /INCREMENTAL:no /NOD /DEBUG
|
---|
99 | TEMPLATE_BIN_LIBS = \
|
---|
100 | $(PATH_TOOL_VCC70_LIB)/oldnames.lib \
|
---|
101 | $(PATH_TOOL_VCC70_LIB)/libcmt.lib \
|
---|
102 | $(PATH_TOOL_VCC70_LIB)/libcpmt.lib
|
---|
103 | TEMPLATE_BIN_LIBS.profile = g:/coding/vbox/trunk/out/win32/debug/lib/kPrf2.lib
|
---|
104 | ifdef NIX_INSTALL_DIR
|
---|
105 | TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
|
---|
106 | else
|
---|
107 | TEMPLATE_BIN_INST = kBuild/bin/win.$(BUILD_TARGET_ARCH)/
|
---|
108 | endif
|
---|
109 | endif
|
---|
110 |
|
---|
111 | ifndef TEMPLATE_BIN_TOOL
|
---|
112 | TEMPLATE_BIN_TOOL = GCC3
|
---|
113 | TEMPLATE_BIN_CFLAGS.release = -O3
|
---|
114 | ifeq ($(BUILD_TARGET),linux)
|
---|
115 | TEMPLATE_BIN_LIBS += rt
|
---|
116 | endif
|
---|
117 | ifeq ($(BUILD_TARGET),freebsd)
|
---|
118 | TEMPLATE_BIN_LIBS += iconv intl
|
---|
119 | TEMPLATE_BIN_LIBPATH += /usr/local/lib
|
---|
120 | TEMPLATE_BIN_INCS += $(PATH_ROOT)/src/gmake/glob /usr/local/include
|
---|
121 | endif
|
---|
122 | ifdef NIX_INSTALL_DIR
|
---|
123 | TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
|
---|
124 | else
|
---|
125 | TEMPLATE_BIN_INST = kBuild/bin/$(BUILD_TARGET).$(BUILD_TARGET_ARCH)/
|
---|
126 | endif
|
---|
127 | endif
|
---|
128 |
|
---|
129 | #
|
---|
130 | # Template for building libraries for the tools.
|
---|
131 | #
|
---|
132 | TEMPLATE_LIB = Library for Commandline binary
|
---|
133 | TEMPLATE_LIB_EXTENDS = BIN
|
---|
134 | TEMPLATE_LIB_INST = lib/
|
---|
135 | # for LIB_KDEP
|
---|
136 | TEMPLATE_LIB_TOOL = $(TEMPLATE_BIN_TOOL)
|
---|
137 |
|
---|
138 |
|
---|
139 | LIB_KDEP = $(PATH_OBJ)/src/lib/kDep/$(TOOL_$(TEMPLATE_LIB_TOOL)_ARLIBPREF)kDep$(TOOL_$(TEMPLATE_LIB_TOOL)_ARLIBSUFF)
|
---|
140 |
|
---|