VirtualBox

source: vbox/trunk/include/Makefile.kmk@ 25414

Last change on this file since 25414 was 25347, checked in by vboxsync, 14 years ago

iprt/autores.h -> iprt/cpp/autores.h

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1# $Id: Makefile.kmk 25347 2009-12-13 17:09:31Z vboxsync $
2## @file
3# Some hacks to allow syntax and prerequisite include checking of headers.
4# This makefile doesn't and shouldn't build successfully.
5#
6
7#
8# Copyright (C) 2006-2007 Sun Microsystems, Inc.
9#
10# This file is part of VirtualBox Open Source Edition (OSE), as
11# available from http://www.virtualbox.org. This file is free software;
12# you can redistribute it and/or modify it under the terms of the GNU
13# General Public License (GPL) as published by the Free Software
14# Foundation, in version 2 as it comes in the "COPYING" file of the
15# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17#
18# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
19# Clara, CA 95054 USA or visit http://www.sun.com if you need
20# additional information or have any questions.
21#
22
23DEPTH = ..
24include $(KBUILD_PATH)/header.kmk
25
26LIBRARIES = SyntaxVBoxIncludeR3 SyntaxVBoxIncludeR0 SyntaxVBoxIncludeGC
27
28cpp_hdrs := \
29 VBox/dbggui.h \
30 VBox/settings.h \
31 $(wildcard iprt/*_cpp.h iprt/cpp/*.h )
32
33r3_only_hdrs := \
34 VBox/vrdpapi.h \
35 VBox/vrdpusb.h \
36 VBox/VBoxHDD.h \
37 iprt/tcp.h \
38 iprt/localipc.h
39
40hdrs := $(filter-out \
41 VBox/VBoxGuest16.h \
42 VBox/WinNetConfig.h \
43 VBox/usblib-win.h \
44 VBox/usblib-solaris.h, \
45 $(wildcard VBox/*.h iprt/*.h iprt/*/*.h))
46
47hdrs.r3 := $(filter-out , $(hdrs))
48hdrs.r0 := $(filter-out $(cpp_hdrs) $(r3_only_hdrs), $(hdrs))
49hdrs.gc := $(filter-out \
50 VBox/VBoxGuestLib.h \
51 VBox/gvm.h \
52 iprt/thread.h \
53 iprt/mem.h \
54 iprt/alloc.h \
55 $(cpp_hdrs) $(r3_only_hdrs), \
56 $(hdrs))
57
58SyntaxVBoxIncludeR3_TEMPLATE = VBOXMAINEXE
59SyntaxVBoxIncludeR3_DEFS = VBOX_WITH_HGCM
60SyntaxVBoxIncludeR3_SOURCES := \
61 $(addprefix $(PATH_TARGET)/,$(subst .h,-c.c, $(subst /,_,$(hdrs.r3)))) \
62 $(addprefix $(PATH_TARGET)/,$(subst .h,-cpp.cpp, $(subst /,_,$(hdrs.r3))))
63
64SyntaxVBoxIncludeR0_TEMPLATE = VBOXR0
65SyntaxVBoxIncludeR0_DEFS = VBOX_WITH_HGCM
66SyntaxVBoxIncludeR0_SOURCES := \
67 $(addprefix $(PATH_TARGET)/,$(subst .h,-c.c, $(subst /,_,$(hdrs.r0)))) \
68 $(addprefix $(PATH_TARGET)/,$(subst .h,-cpp.cpp, $(subst /,_,$(hdrs.r0))))
69
70SyntaxVBoxIncludeGC_TEMPLATE = VBOXGC
71SyntaxVBoxIncludeGC_DEFS = VBOX_WITH_HGCM
72SyntaxVBoxIncludeGC_SOURCES := \
73 $(addprefix $(PATH_TARGET)/,$(subst .h,-c.c, $(subst /,_,$(hdrs.gc)))) \
74 $(addprefix $(PATH_TARGET)/,$(subst .h,-cpp.cpp, $(subst /,_,$(hdrs.gc))))
75
76
77
78include $(KBUILD_PATH)/footer.kmk
79
80
81define def_hdr
82$(eval flatname := $(subst /,_,$(basename $(hdr))))
83$$(PATH_TARGET)/$(flatname)-cpp.cpp: $$(PATH_TARGET)/
84 $$(APPEND) -t -n $$@ '#include <$(hdr)>' 'int main(int argc, char **argv) {(void)argc; (void)argv; return 0;}'
85
86$$(PATH_TARGET)/$(flatname)-c.c: Makefile.kmk | $$(PATH_TARGET)/
87ifn1of ($(hdr),$(cpp_hdrs))
88 $$(APPEND) -t -n $$@ '#include <$(hdr)>' 'int main(int argc, char **argv) {(void)argc; (void)argv; return 0;}'
89else
90 $$(APPEND) -t -n $$@ 'int main(int argc, char **argv) {(void)argc; (void)argv; return 0;}'
91endif
92
93$(subst .h,.o,$(notdir $(hdr)))::
94 $$(MAKE) -f $(MAKEFILE) $(flatname)-c.o $(flatname)-cpp.o
95
96endef
97
98$(foreach hdr,$(hdrs), $(eval $(def_hdr)))
99
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use