VirtualBox

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

Last change on this file since 509 was 1, checked in by vboxsync, 55 years ago

import

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.0 KB
Line 
1#
2# Some hacks to allow syntax and prerequisite include checking of headers.
3# This makefile doesn't and shouldn't build successfully.
4#
5
6#
7# Copyright (C) 2006 InnoTek Systemberatung GmbH
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License as published by the Free Software Foundation,
13# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14# distribution. VirtualBox OSE is distributed in the hope that it will
15# be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17# If you received this file as part of a commercial VirtualBox
18# distribution, then only the terms of your commercial VirtualBox
19# license agreement apply instead of the previous paragraph.
20#
21
22DEPTH = ..
23include $(PATH_KBUILD)/header.kmk
24
25LIBRARIES = SyntaxVBoxIncludeR3 SyntaxVBoxIncludeR0 SyntaxVBoxIncludeGC
26
27hdrs := $(wildcard VBox/*.h iprt/*.h)
28
29SyntaxVBoxIncludeR3_TEMPLATE = VBOXR3
30SyntaxVBoxIncludeR3_SOURCES := \
31 $(addprefix $(PATH_TARGET)/,$(subst .h,-c.c, $(subst /,_,$(hdrs)))) \
32 $(addprefix $(PATH_TARGET)/,$(subst .h,-cpp.cpp, $(subst /,_,$(hdrs))))
33
34SyntaxVBoxIncludeR0_TEMPLATE = VBOXR0
35SyntaxVBoxIncludeR0_SOURCES = $(SyntaxVBoxIncludeR3_SOURCES)
36
37SyntaxVBoxIncludeGC_TEMPLATE = VBOXGC
38SyntaxVBoxIncludeGC_SOURCES = $(SyntaxVBoxIncludeR3_SOURCES)
39
40
41
42include $(PATH_KBUILD)/footer.kmk
43
44
45define def_hdr
46$(eval flatname := $(subst /,_,$(basename $(hdr))))
47$$(PATH_TARGET)/$(flatname)-cpp.cpp:
48 $$(MKDIR) -p $$(dir $$@)
49 $$(RM) -f $$@
50 $$(APPEND) $$@ "#include <$(hdr)>"
51 $$(APPEND) $$@ "int main(int argc, char **argv) {(void)argc; (void)argv; return 0;}"
52
53$$(PATH_TARGET)/$(flatname)-c.c:
54 $$(MKDIR) -p $$(dir $$@)
55 $$(RM) -f $$@
56 $$(APPEND) $$@ "#include <$(hdr)>"
57 $$(APPEND) $$@ "int main(int argc, char **argv) {(void)argc; (void)argv; return 0;}"
58
59$(subst .h,.o,$(notdir $(hdr)))::
60 $$(MAKE) -f $(MAKEFILE) $(flatname)-c.o $(flatname)-cpp.o
61
62endef
63
64$(foreach hdr,$(hdrs), $(eval $(def_hdr)))
65
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