source: trunk/Config.kmk@ 587

Last change on this file since 587 was 587, checked in by bird, 19 years ago

Hacking *nix install build for Gentoo.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.6 KB
RevLine 
[270]1# $Id: Config.kmk 587 2006-11-24 05:17:33Z bird $
2## @file
3#
4# Build Configuration.
5#
[557]6# Copyright (c) 2005-2006 knut st. osmundsen <bird@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
47NIX_INSTALL_DIR_BIN := $(patsubst /%,%,$(NIX_INSTALL_DIR))/bin
48NIX_INSTALL_DIR_SHARED := $(patsubst /%,%,$(NIX_INSTALL_DIR))/shared/kBuild
49DEFS += \
50 PATH_KBUILD=\"/$(NIX_INSTALL_DIR_SHARED)\" \
51 PATH_KBUILD_BIN=\"/$(NIX_INSTALL_DIR_BIN)\"
52endif
[270]53
54#
55# Template for building commandline tools.
56#
57TEMPLATE_BIN = Commandline binary
58
[400]59TEMPLATE_BIN_INCS = $(PATH_ROOT)/src/lib
60
[270]61ifeq ($(BUILD_TARGET),os2)
62TEMPLATE_BIN_TOOL = GCC3OMF
[427]63TEMPLATE_BIN_CFLAGS.profile = -pg
[270]64TEMPLATE_BIN_CFLAGS.release = -O3
65TEMPLATE_BIN_LDFLAGS = -Zhigh-mem -Zstack=1024
[587]66 ifdef NIX_INSTALL_DIR
67TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
68 else
[270]69TEMPLATE_BIN_INST = kBuild/bin/x86.os2/
[587]70 endif
[270]71endif
72
[557]73ifeq ($(BUILD_TARGET),darwin)
[565]74TEMPLATE_BIN_TOOL = GCC4MACHO
[557]75TEMPLATE_BIN_CFLAGS.profile =
76TEMPLATE_BIN_CFLAGS.release = -O3
77TEMPLATE_BIN_LDFLAGS =
[587]78 ifdef NIX_INSTALL_DIR
79TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
80 else
[557]81TEMPLATE_BIN_INST = kBuild/bin/$(BUILD_TARGET_ARCH).$(BUILD_TARGET)/
[587]82 endif
[557]83endif
84
[552]85ifeq ($(filter-out x86.win32 x86.win x86.nt,$(BUILD_TARGET_ARCH).$(BUILD_TARGET)),)
86ifndef PATH_DEV
87$(error To build on windows you'll have to set PATH_DEV to point to somewhere kbuild can find VCC70.)
88endif
[270]89TEMPLATE_BIN_TOOL = VCC70
[400]90TEMPLATE_BIN_DEFS = WINDOWS32 _CONSOLE WIN32 __WIN32__
[270]91TEMPLATE_BIN_DEFS.release = NDEBUG
[533]92TEMPLATE_BIN_CFLAGS = -MT -W3 -Zi -Zl
93TEMPLATE_BIN_CFLAGS.release = -O2
94TEMPLATE_BIN_CFLAGS.profile = -O2 -GH -Gh
[552]95#todo use path macros from the tool
[400]96TEMPLATE_BIN_INCS += \
[270]97 . \
98 $(PATH_ROOT)/src/gmake/w32/include \
99 $(PATH_ROOT)/src/gmake/glob \
100 $(PATH_DEV)/x86.win32/vcc70/include \
101 $(PATH_DEV)/x86.win32/sdk200209/include
102TEMPLATE_BIN_LDFLAGS = /SUBSYSTEM:console /INCREMENTAL:no /NOD
[533]103TEMPLATE_BIN_LDFLAGS.profile = /DEBUG
[270]104TEMPLATE_BIN_LIBS = \
105 $(PATH_DEV)/x86.win32/vcc70/lib/libcmt.lib \
106 $(PATH_DEV)/x86.win32/vcc70/lib/oldnames.lib \
107 $(PATH_DEV)/x86.win32/sdk200209/lib/Kernel32.Lib \
108 $(PATH_DEV)/x86.win32/sdk200209/lib/User32.Lib \
109 $(PATH_DEV)/x86.win32/sdk200209/lib/AdvAPI32.Lib
[533]110TEMPLATE_BIN_LIBS.profile = g:/coding/vbox/trunk/out/win32/debug/lib/kPrf2.lib
[587]111 ifdef NIX_INSTALL_DIR
112TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
113 else
[270]114TEMPLATE_BIN_INST = kBuild/bin/x86.win32/
[587]115 endif
[270]116endif
117
118ifndef TEMPLATE_BIN_TOOL
119TEMPLATE_BIN_TOOL = GCC3
120TEMPLATE_BIN_CFLAGS.release = -O3
[401]121TEMPLATE_BIN_LDFLAGS = -static
[270]122ifeq ($(BUILD_TARGET),linux)
[298]123TEMPLATE_BIN_LIBS += rt
[270]124endif
[298]125ifeq ($(BUILD_TARGET),freebsd)
126TEMPLATE_BIN_LIBS += iconv intl
127TEMPLATE_BIN_LIBPATH += /usr/local/lib
128TEMPLATE_BIN_INCS += $(PATH_ROOT)/src/gmake/glob /usr/local/include
129endif
[587]130 ifdef NIX_INSTALL_DIR
131TEMPLATE_BIN_INST = $(NIX_INSTALL_DIR_BIN)/
132 else
[270]133TEMPLATE_BIN_INST = kBuild/bin/$(BUILD_TARGET_ARCH).$(BUILD_TARGET)/
[587]134 endif
[270]135endif
136
[393]137#
138# Template for building libraries for the tools.
139#
140TEMPLATE_LIB = Library for Commandline binary
[557]141TEMPLATE_LIB_EXTENDS = BIN
142TEMPLATE_LIB_INST = lib/
143# for LIB_KDEP
144TEMPLATE_LIB_TOOL = $(TEMPLATE_BIN_TOOL)
[393]145
146
[587]147LIB_KDEP = $(PATH_OBJ)/src/lib/kDep/$(TOOL_$(TEMPLATE_LIB_TOOL)_ARLIBPREF)kDep$(TOOL_$(TEMPLATE_LIB_TOOL)_ARLIBSUFF)
[393]148
Note: See TracBrowser for help on using the repository browser.