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 |
|
---|
22 | DEPTH = ..
|
---|
23 | include $(PATH_KBUILD)/header.kmk
|
---|
24 |
|
---|
25 | LIBRARIES = SyntaxVBoxIncludeR3 SyntaxVBoxIncludeR0 SyntaxVBoxIncludeGC
|
---|
26 |
|
---|
27 | hdrs := $(wildcard VBox/*.h iprt/*.h)
|
---|
28 |
|
---|
29 | SyntaxVBoxIncludeR3_TEMPLATE = VBOXR3
|
---|
30 | SyntaxVBoxIncludeR3_SOURCES := \
|
---|
31 | $(addprefix $(PATH_TARGET)/,$(subst .h,-c.c, $(subst /,_,$(hdrs)))) \
|
---|
32 | $(addprefix $(PATH_TARGET)/,$(subst .h,-cpp.cpp, $(subst /,_,$(hdrs))))
|
---|
33 |
|
---|
34 | SyntaxVBoxIncludeR0_TEMPLATE = VBOXR0
|
---|
35 | SyntaxVBoxIncludeR0_SOURCES = $(SyntaxVBoxIncludeR3_SOURCES)
|
---|
36 |
|
---|
37 | SyntaxVBoxIncludeGC_TEMPLATE = VBOXGC
|
---|
38 | SyntaxVBoxIncludeGC_SOURCES = $(SyntaxVBoxIncludeR3_SOURCES)
|
---|
39 |
|
---|
40 |
|
---|
41 |
|
---|
42 | include $(PATH_KBUILD)/footer.kmk
|
---|
43 |
|
---|
44 |
|
---|
45 | define 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 |
|
---|
62 | endef
|
---|
63 |
|
---|
64 | $(foreach hdr,$(hdrs), $(eval $(def_hdr)))
|
---|
65 |
|
---|