| [2826] | 1 | # $Id: Makefile.kmk 2827 2006-10-22 18:05:28Z bird $# $Id: Makefile.kmk 2827 2006-10-22 18:05:28Z 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 |
|
|---|
| 28 | #
|
|---|
| [2825] | 29 | # Template for testcases.
|
|---|
| 30 | #
|
|---|
| 31 | TEMPLATE_TST = Testcase template
|
|---|
| 32 | ifneq ($(filter win nt win32 win64,$(BUILD_TARGET)),)
|
|---|
| 33 | TEMPLATE_TST_TOOL = VCC70
|
|---|
| 34 | TEMPLATE_TST_CFLAGS = -W3 -Zi -Zl -MD
|
|---|
| 35 | TEMPLATE_TST_CFLAGS.release = -O2
|
|---|
| 36 | TEMPLATE_TST_ASFLAGS = -f win
|
|---|
| 37 | TEMPLATE_TST_DEFS = __WIN__
|
|---|
| 38 | TEMPLATE_TST_SDKS = WIN32SDK
|
|---|
| 39 | #kLdr_SDKS.x86 = WIN32SDK
|
|---|
| 40 | #kLdr_SDKS.amd64 = WIN64SDK
|
|---|
| 41 |
|
|---|
| 42 | ## @todo this is a kBuild bug!
|
|---|
| 43 | TEMPLATE_TST_LIBS = \
|
|---|
| 44 | $$(PATH_TOOL_VCC70_LIB)/msvcrt.lib
|
|---|
| 45 | else
|
|---|
| 46 | ifneq ($(filter os2,$(BUILD_TARGET)),)
|
|---|
| 47 | TEMPLATE_TST_TOOL = GCC3OMF
|
|---|
| 48 | TEMPLATE_TST_ASFLAGS = -f obj
|
|---|
| 49 | TEMPLATE_TST_LIBS = os2 gcc end
|
|---|
| 50 | else
|
|---|
| 51 | TEMPLATE_TST_TOOL = GCC3
|
|---|
| 52 | TEMPLATE_TST_ASFLAGS = -f elf
|
|---|
| 53 | TEMPLATE_TST_LIBS = gcc
|
|---|
| 54 | endif
|
|---|
| 55 | TEMPLATE_TST_CFLAGS = -Wall -pedantic -g
|
|---|
| 56 | TEMPLATE_TST_CFLAGS.release = -O2
|
|---|
| 57 | TEMPLATE_TST_LDFLAGS =
|
|---|
| 58 | endif
|
|---|
| 59 | TEMPLATE_TST_INCS = .
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 | #
|
|---|
| 63 | # The kLdr DLL.
|
|---|
| 64 | #
|
|---|
| [2821] | 65 | DLLS = kLdr
|
|---|
| 66 | kLdr_ASTOOL = NASM
|
|---|
| [2825] | 67 | ifneq ($(filter win nt win32 win64,$(BUILD_TARGET)),)
|
|---|
| 68 | kLdr_TOOL = GCC3
|
|---|
| 69 | kLdr_TOOL = VCC70
|
|---|
| 70 | kLdr_CFLAGS = -W3 -Zl
|
|---|
| 71 | kLdr_ASFLAGS = -f win
|
|---|
| 72 | kLdr_DEFS = __WIN__
|
|---|
| 73 | kLdr_SDKS = WIN32SDK
|
|---|
| 74 | #kLdr_SDKS.x86 = WIN32SDK
|
|---|
| 75 | #kLdr_SDKS.amd64 = WIN64SDK
|
|---|
| 76 | else
|
|---|
| 77 | ifneq ($(filter os2,$(BUILD_TARGET)),)
|
|---|
| 78 | kLdr_TOOL = GCC3OMF
|
|---|
| 79 | kLdr_ASFLAGS = -f obj
|
|---|
| 80 | kLdr_LIBS = os2 gcc end
|
|---|
| 81 | else
|
|---|
| 82 | kLdr_TOOL = GCC3
|
|---|
| 83 | kLdr_ASFLAGS = -f elf
|
|---|
| 84 | kLdr_LIBS = gcc
|
|---|
| 85 | endif
|
|---|
| 86 | kLdr_CFLAGS = -Wall -pedantic
|
|---|
| 87 | kLdr_LDFLAGS = -nostdlib
|
|---|
| 88 | endif
|
|---|
| 89 | kLdr_INCS = .
|
|---|
| [2821] | 90 | kLdr_SOURCES = \
|
|---|
| 91 | kLdr.c \
|
|---|
| [2825] | 92 | kLdrHlp.c \
|
|---|
| 93 | kLdrHlpHeap.c \
|
|---|
| 94 | kLdrRdr.c \
|
|---|
| 95 | kLdrRdrFile.c \
|
|---|
| [2827] | 96 | kLdrMod.c \
|
|---|
| 97 | kLdrModLX.c
|
|---|
| [2821] | 98 | kLdr_SOURCES.os2 = \
|
|---|
| 99 | kLdr-os2.def \
|
|---|
| 100 | kLdrA-os2.asm
|
|---|
| 101 |
|
|---|
| 102 | #
|
|---|
| 103 | # The OS/2 stub program.
|
|---|
| [2825] | 104 | #
|
|---|
| 105 | PROGRAMS.os2 = kLdrExeStub-os2
|
|---|
| [2821] | 106 | kLdrExeStub-os2_TOOL = GCC3OMF
|
|---|
| 107 | kLdrExeStub-os2_ASTOOL = NASM
|
|---|
| 108 | kLdrExeStub-os2_ASFLAGS = -f obj
|
|---|
| 109 | kLdrExeStub-os2_LDFLAGS = -nostdlib
|
|---|
| 110 | kLdrExeStub-os2_LIBS = $(TARGET_kLdr)
|
|---|
| 111 | kLdrExeStub-os2_SOURCES = kLdrExeStub-os2.asm
|
|---|
| [2825] | 112 |
|
|---|
| [2821] | 113 | ##
|
|---|
| 114 | ## The (stub) utility.
|
|---|
| [2825] | 115 | ##
|
|---|
| [2821] | 116 | #PROGRAMS = kLdrUtil
|
|---|
| 117 |
|
|---|
| [2825] | 118 |
|
|---|
| 119 | #
|
|---|
| 120 | # Heap testcase.
|
|---|
| 121 | #
|
|---|
| 122 | PROGRAMS += tstkLdrHeap
|
|---|
| 123 | tstkLdrHeap_TEMPLATE = TST
|
|---|
| 124 | tstkLdrHeap_SOURCES = \
|
|---|
| 125 | tstkLdrHeap.c \
|
|---|
| 126 | kLdrHlp.c \
|
|---|
| 127 | kLdrHlpHeap.c \
|
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| [2821] | 130 | # generate rules.
|
|---|
| 131 | DEPTH = ..
|
|---|
| 132 | include $(PATH_KBUILD)/rules.kmk
|
|---|
| 133 |
|
|---|