VirtualBox

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

Last change on this file since 6000 was 5999, checked in by vboxsync, 17 years ago

The Giant CDDL Dual-License Header Change.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
1# $Id: Makefile.kmk 5999 2007-12-07 15:05:06Z 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 (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
19DEPTH = ..
20include $(PATH_KBUILD)/header.kmk
21
22LIBRARIES = SyntaxVBoxIncludeR3 SyntaxVBoxIncludeR0 SyntaxVBoxIncludeGC
23
24hdrs := $(wildcard VBox/*.h iprt/*.h)
25
26SyntaxVBoxIncludeR3_TEMPLATE = VBOXR3
27SyntaxVBoxIncludeR3_SOURCES := \
28 $(addprefix $(PATH_TARGET)/,$(subst .h,-c.c, $(subst /,_,$(hdrs)))) \
29 $(addprefix $(PATH_TARGET)/,$(subst .h,-cpp.cpp, $(subst /,_,$(hdrs))))
30
31SyntaxVBoxIncludeR0_TEMPLATE = VBOXR0
32SyntaxVBoxIncludeR0_SOURCES = $(SyntaxVBoxIncludeR3_SOURCES)
33
34SyntaxVBoxIncludeGC_TEMPLATE = VBOXGC
35SyntaxVBoxIncludeGC_SOURCES = $(SyntaxVBoxIncludeR3_SOURCES)
36
37
38
39include $(PATH_KBUILD)/footer.kmk
40
41
42define def_hdr
43$(eval flatname := $(subst /,_,$(basename $(hdr))))
44$$(PATH_TARGET)/$(flatname)-cpp.cpp:
45 $$(MKDIR) -p $$(dir $$@)
46 $$(RM) -f $$@
47 $$(APPEND) $$@ "#include <$(hdr)>"
48 $$(APPEND) $$@ "int main(int argc, char **argv) {(void)argc; (void)argv; return 0;}"
49
50$$(PATH_TARGET)/$(flatname)-c.c:
51 $$(MKDIR) -p $$(dir $$@)
52 $$(RM) -f $$@
53 $$(APPEND) $$@ "#include <$(hdr)>"
54 $$(APPEND) $$@ "int main(int argc, char **argv) {(void)argc; (void)argv; return 0;}"
55
56$(subst .h,.o,$(notdir $(hdr)))::
57 $$(MAKE) -f $(MAKEFILE) $(flatname)-c.o $(flatname)-cpp.o
58
59endef
60
61$(foreach hdr,$(hdrs), $(eval $(def_hdr)))
62
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