Changeset 68676 in vbox
- Timestamp:
- Sep 6, 2017 11:09:36 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile.kmk
r67129 r68676 28 28 endif 29 29 include $(PATH_SUB_CURRENT)/src/Makefile.kmk 30 ifdef VBOX_WITH_INCLUDE_SYNTAX_CHECKING 31 include $(PATH_SUB_CURRENT)/include/Makefile.kmk 32 endif 30 33 endif 31 34 -
trunk/include/Makefile.kmk
r68675 r68676 17 17 # 18 18 19 DEPTH = ..20 include $(KBUILD_PATH)/ header.kmk21 22 LIBRARIES = SyntaxVBoxIncludeR3 SyntaxVBoxIncludeR0 SyntaxVBoxIncludeRC19 SUB_DEPTH = .. 20 include $(KBUILD_PATH)/subheader.kmk 21 22 LIBRARIES += SyntaxVBoxIncludeR3 SyntaxVBoxIncludeR0 SyntaxVBoxIncludeRC 23 23 24 24 # Omit headers that are using C++ features and upsets gcc. 25 cpp_features_hdrs:= \25 VBOX_HDRS_CPP_FEATURES := \ 26 26 VBox/vmm/hm.h \ 27 27 VBox/vmm/hm_vmx.h \ … … 35 35 VBox/dbus.h \ 36 36 VBox/VBoxPktDmp.h \ 37 $(wildcard iprt/cpp/*)37 iprt/cpp/% 38 38 39 39 # Omit headers that are C++ and ring-3. 40 r3_cpp_hdrs:= \40 VBOX_HDRS_R3_CPP := \ 41 41 VBox/dbggui.h \ 42 42 VBox/settings.h \ 43 43 VBox/com/Guid.h \ 44 44 VBox/HostServices/GuestPropertySvc.h \ 45 $(wildcard iprt/*_cpp.h iprt/cpp/*.h VBox/com/*.h ) 45 iprt/cpp/% \ 46 VBox/com/% \ 47 $(subst $(PATH_SUB_CURRENT)/,,$(wildcard $(PATH_SUB_CURRENT)/iprt/*_cpp.h)) 46 48 47 49 # Ring-3 only headers. 48 r3_only_hdrs:= \50 VBOX_HDRS_R3_ONLY := \ 49 51 VBox/vrdpapi.h \ 50 52 VBox/vrdpusb.h \ … … 80 82 81 83 # Ring-0 only headers. 82 r0_only_hdrs:= \84 VBOX_HDRS_R0_ONLY := \ 83 85 VBox/VBoxGuestLibSharedFolders.h 84 86 85 87 # GCC only headers. 86 gcc_only_hdrs:= \88 VBOX_HDRS_GCC_ONLY := \ 87 89 iprt/nocrt/fenv.h \ 88 90 iprt/nocrt/math.h 89 91 90 92 # Headers to omit all together. 91 omit_hdrs:= \93 VBOX_HDRS_OMIT := \ 92 94 VBox/HostServices/glext.h \ 93 95 VBox/HostServices/glxext.h \ 94 96 VBox/HostServices/wglext.h \ 95 97 VBox/VBoxGL2D.h \ 96 VBox/WinNetConfig.h \ 97 VBox/usblib-solaris.h \ 98 $(if-expr "$(KBUILD_TARGET)" != "solaris", \ 99 VBox/usblib-solaris.h \ 100 ,)\ 98 101 VBox/VDEPlug.h \ 99 102 VBox/VDEPlugSymDefs.h \ … … 103 106 VBox/VBoxNetCfg-win.h \ 104 107 VBox/usblib-win.h \ 105 ,$( gcc_only_hdrs)) \108 ,$(VBOX_HDRS_GCC_ONLY)) \ 106 109 \ 107 110 VBox/dbus-calls.h \ … … 110 113 iprt/runtime-loader.h \ 111 114 iprt/mangling.h \ 112 $( wildcard iprt/asm*watcom*.h) \115 $(subst $(PATH_SUB_CURRENT)/,,$(wildcard $(PATH_SUB_CURRENT)/iprt/asm*watcom*.h)) \ 113 116 iprt/asn1-generator% \ 114 117 iprt/win/% \ … … 119 122 120 123 # We omit a few headers which have platform specific issues or are templates. 121 hdrs := $(filter-out $(omit_hdrs), $(wildcard VBox/*.h VBox/*/*.h iprt/*.h iprt/*/*.h)) 124 VBOX_HDRS_ALL := $(filter-out $(VBOX_HDRS_OMIT), \ 125 $(subst $(PATH_SUB_CURRENT)/,,$(wildcard \ 126 $(PATH_SUB_CURRENT)/VBox/*.h \ 127 $(PATH_SUB_CURRENT)/VBox/*/*.h \ 128 $(PATH_SUB_CURRENT)/iprt/*.h \ 129 $(PATH_SUB_CURRENT)/iprt/*/*.h \ 130 ))) 122 131 123 132 # ring-3, ring-0 and raw-mode context specific exclusions. 124 hdrs.r3 := $(filter-out $(r0_only_hdrs), $(hdrs))125 hdrs-c.r3 := $(filter-out $(cpp_features_hdrs) $(r3_cpp_hdrs) $(r0_only_hdrs), $(hdrs.r3))126 hdrs.r0 := $(filter-out $(r3_cpp_hdrs) $(r3_only_hdrs), $(hdrs))127 hdrs-c.r0 := $(filter-out $(cpp_features_hdrs), $(hdrs.r0))128 hdrs.rc:= $(filter-out \133 VBOX_HDRS_ALL_R3 := $(filter-out $(VBOX_HDRS_R0_ONLY), $(VBOX_HDRS_ALL)) 134 VBOX_HDRS_ALL_R3_C := $(filter-out $(VBOX_HDRS_CPP_FEATURES) $(VBOX_HDRS_R3_CPP) $(VBOX_HDRS_R0_ONLY), $(VBOX_HDRS_ALL_R3)) 135 VBOX_HDRS_ALL_R0 := $(filter-out $(VBOX_HDRS_R3_CPP) $(VBOX_HDRS_R3_ONLY), $(VBOX_HDRS_ALL)) 136 VBOX_HDRS_ALL_R0_C := $(filter-out $(VBOX_HDRS_CPP_FEATURES), $(VBOX_HDRS_ALL_R0)) 137 VBOX_HDRS_ALL_RC := $(filter-out \ 129 138 VBox/VBoxGuestLib.h \ 130 139 VBox/vmm/gvm.h \ … … 134 143 iprt/alloc.h \ 135 144 iprt/vector.h \ 136 $( r3_cpp_hdrs) \137 $( r3_only_hdrs) \138 $( r0_only_hdrs) \139 , $( hdrs))140 hdrs-c.rc := $(filter-out $(cpp_features_hdrs), $(hdrs.rc))141 #$(error $(subst $(SP),$(NLTAB),$(strip $(sort $( hdrs-c.rc)))))145 $(VBOX_HDRS_R3_CPP) \ 146 $(VBOX_HDRS_R3_ONLY) \ 147 $(VBOX_HDRS_R0_ONLY) \ 148 , $(VBOX_HDRS_ALL)) 149 VBOX_HDRS_ALL_RC_C := $(filter-out $(VBOX_HDRS_CPP_FEATURES), $(VBOX_HDRS_ALL_RC)) 150 #$(error $(subst $(SP),$(NLTAB),$(strip $(sort $(VBOX_HDRS_ALL_RC_C))))) 142 151 143 152 SyntaxVBoxIncludeR3_TEMPLATE = VBOXMAINEXE … … 145 154 SyntaxVBoxIncludeR3_CDEFS = VBOX_WITHOUT_UNNAMED_UNIONS 146 155 SyntaxVBoxIncludeR3_SOURCES := \ 147 $(addprefix $(PATH_TARGET)/,$(subst .h,-c.c, $(subst /,_,$(hdrs-c.r3)))) \ 148 $(addprefix $(PATH_TARGET)/,$(subst .h,-cpp.cpp, $(subst /,_,$(hdrs.r3)))) 156 $(addprefix $(PATH_OBJ)/include/,$(subst .h,-c.c, $(subst /,_,$(VBOX_HDRS_ALL_R3_C)))) \ 157 $(addprefix $(PATH_OBJ)/include/,$(subst .h,-cpp.cpp, $(subst /,_,$(VBOX_HDRS_ALL_R3)))) 158 SyntaxVBoxIncludeR3_CLEAN = $(SyntaxVBoxIncludeR3_SOURCES) 149 159 150 160 SyntaxVBoxIncludeR0_TEMPLATE = VBoxR0 … … 152 162 SyntaxVBoxIncludeR0_CDEFS = VBOX_WITHOUT_UNNAMED_UNIONS 153 163 SyntaxVBoxIncludeR0_SOURCES := \ 154 $(addprefix $(PATH_TARGET)/,$(subst .h,-c.c, $(subst /,_,$(hdrs-c.r0)))) \ 155 $(addprefix $(PATH_TARGET)/,$(subst .h,-cpp.cpp, $(subst /,_,$(hdrs.r0)))) 164 $(addprefix $(PATH_OBJ)/include/,$(subst .h,-c.c, $(subst /,_,$(VBOX_HDRS_ALL_R0_C)))) \ 165 $(addprefix $(PATH_OBJ)/include/,$(subst .h,-cpp.cpp, $(subst /,_,$(VBOX_HDRS_ALL_R0)))) 166 SyntaxVBoxIncludeR0_CLEAN = $(SyntaxVBoxIncludeR0_SOURCES) 156 167 157 168 SyntaxVBoxIncludeRC_TEMPLATE = VBoxRc … … 159 170 SyntaxVBoxIncludeRC_CDEFS = VBOX_WITHOUT_UNNAMED_UNIONS 160 171 SyntaxVBoxIncludeRC_SOURCES := \ 161 $(addprefix $(PATH_TARGET)/,$(subst .h,-c.c, $(subst /,_,$(hdrs-c.rc)))) \ 162 $(addprefix $(PATH_TARGET)/,$(subst .h,-cpp.cpp, $(subst /,_,$(hdrs.rc)))) 163 164 165 # Comment out the next line to simplify header correction. 166 VBOX_ROOT_INCLUDE_MAKEFILE = $(PATH_ROOT)/include/Makefile.kmk 167 168 include $(FILE_KBUILD_FOOTER) 172 $(addprefix $(PATH_OBJ)/include/,$(subst .h,-c.c, $(subst /,_,$(VBOX_HDRS_ALL_RC_C)))) \ 173 $(addprefix $(PATH_OBJ)/include/,$(subst .h,-cpp.cpp, $(subst /,_,$(VBOX_HDRS_ALL_RC)))) 174 SyntaxVBoxIncludeRC_CLEAN = $(SyntaxVBoxIncludeRC_SOURCES) 175 169 176 170 177 171 178 # Headers that must only be included once. 172 only_once_hdrs:= \179 VBOX_HDRS_ONLY_ONCE := \ 173 180 iprt/bldprog-strtab-template.cpp.h 174 181 182 183 # Generate the files we compile. 175 184 define def_hdr 176 185 $(eval flatname := $(subst /,_,$(basename $(hdr)))) 177 186 $(eval functioname := $(translate $(flatname),-./,___)) 178 $$(PATH_ TARGET)/$(flatname)-cpp.cpp: $(VBOX_ROOT_INCLUDE_MAKEFILE) | $$(PATH_TARGET)/187 $$(PATH_OBJ)/include/$(flatname)-cpp.cpp: | $$(PATH_OBJ)/include/ 179 188 $(QUIET)$$(APPEND) -t -n $$@ \ 180 189 '#include <$(hdr)>' \ 181 $(if-expr $(intersects $(hdr),$( only_once_hdrs)),, '#include <$(hdr)>') \190 $(if-expr $(intersects $(hdr),$(VBOX_HDRS_ONLY_ONCE)),, '#include <$(hdr)>') \ 182 191 'extern int $(functioname)_cpp(void);' \ 183 192 'int $(functioname)_cpp(void) { return 0;}' 184 193 185 $$(PATH_ TARGET)/$(flatname)-c.c: $(VBOX_ROOT_INCLUDE_MAKEFILE) | $$(PATH_TARGET)/194 $$(PATH_OBJ)/include/$(flatname)-c.c: | $$(PATH_OBJ)/include/ 186 195 $(QUIET)$$(APPEND) -t -n $$@ \ 187 196 '#include <$(hdr)>' \ 188 $(if-expr $(intersects $(hdr),$( only_once_hdrs)),, '#include <$(hdr)>') \197 $(if-expr $(intersects $(hdr),$(VBOX_HDRS_ONLY_ONCE)),, '#include <$(hdr)>') \ 189 198 'extern int $(functioname)_c(void);' \ 190 199 'int $(functioname)_c(void) { return 0;}' 191 200 192 201 $(subst .h,.o,$(notdir $(hdr))):: 193 if1of ($(hdr), $( r3_cpp_hdrs) $(cpp_features_hdrs))202 if1of ($(hdr), $(VBOX_HDRS_R3_CPP) $(VBOX_HDRS_CPP_FEATURES)) 194 203 $$(MAKE) -f $(MAKEFILE) $(flatname)-cpp.o 195 204 else … … 199 208 endef 200 209 201 $(foreach hdr,$(hdrs), $(eval $(def_hdr))) 202 210 $(foreach hdr,$(VBOX_HDRS_ALL), $(eval $(def_hdr))) 211 212 # Where we put the file. 213 BLDDIRS += $(PATH_OBJ)/include/ 214 215 216 include $(FILE_KBUILD_SUB_FOOTER) 217
Note:
See TracChangeset
for help on using the changeset viewer.