TOLUAPP=/usr/local/bin/lua$(subst .,,$(LUA_VERSION))/tolua++
TOLUA_LIBS=tolua++
endif
+ CLEAN_FILES=*_tolua.{pkg,cpp}
ifeq ($(HAVE_TOLUA),1)
.SECONDEXPANSION:
%_tolua.cpp: $$(TOLUA_$$(subst /,_,$$*))
$(SILENT) echo "$(INDENT_PRINT)--- Generating Lua package C++ file $(@F)"
- $(SILENT)cat $(addprefix $(SRCDIR)/,$(subst $(SRCDIR)/,,$(filter %.tolua,$^))) | \
- $(TOLUAPP) -n $(TOLUA_PKGPREFIX_$(subst /,_,$*))$(notdir $*) | \
+ $(SILENT)cat $(addprefix $(SRCDIR)/,$(subst $(SRCDIR)/,,$(filter %.tolua,$^))) > $(patsubst %.cpp,%.pkg,$@)
+ $(SILENT)$(TOLUAPP) -n $(TOLUA_PKGPREFIX_$(subst /,_,$*))$(notdir $*) $(patsubst %.cpp,%.pkg,$@) | \
sed -e 's/^\(.*Generated automatically .*\) on .*$$/\1/' | \
awk '/^#if defined/ { f=1 }; f { t = t "\n" $$0 }; !f {print}; f && /^#endif/ {print "extern \"C\" {" t "\n}\n"; f=0}' | \
awk '/^\*\/$$/ { print; while ((getline line < "$(BASEDIR)/doc/headers/lichead_c.GPL_WRE") > 0) print line }; ! /^\*\/$$/ { print }' \
$(SILENT)$(foreach L,$(LIBS_gui),rm -f $(L);)
$(SILENT)$(foreach P,$(PLUGINS_gui),rm -f $(P);)
$(SILENT)$(foreach T,$(TARGETS_gui),rm -rf $(T);)
+ $(SILENT)$(foreach E,$(CLEAN_FILES),rm -rf $(E);)
ifeq (,$(findstring qa,$(SUBDIRS)))
.PHONY: qa