VirtualBox

source: kStuff/trunk/kLdr/Makefile.kmk@ 40

Last change on this file since 40 was 29, checked in by bird, 15 years ago

Finally got around execute the switch to the MIT license.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 5.6 KB
Line 
1# $Id: Makefile.kmk 29 2009-07-01 20:30:29Z bird $
2## @file
3# kLdr - The Dynamic Loader, sub-makefile.
4#
5
6#
7# Copyright (c) 2006-2007 Knut St. Osmundsen <[email protected]>
8#
9# Permission is hereby granted, free of charge, to any person
10# obtaining a copy of this software and associated documentation
11# files (the "Software"), to deal in the Software without
12# restriction, including without limitation the rights to use,
13# copy, modify, merge, publish, distribute, sublicense, and/or sell
14# copies of the Software, and to permit persons to whom the
15# Software is furnished to do so, subject to the following
16# conditions:
17#
18# The above copyright notice and this permission notice shall be
19# included in all copies or substantial portions of the Software.
20#
21# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
23# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28# OTHER DEALINGS IN THE SOFTWARE.
29#
30
31DEPTH ?= ..
32SUB_DEPTH = ..
33include $(PATH_KBUILD)/subheader.kmk
34
35#todo: include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
36
37#
38# Template for testcases.
39#
40TEMPLATE_TST = Testcase template
41ifeq ($(BUILD_TARGET),win)
42 ifeq ($(BUILD_TARGET_ARCH), x86)
43 TEMPLATE_TST_TOOL = VCC70
44 TEMPLATE_TST_CFLAGS = -W3 -Zi -Zl -MD
45 TEMPLATE_TST_LIBS = $(PATH_TOOL_VCC70_LIB)/msvcrt.lib
46 else
47 TEMPLATE_TST_TOOL = VCC80AMD64
48 TEMPLATE_TST_CFLAGS = -W3 -Zi -Zl -MD
49 TEMPLATE_TST_LIBS = $(PATH_TOOL_VCC80AMD64_LIB)/msvcrt.lib
50 endif
51 TEMPLATE_TST_CFLAGS.release = -O2
52 TEMPLATE_TST_ASFLAGS = -f win
53 TEMPLATE_TST_DEFS = __WIN__
54 TEMPLATE_TST_SDKS = WINPSDK W2K3DDK
55
56else
57 ifeq ($(BUILD_TARGET),os2)
58 TEMPLATE_TST_TOOL = GCC3OMF
59 TEMPLATE_TST_ASFLAGS = -f obj
60 TEMPLATE_TST_LIBS = os2 gcc end
61 else ifeq ($(BUILD_TARGET),darwin)
62 TEMPLATE_TST_TOOL = GCC4MACHO
63 TEMPLATE_TST_ASFLAGS = -f macho
64 TEMPLATE_TST_LIBS = #os2 gcc end
65 else
66 TEMPLATE_TST_TOOL = GCC3
67 TEMPLATE_TST_ASFLAGS = -f elf
68 TEMPLATE_TST_LIBS = gcc
69 endif
70 TEMPLATE_TST_CFLAGS = -Wall -pedantic -g -std=gnu99
71 TEMPLATE_TST_CFLAGS.release = -O2
72 TEMPLATE_TST_LDFLAGS =
73endif
74TEMPLATE_TST_INCS := $(PATH_SUB_CURRENT) $(PATH_SUB_ROOT)/include
75
76
77#
78# The kLdr DLL.
79#
80DLLS += kLdr
81kLdr_ASTOOL = NASM
82ifeq ($(BUILD_TARGET),win)
83 ifeq ($(BUILD_TARGET_ARCH),x86)
84 kLdr_TOOL = VCC70
85 kLdr_CFLAGS = -W3 -Zl -ML
86 kLdr_LDFLAGS = -Entry:DllMain@12 -Debug
87 kLdr_LIBS = \
88 $(PATH_TOOL_VCC70_LIB)/LIBC.lib \
89 $(PATH_SDK_W2K3DDKX86_LIB)/ntdll.lib
90 else
91 kLdr_TOOL = VCC80AMD64
92 kLdr_ASTOOL = YASM
93 kLdr_CFLAGS = -W3 -Zl -MT
94 kLdr_LDFLAGS = -Entry:DllMain -Debug
95 kLdr_LIBS = \
96 $(PATH_TOOL_VCC80AMD64_LIB)/LIBCMT.lib \
97 $(PATH_SDK_W2K3DDKAMD64_LIB)/ntdll.lib
98 endif
99 kLdr_ASFLAGS = -f win
100 kLdr_DEFS = __WIN__
101 kLdr_SDKS.x86 = WIN32SDK W2K3DDKX86
102 kLdr_SDKS.amd64 = WIN64SDK W2K3DDKAMD64
103else
104 ifeq ($(BUILD_TARGET),os2)
105 kLdr_TOOL = GCC3OMF
106 kLdr_ASFLAGS = -f obj
107 kLdr_LIBS = os2 gcc end
108 else ifeq ($(BUILD_TARGET),darwin)
109 kLdr_TOOL = GCC4MACHO
110 kLdr_ASFLAGS = -f macho
111 kLdr_LIBS = #os2 gcc end
112 else
113 kLdr_TOOL = GCC3
114 kLdr_ASFLAGS = -f elf
115 kLdr_LIBS = gcc
116 endif
117 kLdr_CFLAGS = -Wall -pedantic
118 kLdr_LDFLAGS = -nostdlib
119endif
120kLdr_INCS := $(PATH_SUB_CURRENT) $(PATH_SUB_ROOT)/include
121kLdr_SOURCES = \
122 kLdr.c \
123 kLdrDyld.c \
124 kLdrDyldFind.c \
125 kLdrDyldMod.c \
126 kLdrDyldOS.c \
127 kLdrDyLdSem.c \
128 kLdrMod.c \
129 kLdrModLX.c \
130 kLdrModMachO.c \
131 kLdrModNative.c \
132 kLdrModPE.c
133kLdr_SOURCES.os2 = \
134 kLdr-os2.def \
135 kLdr-os2.c \
136 kLdrA-os2.asm
137kLdr_SOURCES.win = \
138 kLdr-win.def \
139 kLdr-win.c
140kLdr_LIBS += \
141 $(PATH_LIB)/kRdrStatic$(SUFF_LIB) \
142 $(PATH_LIB)/kCpuStatic$(SUFF_LIB) \
143 $(PATH_LIB)/kHlpBareStatic$(SUFF_LIB) \
144 $(PATH_LIB)/kErrStatic$(SUFF_LIB)
145
146#
147# A static edition of kLdr.
148#
149LIBRARIES += kLdrStatic
150kLdrStatic_TEMPLATE = kStuffLIB
151kLdrStatic_SDKS.win = WINPSDK W2K3DDK
152kLdrStatic_INCS := $(PATH_SUB_CURRENT) $(PATH_SUB_ROOT)/include
153kLdrStatic_DEFS.darwin = __DARWIN__
154kLdrStatic_DEFS.os2 = __OS2__
155kLdrStatic_DEFS.win = __WIN__
156kLdrStatic_SOURCES = $(kLdr_SOURCES)
157
158#
159# The OS/2 stub program.
160#
161PROGRAMS.os2 = kLdrExeStub-os2
162kLdrExeStub-os2_TOOL = GCC3OMF
163kLdrExeStub-os2_ASTOOL = NASM
164kLdrExeStub-os2_ASFLAGS = -f obj
165#kLdrExeStub-os2_LDFLAGS = -nostdlib
166kLdrExeStub-os2_LDFLAGS = -nostdlib -Zstack 64
167kLdrExeStub-os2_LIBS = $(TARGET_kLdr)
168#kLdrExeStub-os2_SOURCES = kLdrExeStub-os2.asm
169kLdrExeStub-os2_SOURCES = kLdrExeStub-os2A.asm kLdrExeStub-os2.c
170
171#
172# The Windows stub program.
173#
174PROGRAMS.win = kLdrExeStub-win
175kLdrExeStub-win_TOOL.win.x86 = VCC70
176kLdrExeStub-win_TOOL.win.amd64 = VCC80AMD64
177kLdrExeStub-win_SDKS.x86 = WIN32SDK
178kLdrExeStub-win_SDKS.amd64 = WIN64SDK
179kLdrExeStub-win_INCS := $(PATH_SUB_CURRENT) $(PATH_SUB_ROOT)/include
180kLdrExeStub-win_DEFS = __WIN__
181kLdrExeStub-win_CFLAGS = -W3 -Zl
182kLdrExeStub-win_CFLAGS.debug = -Zi
183kLdrExeStub-win_LDFLAGS = -Entry:WindowsMain -SubSystem:Console -FIXED:NO
184kLdrExeStub-win_LIBS = $(TARGET_kLdr:.dll=.lib)
185kLdrExeStub-win_SOURCES = kLdrExeStub-win.c
186
187
188##
189## The (stub) utility.
190##
191#PROGRAMS = kLdrUtil
192
193
194#
195# Heap testcase.
196#
197#PROGRAMS += tstkLdrHeap
198tstkLdrHeap_TEMPLATE = TST
199tstkLdrHeap_SOURCES = \
200 tstkLdrHeap.c \
201 kHlp.c \
202 kHlpHeap.c \
203 kHlpMem.c \
204 kHlpPath.c \
205 kHlpSem.c \
206 kHlpStr.c \
207
208#
209# Heap testcase.
210#
211PROGRAMS += tstkLdrMod
212tstkLdrMod_TEMPLATE = TST
213tstkLdrMod_SOURCES = \
214 tstkLdrMod.c
215ifeq ($(BUILD_TARGET),win)
216tstkLdrMod_LIBS = $(TARGET_kLdr:.dll=.lib)
217else
218tstkLdrMod_LIBS = $(TARGET_kLdr)
219endif
220
221
222# Generate rules.
223include $(PATH_KBUILD)/subfooter.kmk
224
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