Changeset 68689 in vbox for trunk/include
- Timestamp:
- Sep 7, 2017 8:32:22 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/Makefile.kmk
r68676 r68689 154 154 SyntaxVBoxIncludeR3_CDEFS = VBOX_WITHOUT_UNNAMED_UNIONS 155 155 SyntaxVBoxIncludeR3_SOURCES := \ 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))))156 $(addprefix $(PATH_OBJ)/include/c/, $(addsuffix .c, $(basename $(VBOX_HDRS_ALL_R3_C)))) \ 157 $(addprefix $(PATH_OBJ)/include/cpp/,$(addsuffix .cpp,$(basename $(VBOX_HDRS_ALL_R3)))) 158 158 SyntaxVBoxIncludeR3_CLEAN = $(SyntaxVBoxIncludeR3_SOURCES) 159 #$(error $(subst $(SP),$(NLTAB),$(strip $(sort $(SyntaxVBoxIncludeR3_SOURCES))))) 159 160 160 161 SyntaxVBoxIncludeR0_TEMPLATE = VBoxR0 … … 162 163 SyntaxVBoxIncludeR0_CDEFS = VBOX_WITHOUT_UNNAMED_UNIONS 163 164 SyntaxVBoxIncludeR0_SOURCES := \ 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))))165 $(addprefix $(PATH_OBJ)/include/c/, $(addsuffix .c, $(basename $(VBOX_HDRS_ALL_R0_C)))) \ 166 $(addprefix $(PATH_OBJ)/include/cpp/,$(addsuffix .cpp,$(basename $(VBOX_HDRS_ALL_R0)))) 166 167 SyntaxVBoxIncludeR0_CLEAN = $(SyntaxVBoxIncludeR0_SOURCES) 167 168 … … 170 171 SyntaxVBoxIncludeRC_CDEFS = VBOX_WITHOUT_UNNAMED_UNIONS 171 172 SyntaxVBoxIncludeRC_SOURCES := \ 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))))173 $(addprefix $(PATH_OBJ)/include/c/, $(addsuffix .c, $(basename $(VBOX_HDRS_ALL_RC_C)))) \ 174 $(addprefix $(PATH_OBJ)/include/cpp/,$(addsuffix .cpp,$(basename $(VBOX_HDRS_ALL_RC)))) 174 175 SyntaxVBoxIncludeRC_CLEAN = $(SyntaxVBoxIncludeRC_SOURCES) 175 176 … … 183 184 # Generate the files we compile. 184 185 define def_hdr 185 $(eval flatname := $(subst /,_,$(basename $(hdr)))) 186 $(eval functioname := $(translate $(flatname),-./,___)) 187 $$(PATH_OBJ)/include/$(flatname)-cpp.cpp: | $$(PATH_OBJ)/include/ 186 $(eval functioname := $(translate $(basename $(hdr)),-./,___)) 187 188 $$(PATH_OBJ)/include/c/$(basename $(hdr)).c: | $$$$(dir $$$$@) 189 $(QUIET)$$(APPEND) -t -n $$@ \ 190 '#include <$(hdr)>' \ 191 $(if-expr $(intersects $(hdr),$(VBOX_HDRS_ONLY_ONCE)),, '#include <$(hdr)>') \ 192 'extern int $(functioname)_c(void);' \ 193 'int $(functioname)_c(void) { return 0;}' 194 195 $$(PATH_OBJ)/include/cpp/$(basename $(hdr)).cpp: | $$$$(dir $$$$@) 188 196 $(QUIET)$$(APPEND) -t -n $$@ \ 189 197 '#include <$(hdr)>' \ … … 192 200 'int $(functioname)_cpp(void) { return 0;}' 193 201 194 $$(PATH_OBJ)/include/$(flatname)-c.c: | $$(PATH_OBJ)/include/195 $(QUIET)$$(APPEND) -t -n $$@ \196 '#include <$(hdr)>' \197 $(if-expr $(intersects $(hdr),$(VBOX_HDRS_ONLY_ONCE)),, '#include <$(hdr)>') \198 'extern int $(functioname)_c(void);' \199 'int $(functioname)_c(void) { return 0;}'200 201 $(subst .h,.o,$(notdir $(hdr)))::202 if1of ($(hdr), $(VBOX_HDRS_R3_CPP) $(VBOX_HDRS_CPP_FEATURES))203 $$(MAKE) -f $(MAKEFILE) $(flatname)-cpp.o204 else205 $$(MAKE) -f $(MAKEFILE) $(flatname)-c.o $(flatname)-cpp.o206 endif207 208 202 endef 209 203 210 204 $(foreach hdr,$(VBOX_HDRS_ALL), $(eval $(def_hdr))) 211 205 212 # Where we put the file. 213 BLDDIRS += $(PATH_OBJ)/include/ 206 # Tell kBuild to generate rules for making the directories for the generated files. 207 VBOX_HDR_DIRS := $(sort $(dir $(VBOX_HDRS_ALL))) 208 BLDDIRS += $(addprefix $(PATH_OBJ)/include/c/,$(VBOX_HDR_DIRS)) $(addprefix $(PATH_OBJ)/include/cpp/,$(VBOX_HDR_DIRS)) 214 209 215 210
Note:
See TracChangeset
for help on using the changeset viewer.