Remove LiveTV menu.
[vuplus_xbmc] / codegenerator.mk
1 TOPDIR ?= .
2 INTERFACES_DIR ?= xbmc/interfaces
3
4 JAVA ?= $(shell which java)
5 ifeq ($(JAVA),)
6 JAVA = java-not-found
7 endif
8
9 SWIG ?= $(shell which swig)
10 ifeq ($(SWIG),)
11 SWIG = swig-not-found
12 endif
13
14 DOXYGEN ?= $(shell which doxygen)
15 ifeq ($(DOXYGEN),)
16 DOXYGEN = doxygen-not-found
17 else
18 DOXY_XML_PATH=$(GENDIR)/doxygenxml
19 endif
20
21 GENDIR = $(INTERFACES_DIR)/python/generated
22 GROOVY_DIR = $(TOPDIR)/lib/groovy
23
24 GENERATED =  $(GENDIR)/AddonModuleXbmc.cpp
25 GENERATED += $(GENDIR)/AddonModuleXbmcgui.cpp
26 GENERATED += $(GENDIR)/AddonModuleXbmcplugin.cpp
27 GENERATED += $(GENDIR)/AddonModuleXbmcaddon.cpp
28 GENERATED += $(GENDIR)/AddonModuleXbmcvfs.cpp
29
30 GENERATE_DEPS += $(TOPDIR)/xbmc/interfaces/legacy/*.h $(TOPDIR)/xbmc/interfaces/python/typemaps/*.intm $(TOPDIR)/xbmc/interfaces/python/typemaps/*.outtm
31
32 vpath %.i $(INTERFACES_DIR)/swig
33
34 $(GENDIR)/%.cpp: $(GENDIR)/%.xml $(JAVA) $(SWIG) $(DOXY_XML_PATH)
35         # Work around potential groovy bug reported at: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=733234
36         $(JAVA) -cp "$(GROOVY_DIR)/groovy-all-2.1.7.jar:$(GROOVY_DIR)/commons-lang-2.6.jar:$(TOPDIR)/tools/codegenerator:$(INTERFACES_DIR)/python" \
37           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
38         $(JAVA) -cp "$(GROOVY_DIR)/groovy-all-2.1.7.jar:$(GROOVY_DIR)/commons-lang-2.6.jar:$(TOPDIR)/tools/codegenerator:$(INTERFACES_DIR)/python" \
39           groovy.ui.GroovyMain $(TOPDIR)/tools/codegenerator/Generator.groovy $< $(INTERFACES_DIR)/python/PythonSwig.cpp.template $@ $(DOXY_XML_PATH)
40         rm $<
41
42 $(GENDIR)/%.xml: %.i $(SWIG) $(JAVA) $(GENERATE_DEPS)
43         mkdir -p $(GENDIR)
44         $(SWIG) -w401 -c++ -o $@ -xml -I$(TOPDIR)/xbmc -xmllang python $<
45
46 codegenerated: $(DOXYGEN) $(SWIG) $(JAVA) $(GENERATED)
47
48 $(DOXY_XML_PATH): $(SWIG) $(JAVA)
49         cd $(INTERFACES_DIR)/python; ($(DOXYGEN) Doxyfile > /dev/null) 2>&1 | grep -v " warning: "
50         touch $@
51
52 $(DOXYGEN):
53         @echo "Warning: No doxygen installed. The Api will not have any docstrings."
54         mkdir -p $(GENDIR)/doxygenxml
55
56 $(JAVA):
57         @echo Java not found, it will be used if found after configure.
58         @echo This is not necessarily an error.
59         @false
60
61 $(SWIG):
62         @echo Swig not found, it will be used if found after configure.
63         @echo This is not necessarily an error.
64         @false
65