source: trunk/kLdr/Makefile.kmk@ 2954

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

implemented kldrModMachOPreParseLoadCommands

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