VirtualBox

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

Last change on this file since 4878 was 4071, checked in by vboxsync, 17 years ago

Biggest check-in ever. New source code headers for all (C) innotek files.

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