source: trunk/kLdr/Makefile.kmk@ 2868

Last change on this file since 2868 was 2861, checked in by bird, 19 years ago

Put the PE module interpreter thru the wringer and learnt how much the window file mapping API sucks.

  • Property svn:keywords set to Id
File size: 3.9 KB
Line 
1# $Id: Makefile.kmk 2861 2006-11-10 03:04:42Z bird $# $Id: Makefile.kmk 2861 2006-11-10 03:04:42Z 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_TST_SDKS = WIN32SDK W2K3DDKX86
44 #TEMPLATE_SDKS.x86 = WIN32SDK W2K3DDKX86
45 #TEMPLATE_SDKS.amd64 = WIN64SDK W2K3DDKAMD64
46
47## @todo this is a kBuild bug!
48 TEMPLATE_TST_LIBS = \
49 $$(PATH_TOOL_VCC70_LIB)/msvcrt.lib
50else
51 ifneq ($(filter os2,$(BUILD_TARGET)),)
52 TEMPLATE_TST_TOOL = GCC3OMF
53 TEMPLATE_TST_ASFLAGS = -f obj
54 TEMPLATE_TST_LIBS = os2 gcc end
55 else
56 TEMPLATE_TST_TOOL = GCC3
57 TEMPLATE_TST_ASFLAGS = -f elf
58 TEMPLATE_TST_LIBS = gcc
59 endif
60 TEMPLATE_TST_CFLAGS = -Wall -pedantic -g
61 TEMPLATE_TST_CFLAGS.release = -O2
62 TEMPLATE_TST_LDFLAGS =
63endif
64TEMPLATE_TST_INCS = .
65
66
67#
68# The kLdr DLL.
69#
70DLLS = kLdr
71kLdr_ASTOOL = NASM
72ifneq ($(filter win nt win32 win64,$(BUILD_TARGET)),)
73 kLdr_TOOL = GCC3
74 kLdr_TOOL = VCC70
75 kLdr_CFLAGS = -W3 -Zl -ML
76 kLdr_ASFLAGS = -f win
77 kLdr_LDFLAGS = -Entry:DllMain@12 -Debug
78 kLdr_DEFS = __WIN__
79 # crap, this doesn't work right either:
80 #kLdr_SDKS = WIN32SDK W2K3DDKX86
81 kLdr_SDKS = W2K3DDKX86 WIN32SDK
82 #kLdr_SDKS.x86 = WIN32SDK W2K3DDKX86
83 #kLdr_SDKS.amd64 = WIN64SDK W2K3DDKAMD64
84 kLdr_LIBS = \
85 $$(PATH_TOOL_VCC70_LIB)/LIBC.lib \
86 $(PATH_SDK_W2K3DDKX86_LIB)/ntdll.lib
87else
88 ifneq ($(filter os2,$(BUILD_TARGET)),)
89 kLdr_TOOL = GCC3OMF
90 kLdr_ASFLAGS = -f obj
91 kLdr_LIBS = os2 gcc end
92 else
93 kLdr_TOOL = GCC3
94 kLdr_ASFLAGS = -f elf
95 kLdr_LIBS = gcc
96 endif
97 kLdr_CFLAGS = -Wall -pedantic
98 kLdr_LDFLAGS = -nostdlib
99endif
100kLdr_INCS = .
101kLdr_SOURCES = \
102 kLdr.c \
103 kLdrDyld.c \
104 kLdrDyldFind.c \
105 kLdrDyldMod.c \
106 kLdrDyldOS.c \
107 kLdrHlp.c \
108 kLdrHlpHeap.c \
109 kLdrRdr.c \
110 kLdrRdrFile.c \
111 kLdrMod.c \
112 kLdrModLX.c \
113 kLdrModPE.c
114kLdr_SOURCES.os2 = \
115 kLdr-os2.def \
116 kLdrA-os2.asm
117kLdr_SOURCES.win = \
118 kLdr-win.def \
119 kLdr-win.c
120kLdr_SOURCES.win32 = $(kLdr_SOURCES.win)
121kLdr_SOURCES.win64 = $(kLdr_SOURCES.win)
122
123#
124# The OS/2 stub program.
125#
126PROGRAMS.os2 = kLdrExeStub-os2
127kLdrExeStub-os2_TOOL = GCC3OMF
128kLdrExeStub-os2_ASTOOL = NASM
129kLdrExeStub-os2_ASFLAGS = -f obj
130kLdrExeStub-os2_LDFLAGS = -nostdlib
131kLdrExeStub-os2_LIBS = $(TARGET_kLdr)
132kLdrExeStub-os2_SOURCES = kLdrExeStub-os2.asm
133
134##
135## The (stub) utility.
136##
137#PROGRAMS = kLdrUtil
138
139
140#
141# Heap testcase.
142#
143PROGRAMS += tstkLdrHeap
144tstkLdrHeap_TEMPLATE = TST
145tstkLdrHeap_SOURCES = \
146 tstkLdrHeap.c \
147 kLdrHlp.c \
148 kLdrHlpHeap.c \
149
150#
151# Heap testcase.
152#
153PROGRAMS += tstkLdrMod
154tstkLdrMod_TEMPLATE = TST
155tstkLdrMod_SOURCES = \
156 tstkLdrMod.c
157ifneq ($(filter win win32 win64 nt,$(BUILD_TARGET)),)
158tstkLdrMod_LIBS = $(TARGET_kLdr:.dll=.lib)
159else
160tstkLdrMod_LIBS = $(TARGET_kLdr)
161endif
162
163
164
165# generate rules.
166include $(PATH_KBUILD)/footer.kmk
167
Note: See TracBrowser for help on using the repository browser.