source: trunk/kBuild/tools/GCC.kmk@ 72

Last change on this file since 72 was 72, checked in by bird, 21 years ago

...

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1# $Id: GCC.kmk 72 2004-05-30 06:16:41Z bird $
2## @file
3#
4# kBuild Tool Config - Generic GCC.
5#
6# Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>
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
28TOOL_GCC := Generic GCC
29TOOL_GCC_CC := gcc$(HOSTSUFF_EXE)
30TOOL_GCC_CFLAGS := -g
31TOOL_GCC_CFLAGS.debug := -O0
32TOOL_GCC_CFLAGS.release := -O2
33TOOL_GCC_CFLAGS.profile := -pg
34TOOL_GCC_CINCS :=
35
36
37## Compile C source.
38# @param $1 Output basename (full).
39# @param $2 Source filename (relative).
40# @param $3 Normalized main target name.
41define TOOL_GCC_COMPILE_C
42#$ (warning dbg GCC: 1=$1 2=$2 3=$3 4=$4 5=$5)
43$1.o: $(PATH_CURRENT)/$2 $(dir $1).dir_created
44 $(TOOL_GCC_CC) -c \
45 $($3_$2_CFLAGS) $($3_$2_CFLAGS.$(BUILD_TYPE)) \
46 $($2_CFLAGS) $($2_CFLAGS.$(BUILD_TYPE)) \
47 $($3_CFLAGS) $($3_CFLAGS.$(BUILD_TYPE)) \
48 $(TOOL_GCC_CFLAGS) $(TOOL_GCC_CFLAGS.$(BUILD_TYPE)) \
49 $(addprefix -I, $($3_$2_CINCS) $($3_$2_INCS) $($2_CINCS) $($2_INCS) $($3_CINCS) $($3_INCS) $(INCS) \
50 $(TOOL_GCC_CINCS)) \
51 $(addprefix -D, $($3_$2_CDEFS) $($3_$2_DEFS) $($2_CDEFS) $($2_DEFS) $($3_CDEFS) $($3_DEFS) $(DEFS) $(TOOL_GCC_CDEFS)) \
52 -o $$@ -Wp,-MT,$1$(SUFF_DEP) -Wp,-MD,$$@ \
53 $(PATH_CURRENT)/$2
54_OBJS_$(3) += $1.o
55_DEPFILES += $1$(SUFF_DEP)
56endef
57
Note: See TracBrowser for help on using the repository browser.