|
@@ -4,6 +4,12 @@ COREPATH=../..
|
|
#include $(COREPATH)/Makefile.defs
|
|
#include $(COREPATH)/Makefile.defs
|
|
|
|
|
|
CFG2TXT=../scripts/cdefs2doc/dump_rpcs.pl
|
|
CFG2TXT=../scripts/cdefs2doc/dump_rpcs.pl
|
|
|
|
+CFG2DOCBOOK=../scripts/cdefs2doc/dump_rpcs.pl
|
|
|
|
+
|
|
|
|
+# output directory for generated txt files
|
|
|
|
+txt_output_dir=.
|
|
|
|
+# output directory for generated docbook xml files
|
|
|
|
+docbook_output_dir=docbook
|
|
|
|
|
|
# list of files contanining rpc defs in the following format:
|
|
# list of files contanining rpc defs in the following format:
|
|
# <filename>:<cfg_grp_name>
|
|
# <filename>:<cfg_grp_name>
|
|
@@ -64,7 +70,7 @@ get_grp=$(strip $(if $(grp_f_$(call get_bname,$(1))), \
|
|
$(call get_listed_grp,$(1))) ) )
|
|
$(call get_listed_grp,$(1))) ) )
|
|
|
|
|
|
# get target from file:grp (get_target(file:grp) => rpc_grp.txt)
|
|
# get target from file:grp (get_target(file:grp) => rpc_grp.txt)
|
|
-get_target=rpc_$(call get_grp,$(1)).txt
|
|
|
|
|
|
+get_target=rpc_$(call get_grp,$(1))
|
|
|
|
|
|
define mk_rules
|
|
define mk_rules
|
|
|
|
|
|
@@ -72,17 +78,30 @@ $(call check_fname_grp, $(1))
|
|
|
|
|
|
#$$(info generating rpc_$$(call get_grp,$(1)).txt: $$(call get_prereq,$(1)))
|
|
#$$(info generating rpc_$$(call get_grp,$(1)).txt: $$(call get_prereq,$(1)))
|
|
|
|
|
|
-$$(call get_target,$(1)): $$(call get_prereq,$(1)) Makefile $(CFG2TXT)
|
|
|
|
|
|
+$(txt_output_dir)/$$(call get_target,$(1)).txt: \
|
|
|
|
+ $$(call get_prereq,$(1)) Makefile $(CFG2TXT)
|
|
$(CFG2TXT) --file $$< --$(force_grp)grp=$$(call get_grp,$(1)) \
|
|
$(CFG2TXT) --file $$< --$(force_grp)grp=$$(call get_grp,$(1)) \
|
|
- --gcc="$(gcc)" > "$$@" || (rm -f "$$@"; exit 1)
|
|
|
|
|
|
+ --gcc="$(gcc)" --txt > "$$@" || (rm -f "$$@"; exit 1)
|
|
|
|
+
|
|
|
|
+$(docbook_output_dir)/$$(call get_target,$(1)).xml: \
|
|
|
|
+ $$(call get_prereq,$(1)) Makefile $(CFG2TXT)
|
|
|
|
+ $(CFG2DOCBOOK) --file $$< --$(force_grp)grp=$$(call get_grp,$(1)) \
|
|
|
|
+ --gcc="$(gcc)" --docbook > "$$@" || (rm -f "$$@"; exit 1)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+clean_$$(call get_target,$(1)).txt:
|
|
|
|
+ rm -f "$(txt_output_dir)/$$(call get_target,$(1)).txt"
|
|
|
|
|
|
|
|
+clean_$$(call get_target,$(1)).xml:
|
|
|
|
+ rm -f "$(docbook_output_dir)/$$(call get_target,$(1)).xml"
|
|
|
|
|
|
-clean_$$(call get_target,$(1)):
|
|
|
|
- rm -f "$$(call get_target,$(1))"
|
|
|
|
|
|
+txt: $(txt_output_dir)/$$(call get_target,$(1)).txt
|
|
|
|
|
|
-all: $$(call get_target,$(1))
|
|
|
|
|
|
+docbook: $(docbook_output_dir)/$$(call get_target,$(1)).xml
|
|
|
|
|
|
-clean: clean_$$(call get_target,$(1))
|
|
|
|
|
|
+clean_txt: clean_$$(call get_target,$(1)).txt
|
|
|
|
+
|
|
|
|
+clean_docbook: clean_$$(call get_target,$(1)).xml
|
|
|
|
|
|
|
|
|
|
endef
|
|
endef
|
|
@@ -92,22 +111,65 @@ endef
|
|
# GCC:TranslationUnit module, make all won't work)
|
|
# GCC:TranslationUnit module, make all won't work)
|
|
.PHONY: help
|
|
.PHONY: help
|
|
help:
|
|
help:
|
|
- @echo "To regenerate $(foreach f,$(flist),$(call get_target,$f) )"
|
|
|
|
|
|
+ @echo "To regenerate $(foreach f,$(flist),$(call get_target,$f).{txt,xml})"
|
|
@echo "type: $(MAKE) all ."
|
|
@echo "type: $(MAKE) all ."
|
|
@echo "or to regenerate all the rpc lists by searching all"
|
|
@echo "or to regenerate all the rpc lists by searching all"
|
|
@echo " the source files for definitions, type: $(MAKE) autogen ."
|
|
@echo " the source files for definitions, type: $(MAKE) autogen ."
|
|
@echo "NOTE: you need the GCC:TranslationUnit perl module with an "
|
|
@echo "NOTE: you need the GCC:TranslationUnit perl module with an "
|
|
@echo "extra patch applied (see $(CFG2TXT) --patch)."
|
|
@echo "extra patch applied (see $(CFG2TXT) --patch)."
|
|
|
|
|
|
|
|
+.PHONY: txt
|
|
|
|
+txt:
|
|
|
|
+
|
|
|
|
+.PHONY: docbook
|
|
|
|
+docbook:
|
|
|
|
+
|
|
|
|
+.PHONY: clean_txt
|
|
|
|
+clean_txt:
|
|
|
|
+
|
|
|
|
+.PHONY: clean_docbook
|
|
|
|
+clean_docbook:
|
|
|
|
+
|
|
|
|
+
|
|
.PHONY: all
|
|
.PHONY: all
|
|
-all:
|
|
|
|
|
|
+all: txt $(docbook_output_dir)/rpc_list.xml
|
|
|
|
|
|
.PHONY: clean
|
|
.PHONY: clean
|
|
-clean:
|
|
|
|
|
|
+clean: clean_txt clean_docbook
|
|
|
|
+ @rm -f $(docbook_output_dir)/rpc_list.xml
|
|
|
|
|
|
.PHONY: proper
|
|
.PHONY: proper
|
|
proper:
|
|
proper:
|
|
- @rm -f rpc_*.txt
|
|
|
|
|
|
+ @rm -f $(txt_output_dir)/rpc_*.txt
|
|
|
|
+ @rm -f $(docbook_output_dir)/rpc_*.xml
|
|
|
|
+
|
|
|
|
+repo_ver="sip-router"\
|
|
|
|
+ "git-$(shell git rev-parse --verify --short=6 HEAD 2>/dev/null)"
|
|
|
|
+ifeq ($(repo_ver),git-)
|
|
|
|
+repo_ver="sip-router unknown"
|
|
|
|
+endif
|
|
|
|
+
|
|
|
|
+$(docbook_output_dir)/rpc_list.xml: \
|
|
|
|
+ $(foreach f,$(flist),$(docbook_output_dir)/$(call get_target,$f).xml)
|
|
|
|
+ @echo '<?xml version="1.0" encoding="UTF-8"?>' >$@
|
|
|
|
+ @echo '<!-- this file is autogenerated, do not edit! -->' >>$@
|
|
|
|
+ @echo '<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"' >>$@
|
|
|
|
+ @echo ' "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">' >>$@
|
|
|
|
+ @echo '<book id="rpc_list"'\
|
|
|
|
+ 'xmlns:xi="http://www.w3.org/2001/XInclude">' >>$@
|
|
|
|
+ @echo ' <title>RPC Exports List</title>' >>$@
|
|
|
|
+ @echo ' <info><revhistory><revision>' >>$@
|
|
|
|
+ @echo ' <revnumber>'$(repo_ver)'</revnumber>' >>$@
|
|
|
|
+ @echo ' <revremark>' >>$@
|
|
|
|
+ @echo " Automatically generated by:">>$@
|
|
|
|
+ @echo " $(MAKE) -C doc/rpc_list $(MAKECMDGOALS)" >>$@
|
|
|
|
+ @echo ' </revremark>' >>$@
|
|
|
|
+ @echo ' </revision></revhistory></info>' >>$@
|
|
|
|
+ @$(foreach f,$(flist),\
|
|
|
|
+ echo ' <xi:include'\
|
|
|
|
+ 'href="'$(call get_target,$f).xml'"/>' \
|
|
|
|
+ >>$@ ; )
|
|
|
|
+ @echo '</book>' >>$@
|
|
|
|
|
|
find_rpc_files_cmd= find $(COREPATH) -type f -name "*.c" \
|
|
find_rpc_files_cmd= find $(COREPATH) -type f -name "*.c" \
|
|
-exec grep "rpc_export_t[ ][a-zA-Z0-9_]*\[\][ ]*=" /dev/null {} \; \
|
|
-exec grep "rpc_export_t[ ][a-zA-Z0-9_]*\[\][ ]*=" /dev/null {} \; \
|