source: trunk/kProfiler2/Makefile.kmk@ 6

Last change on this file since 6 was 5, checked in by bird, 18 years ago

Fixed DEPTH now that we're no longer in the kLIBC repository.

  • Property svn:keywords set to Id Revision
File size: 4.3 KB
Line 
1# $Id: Makefile.kmk 5 2008-02-03 20:56:09Z bird $
2## @file
3# kProfiler Mark 2, sub-makefile.
4#
5
6#
7# Copyright (c) 2006-2007 knut st. osmundsen <bird-src-spam@anduin.net>
8#
9# This file is part of kProfiler.
10#
11# kProfiler is free software; you can redistribute it and/or
12# modify it under the terms of the GNU Lesser General Public
13# License as published by the Free Software Foundation; either
14# version 2.1 of the License, or (at your option) any later version.
15#
16# kProfiler 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 GNU
19# Lesser General Public License for more details.
20#
21# You should have received a copy of the GNU Lesser General Public
22# License along with kProfiler; if not, write to the Free Software
23# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24#
25
26
27DEPTH ?= ..
28SUB_DEPTH = ..
29include $(PATH_KBUILD)/subheader.kmk
30
31#LIBRARIES += kPrf2GC kPrf2R0
32DLLS += kPrf2
33PROGRAMS += kPrf2Read
34
35
36#
37# Our template.
38#
39TEMPLATE_kPrf2 = kProfiler Template
40TEMPLATE_kPrf2_TOOL = GCC3
41TEMPLATE_kPrf2_TOOL.os2 = GCC3OMF
42TEMPLATE_kPrf2_TOOL.win.x86 = VCC70
43TEMPLATE_kPrf2_TOOL.win.amd64 = VCC80AMD64
44TEMPLATE_kPrf2_ASTOOL = YASM
45TEMPLATE_kPrf2_ASTOOL.os2 = NASM
46
47TEMPLATE_kPrf2_SDKS.win = WINPSDK
48
49TEMPLATE_kPrf2_DEFS.freebsd = KPRF_OS_FREEBSD
50TEMPLATE_kPrf2_DEFS.linux = KPRF_OS_LINUX
51TEMPLATE_kPrf2_DEFS.os2 = KPRF_OS_OS2
52TEMPLATE_kPrf2_DEFS.win = KPRF_OS_WINDOWS
53
54TEMPLATE_kPrf2_CXXFLAGS.freebsd = -g
55TEMPLATE_kPrf2_CXXFLAGS.linux = -g
56TEMPLATE_kPrf2_CXXFLAGS.os2 = -g
57TEMPLATE_kPrf2_CXXFLAGS.win = -Zi -Zl -MD -W3 -GF -GR-
58TEMPLATE_kPrf2_CXXFLAGS.win.amd64 = -GS- #-FAcs
59ifneq ($(BUILD_TYPE),debug)
60TEMPLATE_kPrf2_CXXFLAGS.freebsd+= -O3
61TEMPLATE_kPrf2_CXXFLAGS.linux += -O3
62TEMPLATE_kPrf2_CXXFLAGS.os2 += -O3
63TEMPLATE_kPrf2_CXXFLAGS.win += -O2xtg -Oi -Ob2
64endif
65
66TEMPLATE_kPrf2_ASFLAGS.freebsd = -f elf
67TEMPLATE_kPrf2_ASFLAGS.linux = -f elf
68TEMPLATE_kPrf2_ASFLAGS.os2 = -f omf
69TEMPLATE_kPrf2_ASFLAGS.win.x86 = -f win32 -g cv8
70TEMPLATE_kPrf2_ASFLAGS.win.amd64 = -f win64 -g cv8
71
72TEMPLATE_kPrf2_INCS = \
73 ../include
74
75TEMPLATE_kPrf2_LDFLAGS.freebsd = -g
76TEMPLATE_kPrf2_LDFLAGS.linux = -g
77TEMPLATE_kPrf2_LDFLAGS.os2 = -g
78TEMPLATE_kPrf2_LDFLAGS.win = /DEBUG
79
80TEMPLATE_kPrf2_LIBS.freebsd =
81TEMPLATE_kPrf2_LIBS.linux =
82TEMPLATE_kPrf2_LIBS.os2 =
83TEMPLATE_kPrf2_LIBS.win = \
84 $(PATH_SDK_WINPSDK_LIB)/psapi.Lib
85TEMPLATE_kPrf2_LIBS.win.x86 = \
86 $(PATH_TOOL_VCC70_LIB)/msvcrt.lib \
87 $(PATH_TOOL_VCC70_LIB)/msvcprt.lib \
88 $(PATH_TOOL_VCC70_LIB)/oldnames.lib
89
90
91#
92# kPrf2 - The profiler module.
93#
94kPrf2_TEMPLATE = kPrf2
95kPrf2_DEFS.x86 = KPRF_BITS=32
96kPrf2_DEFS.amd64 = KPRF_BITS=64
97kPrf2_LDFLAGS.win.amd64 = -Entry:DllMain
98
99kPrf2_SOURCES = \
100 kProfileR3.cpp
101# kProfileGC.cpp
102# kProfileR0.cpp
103
104kPrf2_SOURCES.win = \
105 dllmain-win.cpp \
106 prf$(BUILD_TARGET_ARCH)msc.asm \
107 kPrf2-win-$(BUILD_TARGET_ARCH).def
108prfx86msc.asm_DEFS.win.x86 = \
109 KPRF_ENTER=_KPrfEnter \
110 KPRF_LEAVE=_KPrfLeave
111prfamd64msc.asm_DEFS.win.amd64 = \
112 KPRF_ENTER=KPrfEnter \
113 KPRF_LEAVE=KPrfLeave
114
115#
116# kPrf2Read - The read & producer of statistics.
117#
118#kPrf2Read_TEMPLATE = kPrf2
119kPrf2Read_TEMPLATE = kStuffEXE
120kPrf2Read_SOURCES = \
121 kPrf2Read.cpp
122kPrf2Read_LIBS = \
123 $(PATH_LIB)/kDbgStatic$(SUFF_LIB) \
124 $(PATH_LIB)/kRdrStatic$(SUFF_LIB) \
125 $(PATH_LIB)/kHlpCRTStatic$(SUFF_LIB)
126
127
128#
129# A simple testcase.
130#
131PROGRAMS.win.x86 += tst
132tst_TOOL = VCC70
133tst_SDKS = WINPSDK
134tst_CFLAGS = -GH -Gh -Zi -Zl -GR- -GX- -GF- -MD -W3 -wd4244
135tst_SOURCES = tst.c
136tst.c_CFLAGS = -Od
137tst_LDFLAGS = /DEBUG
138tst_LIBS = \
139 $(PATH_TOOL_VCC70_LIB)/msvcrt.lib \
140 $(PATH_TOOL_VCC70_LIB)/msvcprt.lib \
141 $(PATH_TOOL_VCC70_LIB)/oldnames.lib \
142 $(PATH_kPrf2)/kPrf2.lib
143
144PROGRAMS += tstlongjmp
145tstlongjmp_TEMPLATE = kStuffEXE
146tstlongjmp_CFLAGS.win = -GH -Gh -Zi
147tstlongjmp_SOURCES = tstlongjmp.c
148tstlongjmp_LIBS = \
149 $(PATH_kPrf2)/kPrf2.lib
150
151# Generate the rules
152include $(PATH_KBUILD)/subfooter.kmk
153
154
155#
156# Aliases for .cpp.h files so we can more easily do syntax checking from the editor.
157#
158CORE := $(wildcard *core*.cpp.h *core*.h.h)
159$(CORE:.h=.o) $(CORE:.h=.obj) : kProfileR3.o
160
161READ := $(wildcard *read*.cpp.h *read*.h.h)
162$(READ:.h=.o) $(READ:.h=.obj) : kPrf2Read.o
163
Note: See TracBrowser for help on using the repository browser.