Merge pull request #7918 from Montellese/fix_modal_video_refreshing
[xbmc.git] / codegenerator.mk
blob895c0e81e97c577d6bd4ca3493f7f2028266a108
1 TOPDIR ?= .
2 INTERFACES_DIR ?= xbmc/interfaces
4 JAVA ?= $(shell which java)
5 ifeq ($(JAVA),)
6 JAVA = java-not-found
7 endif
9 SWIG ?= $(shell which swig)
10 ifeq ($(SWIG),)
11 SWIG = swig-not-found
12 endif
14 DOXYGEN ?= $(shell which doxygen)
15 ifeq ($(DOXYGEN),)
16 DOXYGEN = doxygen-not-found
17 else
18 DOXY_XML_PATH=$(GENDIR)/doxygenxml
19 endif
21 GENERATED_JSON = $(INTERFACES_DIR)/json-rpc/ServiceDescription.h addons/xbmc.json/addon.xml
22 ifeq ($(wildcard $(JSON_BUILDER)),)
23 JSON_BUILDER = $(shell which JsonSchemaBuilder)
24 ifeq ($(JSON_BUILDER),)
25 JSON_BUILDER = tools/depends/native/JsonSchemaBuilder/bin/JsonSchemaBuilder
26 endif
27 endif
29 GENDIR = $(INTERFACES_DIR)/python/generated
30 GROOVY_DIR = $(TOPDIR)/lib/groovy
32 GENERATED = $(GENDIR)/AddonModuleXbmc.cpp
33 GENERATED += $(GENDIR)/AddonModuleXbmcgui.cpp
34 GENERATED += $(GENDIR)/AddonModuleXbmcplugin.cpp
35 GENERATED += $(GENDIR)/AddonModuleXbmcaddon.cpp
36 GENERATED += $(GENDIR)/AddonModuleXbmcvfs.cpp
37 GENERATED += $(GENDIR)/AddonModuleXbmcwsgi.cpp
39 GENERATE_DEPS += $(TOPDIR)/xbmc/interfaces/legacy/*.h $(TOPDIR)/xbmc/interfaces/python/typemaps/*.intm $(TOPDIR)/xbmc/interfaces/python/typemaps/*.outtm
41 vpath %.i $(INTERFACES_DIR)/swig
43 $(GENDIR)/%.cpp: $(GENDIR)/%.xml $(JAVA) $(SWIG) $(DOXY_XML_PATH)
44 # Work around potential groovy bug reported at: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=733234
45 $(JAVA) -cp "$(GROOVY_DIR)/groovy-all-2.1.7.jar:$(GROOVY_DIR)/commons-lang-2.6.jar:$(TOPDIR)/tools/codegenerator:$(INTERFACES_DIR)/python" \
46 org.codehaus.groovy.tools.FileSystemCompiler -d $(TOPDIR)/tools/codegenerator $(TOPDIR)/tools/codegenerator/Helper.groovy $(TOPDIR)/tools/codegenerator/SwigTypeParser.groovy $(INTERFACES_DIR)/python/MethodType.groovy $(INTERFACES_DIR)/python/PythonTools.groovy
47 $(JAVA) -cp "$(GROOVY_DIR)/groovy-all-2.1.7.jar:$(GROOVY_DIR)/commons-lang-2.6.jar:$(TOPDIR)/tools/codegenerator:$(INTERFACES_DIR)/python" \
48 groovy.ui.GroovyMain $(TOPDIR)/tools/codegenerator/Generator.groovy $< $(INTERFACES_DIR)/python/PythonSwig.cpp.template $@ $(DOXY_XML_PATH)
49 rm $<
51 $(GENDIR)/%.xml: %.i $(SWIG) $(JAVA) $(GENERATE_DEPS)
52 mkdir -p $(GENDIR)
53 $(SWIG) -w401 -c++ -o $@ -xml -I$(TOPDIR)/xbmc -xmllang python $<
55 codegenerated: $(DOXYGEN) $(SWIG) $(JAVA) $(GENERATED) $(GENERATED_JSON) $(GENERATED_ADDON_JSON)
57 $(DOXY_XML_PATH): $(SWIG) $(JAVA)
58 cd $(INTERFACES_DIR)/python; ($(DOXYGEN) Doxyfile > /dev/null) 2>&1 | grep -v " warning: "
59 touch $@
61 $(DOXYGEN):
62 @echo "Warning: No doxygen installed. The Api will not have any docstrings."
63 mkdir -p $(GENDIR)/doxygenxml
65 $(JAVA):
66 @echo Java not found, it will be used if found after configure.
67 @echo This is not necessarily an error.
68 @false
70 $(SWIG):
71 @echo Swig not found, it will be used if found after configure.
72 @echo This is not necessarily an error.
73 @false
75 $(GENERATED_JSON): $(JSON_BUILDER)
76 @echo Jsonbuilder: $(JSON_BUILDER)
77 $(MAKE) -C $(INTERFACES_DIR)/json-rpc $(notdir $@)
79 $(JSON_BUILDER):
80 ifeq ($(BOOTSTRAP_FROM_DEPENDS), yes)
81 @echo JsonSchemaBuilder not found. You didn\'t build depends. Check docs/README.\<yourplatform\>
82 @false
83 else
84 #build json builder - ".." because makefile is in the parent dir of "bin"
85 $(MAKE) -C $(abspath $(dir $@)..)
86 endif