File: Makefile.kmk

package info (click to toggle)
virtualbox-ose 1.6.6-dfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 91,740 kB
  • ctags: 207,046
  • sloc: ansic: 541,507; cpp: 462,042; asm: 22,594; sh: 8,644; makefile: 6,630; perl: 1,359; objc: 612; xml: 524; sed: 229; cs: 226; python: 34
file content (103 lines) | stat: -rw-r--r-- 3,106 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# $Id: Makefile.kmk 30740 2008-05-11 18:39:30Z bird $
## @file
# Some hacks to allow syntax and prerequisite include checking of headers.
# This makefile doesn't and shouldn't build successfully.
#

#
# Copyright (C) 2006-2007 Sun Microsystems, Inc.
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
# Clara, CA 95054 USA or visit http://www.sun.com if you need
# additional information or have any questions.
#

DEPTH = ..
include $(KBUILD_PATH)/header.kmk

LIBRARIES = SyntaxVBoxIncludeR3 SyntaxVBoxIncludeR0 SyntaxVBoxIncludeGC

cpp_hdrs := \
	VBox/dbggui.h \
	VBox/settings.h \
	iprt/cpputils.h \
	iprt/lock.h

r3_only_hdrs := \
	VBox/vrdpapi.h \
        VBox/vrdpusb.h \
	VBox/VBoxHDD-new.h \
	VBox/VBoxHDD.h \
	iprt/tcp.h \

hdrs := $(filter-out \
	VBox/VBoxGuest16.h \
	VBox/tapwin32.h \
	VBox/usblib-win.h, \
	$(wildcard VBox/*.h iprt/*.h))

hdrs.r3 := $(filter-out VBox/VBoxGuestLib.h, $(hdrs))
hdrs.r0 := $(filter-out $(cpp_hdrs) $(r3_only_hdrs), $(hdrs))
hdrs.gc := $(filter-out \
	VBox/VBoxGuestLib.h \
	VBox/gvm.h \
	iprt/thread.h \
	iprt/mem.h \
	iprt/alloc.h \
	$(cpp_hdrs) $(r3_only_hdrs), \
	$(hdrs))

SyntaxVBoxIncludeR3_TEMPLATE = VBOXMAINEXE
SyntaxVBoxIncludeR3_DEFS = VBOX_HGCM
SyntaxVBoxIncludeR3_SOURCES := \
	$(addprefix $(PATH_TARGET)/,$(subst .h,-c.c,     $(subst /,_,$(hdrs.r3)))) \
	$(addprefix $(PATH_TARGET)/,$(subst .h,-cpp.cpp, $(subst /,_,$(hdrs.r3))))

SyntaxVBoxIncludeR0_TEMPLATE = VBOXR0
SyntaxVBoxIncludeR0_DEFS = VBOX_HGCM
SyntaxVBoxIncludeR0_SOURCES := \
	$(addprefix $(PATH_TARGET)/,$(subst .h,-c.c,     $(subst /,_,$(hdrs.r0)))) \
	$(addprefix $(PATH_TARGET)/,$(subst .h,-cpp.cpp, $(subst /,_,$(hdrs.r0))))

SyntaxVBoxIncludeGC_TEMPLATE = VBOXGC
SyntaxVBoxIncludeGC_DEFS = VBOX_HGCM
SyntaxVBoxIncludeGC_SOURCES := \
	$(addprefix $(PATH_TARGET)/,$(subst .h,-c.c,     $(subst /,_,$(hdrs.gc)))) \
	$(addprefix $(PATH_TARGET)/,$(subst .h,-cpp.cpp, $(subst /,_,$(hdrs.gc))))



include $(KBUILD_PATH)/footer.kmk


define def_hdr
$(eval flatname := $(subst /,_,$(basename $(hdr))))
$$(PATH_TARGET)/$(flatname)-cpp.cpp:
	$$(MKDIR) -p $$(dir $$@)
	$$(RM) -f $$@
	$$(APPEND) $$@ "#include <$(hdr)>"
	$$(APPEND) $$@ "int main(int argc, char **argv) {(void)argc; (void)argv; return 0;}"

$$(PATH_TARGET)/$(flatname)-c.c: Makefile.kmk
	$$(MKDIR) -p $$(dir $$@)
	$$(RM) -f $$@
ifn1of ($(hdr),$(cpp_hdrs))
	$$(APPEND) $$@ "#include <$(hdr)>"
endif
	$$(APPEND) $$@ "int main(int argc, char **argv) {(void)argc; (void)argv; return 0;}"

$(subst .h,.o,$(notdir $(hdr)))::
	$$(MAKE) -f $(MAKEFILE) $(flatname)-c.o $(flatname)-cpp.o

endef

$(foreach hdr,$(hdrs), $(eval $(def_hdr)))