source: trunk/kLdr/Makefile.kmk@ 2953

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

Mach-O in process (very early).

  • Property svn:keywords set to Id
File size: 4.6 KB
Line 
1# $Id: Makefile.kmk 2952 2007-01-30 03:02:06Z bird $# $Id: Makefile.kmk 2952 2007-01-30 03:02:06Z bird $
2## @file
3#
4# kBuild Makefile for the kLdr.
5#
6# Copyright (c) 2006 knut st. osmundsen <bird@anduin.net>
7#
8#
9# This file is part of kLdr.
10#
11# kLdr 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# kLdr 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 kLdr; if not, write to the Free Software
23# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24#
25#
26
27
28DEPTH = ..
29include $(PATH_KBUILD)/header.kmk
30
31DEFAULT_PASSES := $(filter-out PACKING, $(DEFAULT_PASSES)) # annoying on windows.
32
33#
34# Template for testcases.
35#
36TEMPLATE_TST = Testcase template
37ifneq ($(filter win nt win32 win64,$(BUILD_TARGET)),)
38 TEMPLATE_TST_TOOL = VCC70
39 TEMPLATE_TST_CFLAGS = -W3 -Zi -Zl -MD
40 TEMPLATE_TST_CFLAGS.release = -O2
41 TEMPLATE_TST_ASFLAGS = -f win
42 TEMPLATE_TST_DEFS = __WIN__
43 TEMPLATE_SDKS.x86 = WIN32SDK W2K3DDKX86
44 TEMPLATE_SDKS.amd64 = WIN64SDK W2K3DDKAMD64
45
46## @todo this is a kBuild bug? $$(PATH_TOOL_VCC70_LIB)
47 TEMPLATE_TST_LIBS = \
48 $$(PATH_TOOL_VCC70_LIB)/msvcrt.lib
49else
50 ifneq ($(filter os2,$(BUILD_TARGET)),)
51 TEMPLATE_TST_TOOL = GCC3OMF
52 TEMPLATE_TST_ASFLAGS = -f obj
53 TEMPLATE_TST_LIBS = os2 gcc end
54 else
55 TEMPLATE_TST_TOOL = GCC3
56 TEMPLATE_TST_ASFLAGS = -f elf
57 TEMPLATE_TST_LIBS = gcc
58 endif
59 TEMPLATE_TST_CFLAGS = -Wall -pedantic -g -std=gnu99
60 TEMPLATE_TST_CFLAGS.release = -O2
61 TEMPLATE_TST_LDFLAGS =
62endif
63TEMPLATE_TST_INCS = .
64
65
66#
67# The kLdr DLL.
68#
69DLLS = kLdr
70kLdr_ASTOOL = NASM
71ifneq ($(filter win nt win32 win64,$(BUILD_TARGET)),)
72 kLdr_TOOL = GCC3
73 kLdr_TOOL = VCC70
74 kLdr_CFLAGS = -W3 -Zl -ML
75 kLdr_ASFLAGS = -f win
76 kLdr_LDFLAGS = -Entry:DllMain@12 -Debug
77 kLdr_DEFS = __WIN__
78 kLdr_SDKS.x86 = WIN32SDK W2K3DDKX86
79 kLdr_SDKS.amd64 = WIN64SDK W2K3DDKAMD64
80 kLdr_LIBS = \
81 $(PATH_TOOL_VCC70_LIB)/LIBC.lib \
82 $(PATH_SDK_W2K3DDKX86_LIB)/ntdll.lib
83else
84 ifneq ($(filter os2,$(BUILD_TARGET)),)
85 kLdr_TOOL = GCC3OMF
86 kLdr_ASFLAGS = -f obj
87 kLdr_LIBS = os2 gcc end
88 else
89 kLdr_TOOL = GCC3
90 kLdr_ASFLAGS = -f elf
91 kLdr_LIBS = gcc
92 endif
93 kLdr_CFLAGS = -Wall -pedantic
94 kLdr_LDFLAGS = -nostdlib
95endif
96kLdr_INCS = .
97kLdr_SOURCES = \
98 kLdr.c \
99 kLdrDyld.c \
100 kLdrDyldFind.c \
101 kLdrDyldMod.c \
102 kLdrDyldOS.c \
103 kLdrHlp.c \
104 kLdrHlpHeap.c \
105 kLdrHlpMem.c \
106 kLdrHlpPath.c \
107 kLdrHlpSem.c \
108 kLdrHlpStr.c \
109 kLdrMisc.c \
110 kLdrRdr.c \
111 kLdrRdrFile.c \
112 kLdrMod.c \
113 kLdrModLX.c \
114 kLdrModPE.c \
115 kLdrModMachO.c \
116 kLdrModNative.c
117kLdr_SOURCES.os2 = \
118 kLdr-os2.def \
119 kLdr-os2.c \
120 kLdrHlp-gcc.c \
121 kLdrA-os2.asm
122kLdr_SOURCES.win = \
123 kLdr-win.def \
124 kLdr-win.c
125kLdr_SOURCES.win32 = $(kLdr_SOURCES.win)
126kLdr_SOURCES.win64 = $(kLdr_SOURCES.win)
127
128#
129# The OS/2 stub program.
130#
131PROGRAMS.os2 = kLdrExeStub-os2
132kLdrExeStub-os2_TOOL = GCC3OMF
133kLdrExeStub-os2_ASTOOL = NASM
134kLdrExeStub-os2_ASFLAGS = -f obj
135#kLdrExeStub-os2_LDFLAGS = -nostdlib
136kLdrExeStub-os2_LDFLAGS = -nostdlib -Zstack 64
137kLdrExeStub-os2_LIBS = $(TARGET_kLdr)
138#kLdrExeStub-os2_SOURCES = kLdrExeStub-os2.asm
139kLdrExeStub-os2_SOURCES = kLdrExeStub-os2A.asm kLdrExeStub-os2.c
140
141#
142# The Windows stub program.
143#
144PROGRAMS.win = kLdrExeStub-win
145PROGRAMS.win32 = kLdrExeStub-win
146PROGRAMS.win64 = kLdrExeStub-win
147kLdrExeStub-win_TOOL = VCC70
148kLdrExeStub-win_SDKS = WIN32SDK
149kLdrExeStub-win_INCS = .
150kLdrExeStub-win_DEFS = __WIN__
151kLdrExeStub-win_CFLAGS = -W3 -Zl
152kLdrExeStub-win_CFLAGS.debug = -Zi
153kLdrExeStub-win_LDFLAGS = -Entry:WindowsMain -SubSystem:Console -FIXED:NO
154kLdrExeStub-win_LIBS = $(TARGET_kLdr:.dll=.lib)
155kLdrExeStub-win_SOURCES = kLdrExeStub-win.c
156
157
158##
159## The (stub) utility.
160##
161#PROGRAMS = kLdrUtil
162
163
164#
165# Heap testcase.
166#
167PROGRAMS += tstkLdrHeap
168tstkLdrHeap_TEMPLATE = TST
169tstkLdrHeap_SOURCES = \
170 tstkLdrHeap.c \
171 kLdrHlp.c \
172 kLdrHlpHeap.c \
173 kLdrHlpMem.c \
174 kLdrHlpPath.c \
175 kLdrHlpSem.c \
176 kLdrHlpStr.c \
177
178#
179# Heap testcase.
180#
181PROGRAMS += tstkLdrMod
182tstkLdrMod_TEMPLATE = TST
183tstkLdrMod_SOURCES = \
184 tstkLdrMod.c
185ifneq ($(filter win win32 win64 nt,$(BUILD_TARGET)),)
186tstkLdrMod_LIBS = $(TARGET_kLdr:.dll=.lib)
187else
188tstkLdrMod_LIBS = $(TARGET_kLdr)
189endif
190
191
192
193# generate rules.
194include $(PATH_KBUILD)/footer.kmk
195
Note: See TracBrowser for help on using the repository browser.