source: trunk/kLdr/Makefile.kmk@ 2859

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

More debugging.

  • Property svn:keywords set to Id
File size: 3.7 KB
Line 
1# $Id: Makefile.kmk 2859 2006-11-06 04:48:53Z bird $# $Id: Makefile.kmk 2859 2006-11-06 04:48:53Z 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
44 #kLdr_SDKS.x86 = WIN32SDK
45 #kLdr_SDKS.amd64 = WIN64SDK
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 kLdr_SDKS = WIN32SDK
80 #kLdr_SDKS.x86 = WIN32SDK
81 #kLdr_SDKS.amd64 = WIN64SDK
82 kLdr_LIBS = \
83 $$(PATH_TOOL_VCC70_LIB)/LIBC.lib
84else
85 ifneq ($(filter os2,$(BUILD_TARGET)),)
86 kLdr_TOOL = GCC3OMF
87 kLdr_ASFLAGS = -f obj
88 kLdr_LIBS = os2 gcc end
89 else
90 kLdr_TOOL = GCC3
91 kLdr_ASFLAGS = -f elf
92 kLdr_LIBS = gcc
93 endif
94 kLdr_CFLAGS = -Wall -pedantic
95 kLdr_LDFLAGS = -nostdlib
96endif
97kLdr_INCS = .
98kLdr_SOURCES = \
99 kLdr.c \
100 kLdrDyld.c \
101 kLdrDyldFind.c \
102 kLdrDyldMod.c \
103 kLdrDyldOS.c \
104 kLdrHlp.c \
105 kLdrHlpHeap.c \
106 kLdrRdr.c \
107 kLdrRdrFile.c \
108 kLdrMod.c \
109 kLdrModLX.c \
110 kLdrModPE.c
111kLdr_SOURCES.os2 = \
112 kLdr-os2.def \
113 kLdrA-os2.asm
114kLdr_SOURCES.win = \
115 kLdr-win.def \
116 kLdr-win.c
117kLdr_SOURCES.win32 = $(kLdr_SOURCES.win)
118kLdr_SOURCES.win64 = $(kLdr_SOURCES.win)
119
120#
121# The OS/2 stub program.
122#
123PROGRAMS.os2 = kLdrExeStub-os2
124kLdrExeStub-os2_TOOL = GCC3OMF
125kLdrExeStub-os2_ASTOOL = NASM
126kLdrExeStub-os2_ASFLAGS = -f obj
127kLdrExeStub-os2_LDFLAGS = -nostdlib
128kLdrExeStub-os2_LIBS = $(TARGET_kLdr)
129kLdrExeStub-os2_SOURCES = kLdrExeStub-os2.asm
130
131##
132## The (stub) utility.
133##
134#PROGRAMS = kLdrUtil
135
136
137#
138# Heap testcase.
139#
140PROGRAMS += tstkLdrHeap
141tstkLdrHeap_TEMPLATE = TST
142tstkLdrHeap_SOURCES = \
143 tstkLdrHeap.c \
144 kLdrHlp.c \
145 kLdrHlpHeap.c \
146
147#
148# Heap testcase.
149#
150PROGRAMS += tstkLdrMod
151tstkLdrMod_TEMPLATE = TST
152tstkLdrMod_SOURCES = \
153 tstkLdrMod.c
154ifneq ($(filter win win32 win64 nt,$(BUILD_TARGET)),)
155tstkLdrMod_LIBS = $(TARGET_kLdr:.dll=.lib)
156else
157tstkLdrMod_LIBS = $(TARGET_kLdr)
158endif
159
160
161
162# generate rules.
163include $(PATH_KBUILD)/footer.kmk
164
Note: See TracBrowser for help on using the repository browser.