VirtualBox

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

Last change on this file since 28 was 5, checked in by bird, 17 years ago

Fixed DEPTH now that we're no longer in the kLIBC repository.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 5.3 KB
Line 
1# $Id: Makefile.kmk 5 2008-02-03 20:56:09Z 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# This file is part of kStuff.
10#
11# kStuff is free software; you can redistribute it and/or
12# modify it under the terms of the GNU Lesser General Public
13# License as published by the Free Software Foundation; either
14# version 2.1 of the License, or (at your option) any later version.
15#
16# kStuff 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 GNU
19# Lesser General Public License for more details.
20#
21# You should have received a copy of the GNU Lesser General Public
22# License along with kStuff; if not, write to the Free Software
23# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24#
25#
26
27DEPTH ?= ..
28SUB_DEPTH = ..
29include $(PATH_KBUILD)/subheader.kmk
30
31#todo: include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
32
33#
34# Template for testcases.
35#
36TEMPLATE_TST = Testcase template
37ifeq ($(BUILD_TARGET),win)
38 ifeq ($(BUILD_TARGET_ARCH), x86)
39 TEMPLATE_TST_TOOL = VCC70
40 TEMPLATE_TST_CFLAGS = -W3 -Zi -Zl -MD
41 TEMPLATE_TST_LIBS = $(PATH_TOOL_VCC70_LIB)/msvcrt.lib
42 else
43 TEMPLATE_TST_TOOL = VCC80AMD64
44 TEMPLATE_TST_CFLAGS = -W3 -Zi -Zl -MD
45 TEMPLATE_TST_LIBS = $(PATH_TOOL_VCC80AMD64_LIB)/msvcrt.lib
46 endif
47 TEMPLATE_TST_CFLAGS.release = -O2
48 TEMPLATE_TST_ASFLAGS = -f win
49 TEMPLATE_TST_DEFS = __WIN__
50 TEMPLATE_TST_SDKS = WINPSDK W2K3DDK
51
52else
53 ifeq ($(BUILD_TARGET),os2)
54 TEMPLATE_TST_TOOL = GCC3OMF
55 TEMPLATE_TST_ASFLAGS = -f obj
56 TEMPLATE_TST_LIBS = os2 gcc end
57 else ifeq ($(BUILD_TARGET),darwin)
58 TEMPLATE_TST_TOOL = GCC4MACHO
59 TEMPLATE_TST_ASFLAGS = -f macho
60 TEMPLATE_TST_LIBS = #os2 gcc end
61 else
62 TEMPLATE_TST_TOOL = GCC3
63 TEMPLATE_TST_ASFLAGS = -f elf
64 TEMPLATE_TST_LIBS = gcc
65 endif
66 TEMPLATE_TST_CFLAGS = -Wall -pedantic -g -std=gnu99
67 TEMPLATE_TST_CFLAGS.release = -O2
68 TEMPLATE_TST_LDFLAGS =
69endif
70TEMPLATE_TST_INCS := $(PATH_SUB_CURRENT) $(PATH_SUB_ROOT)/include
71
72
73#
74# The kLdr DLL.
75#
76DLLS += kLdr
77kLdr_ASTOOL = NASM
78ifeq ($(BUILD_TARGET),win)
79 ifeq ($(BUILD_TARGET_ARCH),x86)
80 kLdr_TOOL = VCC70
81 kLdr_CFLAGS = -W3 -Zl -ML
82 kLdr_LDFLAGS = -Entry:DllMain@12 -Debug
83 kLdr_LIBS = \
84 $(PATH_TOOL_VCC70_LIB)/LIBC.lib \
85 $(PATH_SDK_W2K3DDKX86_LIB)/ntdll.lib
86 else
87 kLdr_TOOL = VCC80AMD64
88 kLdr_ASTOOL = YASM
89 kLdr_CFLAGS = -W3 -Zl -MT
90 kLdr_LDFLAGS = -Entry:DllMain -Debug
91 kLdr_LIBS = \
92 $(PATH_TOOL_VCC80AMD64_LIB)/LIBCMT.lib \
93 $(PATH_SDK_W2K3DDKAMD64_LIB)/ntdll.lib
94 endif
95 kLdr_ASFLAGS = -f win
96 kLdr_DEFS = __WIN__
97 kLdr_SDKS.x86 = WIN32SDK W2K3DDKX86
98 kLdr_SDKS.amd64 = WIN64SDK W2K3DDKAMD64
99else
100 ifeq ($(BUILD_TARGET),os2)
101 kLdr_TOOL = GCC3OMF
102 kLdr_ASFLAGS = -f obj
103 kLdr_LIBS = os2 gcc end
104 else ifeq ($(BUILD_TARGET),darwin)
105 kLdr_TOOL = GCC4MACHO
106 kLdr_ASFLAGS = -f macho
107 kLdr_LIBS = #os2 gcc end
108 else
109 kLdr_TOOL = GCC3
110 kLdr_ASFLAGS = -f elf
111 kLdr_LIBS = gcc
112 endif
113 kLdr_CFLAGS = -Wall -pedantic
114 kLdr_LDFLAGS = -nostdlib
115endif
116kLdr_INCS := $(PATH_SUB_CURRENT) $(PATH_SUB_ROOT)/include
117kLdr_SOURCES = \
118 kLdr.c \
119 kLdrDyld.c \
120 kLdrDyldFind.c \
121 kLdrDyldMod.c \
122 kLdrDyldOS.c \
123 kLdrDyLdSem.c \
124 kLdrMod.c \
125 kLdrModLX.c \
126 kLdrModMachO.c \
127 kLdrModNative.c \
128 kLdrModPE.c
129kLdr_SOURCES.os2 = \
130 kLdr-os2.def \
131 kLdr-os2.c \
132 kLdrA-os2.asm
133kLdr_SOURCES.win = \
134 kLdr-win.def \
135 kLdr-win.c
136kLdr_LIBS += \
137 $(PATH_LIB)/kRdrStatic$(SUFF_LIB) \
138 $(PATH_LIB)/kCpuStatic$(SUFF_LIB) \
139 $(PATH_LIB)/kHlpBareStatic$(SUFF_LIB) \
140 $(PATH_LIB)/kErrStatic$(SUFF_LIB)
141
142#
143# A static edition of kLdr.
144#
145LIBRARIES += kLdrStatic
146kLdrStatic_TEMPLATE = kStuffLIB
147kLdrStatic_SDKS.win = WINPSDK W2K3DDK
148kLdrStatic_INCS := $(PATH_SUB_CURRENT) $(PATH_SUB_ROOT)/include
149kLdrStatic_DEFS.darwin = __DARWIN__
150kLdrStatic_DEFS.os2 = __OS2__
151kLdrStatic_DEFS.win = __WIN__
152kLdrStatic_SOURCES = $(kLdr_SOURCES)
153
154#
155# The OS/2 stub program.
156#
157PROGRAMS.os2 = kLdrExeStub-os2
158kLdrExeStub-os2_TOOL = GCC3OMF
159kLdrExeStub-os2_ASTOOL = NASM
160kLdrExeStub-os2_ASFLAGS = -f obj
161#kLdrExeStub-os2_LDFLAGS = -nostdlib
162kLdrExeStub-os2_LDFLAGS = -nostdlib -Zstack 64
163kLdrExeStub-os2_LIBS = $(TARGET_kLdr)
164#kLdrExeStub-os2_SOURCES = kLdrExeStub-os2.asm
165kLdrExeStub-os2_SOURCES = kLdrExeStub-os2A.asm kLdrExeStub-os2.c
166
167#
168# The Windows stub program.
169#
170PROGRAMS.win = kLdrExeStub-win
171kLdrExeStub-win_TOOL.win.x86 = VCC70
172kLdrExeStub-win_TOOL.win.amd64 = VCC80AMD64
173kLdrExeStub-win_SDKS.x86 = WIN32SDK
174kLdrExeStub-win_SDKS.amd64 = WIN64SDK
175kLdrExeStub-win_INCS := $(PATH_SUB_CURRENT) $(PATH_SUB_ROOT)/include
176kLdrExeStub-win_DEFS = __WIN__
177kLdrExeStub-win_CFLAGS = -W3 -Zl
178kLdrExeStub-win_CFLAGS.debug = -Zi
179kLdrExeStub-win_LDFLAGS = -Entry:WindowsMain -SubSystem:Console -FIXED:NO
180kLdrExeStub-win_LIBS = $(TARGET_kLdr:.dll=.lib)
181kLdrExeStub-win_SOURCES = kLdrExeStub-win.c
182
183
184##
185## The (stub) utility.
186##
187#PROGRAMS = kLdrUtil
188
189
190#
191# Heap testcase.
192#
193#PROGRAMS += tstkLdrHeap
194tstkLdrHeap_TEMPLATE = TST
195tstkLdrHeap_SOURCES = \
196 tstkLdrHeap.c \
197 kHlp.c \
198 kHlpHeap.c \
199 kHlpMem.c \
200 kHlpPath.c \
201 kHlpSem.c \
202 kHlpStr.c \
203
204#
205# Heap testcase.
206#
207PROGRAMS += tstkLdrMod
208tstkLdrMod_TEMPLATE = TST
209tstkLdrMod_SOURCES = \
210 tstkLdrMod.c
211ifeq ($(BUILD_TARGET),win)
212tstkLdrMod_LIBS = $(TARGET_kLdr:.dll=.lib)
213else
214tstkLdrMod_LIBS = $(TARGET_kLdr)
215endif
216
217
218# Generate rules.
219include $(PATH_KBUILD)/subfooter.kmk
220
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