1 | # $Id: VCC70.kmk 85 2004-06-02 13:09:58Z bird $
|
---|
2 | ## @file
|
---|
3 | #
|
---|
4 | # kBuild Tool Config - Visual C++ 7.0 (aka Visual .NET)
|
---|
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 |
|
---|
28 | TOOL_VCC70 := Visual C++ 7.0
|
---|
29 | PATH_TOOL_VCC70 ?= $(PATH_DEV)/x86.win32/vcc70
|
---|
30 | PATH_TOOL_VCC70_LIB ?= $(PATH_DEV)/x86.win32/vcc70/lib
|
---|
31 |
|
---|
32 | TOOL_VCC70_CC := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/cl.exe
|
---|
33 | TOOL_VCC70_COBJSUFF := .obj
|
---|
34 | TOOL_VCC70_CFLAGS := -TC -c -nologo
|
---|
35 | TOOL_VCC70_CFLAGS.debug := -Od -Zi
|
---|
36 | TOOL_VCC70_CFLAGS.release := -O2
|
---|
37 | TOOL_VCC70_CFLAGS.profile :=
|
---|
38 | TOOL_VCC70_CINCS := $(PATH_TOOL_VCC70)/include
|
---|
39 | TOOL_VCC70_CDEFS :=
|
---|
40 |
|
---|
41 | TOOL_VCC70_CXX := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/cl.exe
|
---|
42 | TOOL_VCC70_CXXOBJSUFF := .obj
|
---|
43 | TOOL_VCC70_CXXFLAGS := -TP -c -nologo
|
---|
44 | TOOL_VCC70_CXXFLAGS.debug := -Od -Zi
|
---|
45 | TOOL_VCC70_CXXFLAGS.release := -O2
|
---|
46 | TOOL_VCC70_CXXFLAGS.profile :=
|
---|
47 | TOOL_VCC70_CXXINCS := $(PATH_TOOL_VCC70)/include
|
---|
48 | TOOL_VCC70_CXXDEFS :=
|
---|
49 |
|
---|
50 | TOOL_VCC70_AS := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/ml.exe
|
---|
51 | TOOL_VCC70_ASOBJSUFF := .obj
|
---|
52 |
|
---|
53 | TOOL_VCC70_AR := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/lib.exe
|
---|
54 | TOOL_VCC70_ARFLAGS := -nologo
|
---|
55 | TOOL_VCC70_ARLIBSUFF := .lib
|
---|
56 |
|
---|
57 | TOOL_VCC70_LD := echo $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/link.exe
|
---|
58 | TOOL_VCC70_LDFLAGS := -nologo
|
---|
59 | TOOL_VCC70_LDFLAGS.debug := -debug
|
---|
60 | TOOL_VCC70_LDFLAGS.release :=
|
---|
61 |
|
---|
62 |
|
---|
63 | ## Compile C source.
|
---|
64 | # @param $(target) Normalized main target name.
|
---|
65 | # @param $(source) Source filename (relative).
|
---|
66 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
67 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
68 | # @param $(flags) Flags.
|
---|
69 | # @param $(defs) Definitions. No -D or something.
|
---|
70 | # @param $(incs) Includes. No -I or something.
|
---|
71 | # @param $(dirdep) Directory creation dependency.
|
---|
72 | #
|
---|
73 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
74 | # @param $(objsuff) Object suffix.
|
---|
75 | define TOOL_VCC70_COMPILE_C
|
---|
76 | #$ (warning dbg: TOOL_VCC70_COMPILE_C: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
|
---|
77 | $(obj): $(dirdep) $(PATH_CURRENT)/$(source)
|
---|
78 | $(call MSG_L2,Compiling $$@ using GCC)
|
---|
79 | $(TOOL_VCC70_CC) -c\
|
---|
80 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
81 | -Fd$(outbase).pdb \
|
---|
82 | -Fo$$@ \
|
---|
83 | $(PATH_CURRENT)/$(source)
|
---|
84 | _OUT_FILES += $(outbase).pdb
|
---|
85 |
|
---|
86 | endef
|
---|
87 |
|
---|
88 |
|
---|
89 | ## Compile C++ source.
|
---|
90 | # @param $(target) Normalized main target name.
|
---|
91 | # @param $(source) Source filename (relative).
|
---|
92 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
93 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
94 | # @param $(flags) Flags.
|
---|
95 | # @param $(defs) Definitions. No -D or something.
|
---|
96 | # @param $(incs) Includes. No -I or something.
|
---|
97 | # @param $(dirdep) Directory creation dependency.
|
---|
98 | #
|
---|
99 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
100 | # @param $(objsuff) Object suffix.
|
---|
101 | define TOOL_VCC70_COMPILE_CXX
|
---|
102 | #$ (warning dbg: TOOL_VCC70_COMPILE_CXX: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
|
---|
103 | $(obj): $(dirdep) $(PATH_CURRENT)/$(source)
|
---|
104 | $(call MSG_L2,Compiling $$@ using GCC)
|
---|
105 | $(TOOL_VCC70_CXX) -c\
|
---|
106 | $(flags) $(addprefix -I, $(call CYGPATHMIXED,$(incs))) $(addprefix -D, $(defs))\
|
---|
107 | -Fd$(call CYGPATHMIXED,$(outbase).pdb) \
|
---|
108 | -Fo$(call CYGPATHMIXED,$(obj))\
|
---|
109 | $(call CYGPATHMIXED,$(PATH_CURRENT)/$(source))
|
---|
110 | _OUT_FILES += $(outbase).pdb
|
---|
111 |
|
---|
112 | endef
|
---|
113 |
|
---|
114 |
|
---|
115 | ## Link library
|
---|
116 | # @param $(target) Normalized main target name.
|
---|
117 | # @param $(lib) Library name.
|
---|
118 | # @param $(objs) Object files to put in the library.
|
---|
119 | # @param $(flags) Flags.
|
---|
120 | # @param $(dirdep) Directory creation dependency.
|
---|
121 | # @param $(deps) Other dependencies.
|
---|
122 | #
|
---|
123 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
124 | define TOOL_VCC70_LINK_LIBRARY
|
---|
125 | #$ (warning dbg: TOOL_VCC70_LINK_LIBRARY: target=$(target) lib=$(lib) objs=$(objs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) outbase=$(outbase))
|
---|
126 | $(lib): $(dirdep) $(objs) $(deps)
|
---|
127 | $(call MSG_L1,Creating Library $$@)
|
---|
128 | $(RM) -f $$@
|
---|
129 | $(TOOL_VCC70_AR) $(flags) /OUT:$(call CYGPATHMIXED,$(lib)) $(call CYGPATHMIXED,$(objs))
|
---|
130 |
|
---|
131 | endef
|
---|
132 |
|
---|
133 |
|
---|
134 | ## Link program
|
---|
135 | # @param $(target) Normalized main target name.
|
---|
136 | # @param $(exe) Program name.
|
---|
137 | # @param $(objs) Object files to link together.
|
---|
138 | # @param $(libs) Libraries to search.
|
---|
139 | # @param $(libpath) Library search paths.
|
---|
140 | # @param $(flags) Flags.
|
---|
141 | # @param $(dirdep) Directory creation dependency.
|
---|
142 | # @param $(deps) Other dependencies.
|
---|
143 | # @param $(deffile) Definition file. (optional, PC only)
|
---|
144 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
145 | # @param $(custom_post) Custom step invoked after linking.
|
---|
146 | #
|
---|
147 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
148 | define TOOL_VCC70_LINK_PROGRAM
|
---|
149 | #$ (warning dbg: TOOL_VCC70_LINK_PROGRAM: target=$(target) exe=$(exe) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) deffile=$(deffile) outbase=$(outbase))
|
---|
150 | $(exe): $(dirdep) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(deps)
|
---|
151 | $(call MSG_L1,Creating Program $$@)
|
---|
152 | ifneq ($(custom_pre),)
|
---|
153 | $(eval $(custom_pre))
|
---|
154 | endif
|
---|
155 | $(TOOL_VCC70_LD) $(flags) \
|
---|
156 | /OUT:$(call CYGPATHMIXED,$(exe)) \
|
---|
157 | /MAP:$(call CYGPATHMIXED,$(outbase).map) \
|
---|
158 | $(call CYGPATHMIXED,$(objs)) \
|
---|
159 | $(call CYGPATHMIXED,$(libs))
|
---|
160 | ifneq ($(custom_post),)
|
---|
161 | $(eval $(custom_post))
|
---|
162 | endif
|
---|
163 | _OUT_FILES += $(outbase).map
|
---|
164 |
|
---|
165 | endef
|
---|
166 |
|
---|
167 |
|
---|
168 | ## Link system module (windows aka driver, linux aka kernel module)
|
---|
169 | # @param $(target) Normalized main target name.
|
---|
170 | # @param $(sys) System module name.
|
---|
171 | # @param $(objs) Object files to link together.
|
---|
172 | # @param $(libs) Libraries to search.
|
---|
173 | # @param $(libpath) Library search paths.
|
---|
174 | # @param $(flags) Flags.
|
---|
175 | # @param $(dirdep) Directory creation dependency.
|
---|
176 | # @param $(deps) Other dependencies.
|
---|
177 | # @param $(deffile) Definition file. (optional, PC only)
|
---|
178 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
179 | # @param $(custom_post) Custom step invoked after linking.
|
---|
180 | #
|
---|
181 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
182 | define TOOL_VCC70_LINK_SYSMOD
|
---|
183 | #$ (warning dbg: TOOL_VCC70_LINK_SYSMOD: target=$(target) sys=$(sys) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) deffile=$(deffile) outbase=$(outbase))
|
---|
184 | $(sys): $(dirdep) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(deps)
|
---|
185 | $(call MSG_L1,Creating Program $$@)
|
---|
186 | ifneq ($(custom_pre),)
|
---|
187 | $(eval $(custom_pre))
|
---|
188 | endif
|
---|
189 | $(TOOL_VCC70_LD) $(flags) \
|
---|
190 | /OUT:$(call CYGPATHMIXED,$(exe)) \
|
---|
191 | /MAP:$(call CYGPATHMIXED,$(outbase).map) \
|
---|
192 | $(call CYGPATHMIXED,$(objs)) \
|
---|
193 | $(call CYGPATHMIXED,$(libs))
|
---|
194 | ifneq ($(custom_post),)
|
---|
195 | $(eval $(custom_post))
|
---|
196 | endif
|
---|
197 | _OUT_FILES += $(outbase).map
|
---|
198 |
|
---|
199 | endef
|
---|
200 |
|
---|