VirtualBox

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

Last change on this file since 22958 was 21515, checked in by vboxsync, 15 years ago

make the headers build cleanly again

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.1 KB
Line 
1# $Id: Makefile.kmk 21515 2009-07-12 19:37:42Z 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 iprt/autores.h \
32 iprt/cpputils.h \
33 iprt/lock.h \
34 $(wildcard iprt/*_cpp.h iprt/*.hpp)
35
36r3_only_hdrs := \
37 VBox/vrdpapi.h \
38 VBox/vrdpusb.h \
39 VBox/VBoxHDD.h \
40 iprt/tcp.h \
41 iprt/localipc.h
42
43hdrs := $(filter-out \
44 VBox/VBoxGuest16.h \
45 VBox/WinNetConfig.h \
46 VBox/usblib-win.h \
47 VBox/usblib-solaris.h, \
48 $(wildcard VBox/*.h iprt/*.h))
49
50hdrs.r3 := $(filter-out , $(hdrs))
51hdrs.r0 := $(filter-out $(cpp_hdrs) $(r3_only_hdrs), $(hdrs))
52hdrs.gc := $(filter-out \
53 VBox/VBoxGuestLib.h \
54 VBox/gvm.h \
55 iprt/thread.h \
56 iprt/mem.h \
57 iprt/alloc.h \
58 $(cpp_hdrs) $(r3_only_hdrs), \
59 $(hdrs))
60
61SyntaxVBoxIncludeR3_TEMPLATE = VBOXMAINEXE
62SyntaxVBoxIncludeR3_DEFS = VBOX_WITH_HGCM
63SyntaxVBoxIncludeR3_SOURCES := \
64 $(addprefix $(PATH_TARGET)/,$(subst .h,-c.c, $(subst /,_,$(hdrs.r3)))) \
65 $(addprefix $(PATH_TARGET)/,$(subst .h,-cpp.cpp, $(subst /,_,$(hdrs.r3))))
66
67SyntaxVBoxIncludeR0_TEMPLATE = VBOXR0
68SyntaxVBoxIncludeR0_DEFS = VBOX_WITH_HGCM
69SyntaxVBoxIncludeR0_SOURCES := \
70 $(addprefix $(PATH_TARGET)/,$(subst .h,-c.c, $(subst /,_,$(hdrs.r0)))) \
71 $(addprefix $(PATH_TARGET)/,$(subst .h,-cpp.cpp, $(subst /,_,$(hdrs.r0))))
72
73SyntaxVBoxIncludeGC_TEMPLATE = VBOXGC
74SyntaxVBoxIncludeGC_DEFS = VBOX_WITH_HGCM
75SyntaxVBoxIncludeGC_SOURCES := \
76 $(addprefix $(PATH_TARGET)/,$(subst .h,-c.c, $(subst /,_,$(hdrs.gc)))) \
77 $(addprefix $(PATH_TARGET)/,$(subst .h,-cpp.cpp, $(subst /,_,$(hdrs.gc))))
78
79
80
81include $(KBUILD_PATH)/footer.kmk
82
83
84define def_hdr
85$(eval flatname := $(subst /,_,$(basename $(hdr))))
86$$(PATH_TARGET)/$(flatname)-cpp.cpp: $$(PATH_TARGET)/
87 $$(APPEND) -t -n $$@ '#include <$(hdr)>' 'int main(int argc, char **argv) {(void)argc; (void)argv; return 0;}'
88
89$$(PATH_TARGET)/$(flatname)-c.c: Makefile.kmk | $$(PATH_TARGET)/
90ifn1of ($(hdr),$(cpp_hdrs))
91 $$(APPEND) -t -n $$@ '#include <$(hdr)>' 'int main(int argc, char **argv) {(void)argc; (void)argv; return 0;}'
92else
93 $$(APPEND) -t -n $$@ 'int main(int argc, char **argv) {(void)argc; (void)argv; return 0;}'
94endif
95
96$(subst .h,.o,$(notdir $(hdr)))::
97 $$(MAKE) -f $(MAKEFILE) $(flatname)-c.o $(flatname)-cpp.o
98
99endef
100
101$(foreach hdr,$(hdrs), $(eval $(def_hdr)))
102
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette