VirtualBox

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

Last change on this file since 3257 was 2981, checked in by vboxsync, 17 years ago

InnoTek -> innotek: all the headers and comments.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.0 KB
Line 
1# $Id: Makefile.kmk 2981 2007-06-01 16:01:28Z 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 innotek GmbH
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 as published by the Free Software Foundation,
14# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
15# distribution. VirtualBox OSE is distributed in the hope that it will
16# be useful, but WITHOUT ANY WARRANTY of any kind.
17#
18# If you received this file as part of a commercial VirtualBox
19# distribution, then only the terms of your commercial VirtualBox
20# license agreement apply instead of the previous paragraph.
21#
22
23DEPTH = ..
24include $(PATH_KBUILD)/header.kmk
25
26LIBRARIES = SyntaxVBoxIncludeR3 SyntaxVBoxIncludeR0 SyntaxVBoxIncludeGC
27
28hdrs := $(wildcard VBox/*.h iprt/*.h)
29
30SyntaxVBoxIncludeR3_TEMPLATE = VBOXR3
31SyntaxVBoxIncludeR3_SOURCES := \
32 $(addprefix $(PATH_TARGET)/,$(subst .h,-c.c, $(subst /,_,$(hdrs)))) \
33 $(addprefix $(PATH_TARGET)/,$(subst .h,-cpp.cpp, $(subst /,_,$(hdrs))))
34
35SyntaxVBoxIncludeR0_TEMPLATE = VBOXR0
36SyntaxVBoxIncludeR0_SOURCES = $(SyntaxVBoxIncludeR3_SOURCES)
37
38SyntaxVBoxIncludeGC_TEMPLATE = VBOXGC
39SyntaxVBoxIncludeGC_SOURCES = $(SyntaxVBoxIncludeR3_SOURCES)
40
41
42
43include $(PATH_KBUILD)/footer.kmk
44
45
46define def_hdr
47$(eval flatname := $(subst /,_,$(basename $(hdr))))
48$$(PATH_TARGET)/$(flatname)-cpp.cpp:
49 $$(MKDIR) -p $$(dir $$@)
50 $$(RM) -f $$@
51 $$(APPEND) $$@ "#include <$(hdr)>"
52 $$(APPEND) $$@ "int main(int argc, char **argv) {(void)argc; (void)argv; return 0;}"
53
54$$(PATH_TARGET)/$(flatname)-c.c:
55 $$(MKDIR) -p $$(dir $$@)
56 $$(RM) -f $$@
57 $$(APPEND) $$@ "#include <$(hdr)>"
58 $$(APPEND) $$@ "int main(int argc, char **argv) {(void)argc; (void)argv; return 0;}"
59
60$(subst .h,.o,$(notdir $(hdr)))::
61 $$(MAKE) -f $(MAKEFILE) $(flatname)-c.o $(flatname)-cpp.o
62
63endef
64
65$(foreach hdr,$(hdrs), $(eval $(def_hdr)))
66
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