Relocate and redefine usb_mode enum
[platform/core/appfw/vconf-internal-keys.git] / Makefile
index b46ec69..f7276f6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,45 +2,76 @@
 #all:init allcmd allheader allhtml vconf-internal-keys.pc
 #all:init allcmd allheader allhtml allwrapper
 #all:init allcmd allhtml allheader allwrapper allwrapper_impl vconf-internal-keys.h endproc
+#all:init allcmd postproc allhtml allheader vconf-internal-keys.h endproc
 all:init allcmd allhtml allheader vconf-internal-keys.h endproc
 
-allcmd: $(shell find . -name "*.xml" | sed 's/xml/sh/')
-allheader: $(shell find . -name "*.xml" | sed 's/xml/h/')
-allhtml: $(shell find . -name "*.xml" | sed 's/xml/html/')
+allcmd: $(shell find . -name "*.xml" | sort | sed 's/xml/sh/')
+#allcmd2: $(shell find . -name "*.xml" | sed 's/xml/sh2/')
+allheader: $(shell find . -name "*.xml" | sort | sed 's/xml/h/')
+allhtml: $(shell find . -name "*.xml" | sort | sed 's/xml/html/')
 #allwrapper: $(shell find . -name "*.xml" | sed 's/.xml/_wrapper.h/')
 #allwrapper_impl: $(shell find . -name "*.xml" | sed 's/.xml/_wrapper.c/')
 
+MODEL=$(model)
+XMLS=$(wildcard data/*.xml)
+
+check:
+       echo $(XMLS)
+       $(foreach var, $(XMLS), xmllint --noout --schema check.xsd $(var) || exit;)
+
+ifneq ($(profile), )
+xsltopt = --stringparam profile $(profile)
+else
+xsltopt = --stringparam profile ''
+endif
+ifneq ($(model), )
+xsltopt += --stringparam target $(MODEL)
+else
+xsltopt += --stringparam target ''
+endif
 
 init:
        @mkdir -p report
        @mkdir -p scripts
        @mkdir -p include
-#      @mkdir -p wrapper
-#      cp ./include2/vconf-internal-keys.h ./include/
+       @find scripts -name "*.sh" -exec rm {} \;
+       @find data -name "*.sh" -exec rm {} \;
+
+#      if [ -a ./scripts/all.sh ]; \
+#      then \
+#              rm ./scripts/all.sh; \
+#      fi;
+       cp all.sh.in ./scripts/all.sh
 
 %.html:%.xml
-       xsltproc test_report.xsl $< > $@
+       xsltproc $(xsltopt) test_report.xsl $< > $@
        mv $@ ./report
 
-
 %.sh:%.xml
-       xsltproc create_cmd.xsl $< | sed '/^$$/d'   > $@ 
-#      xsltproc create_get_cmd.xsl $< | sed '/^$$/d'   > $@ 
-       mv $@ ./scripts
+       xsltproc $(xsltopt) create_cmd.xsl $< | sed '/^$$/d' > $@
+       cat $@ >> ./scripts/all.sh
+       rm $@
+       xsltproc $(xsltopt) create_init_script.xsl $< | sed '/^$$/d' > $@
+       if [ -s $@ ]; then mv $@ ./scripts; fi
+
+
+#%.sh2:%.xml
+#      xsltproc $(xsltopt) create_init_script.xsl $< | sed '/^$$/d' > $@
+#      if [ -s $@ ]; then mv $@ ./scripts; fi
+
 
 %.h:%.xml
-#      xsltproc create_header.xsl $< | sed '/^$$/d' | indent   > $@
-       xsltproc create_header.xsl $< | sed '/^$$/d' > $@
+       xsltproc $(xsltopt) create_header.xsl $< | sed '/^$$/d' > $@
        mv $@ ./include
 
 #%_wrapper.h:%.xml
-#      xsltproc create_wrapper.xsl $< | sed '/^$$/d' | indent   > $@
-#      xsltproc create_wrapper.xsl $< | sed '/^$$/d'   > $@
+#      xsltproc $(xsltopt) create_wrapper.xsl $< | sed '/^$$/d'  > $@
+#      xsltproc $(xsltopt) create_wrapper.xsl $< | sed '/^$$/d'   > $@
 #      mv $@ ./include
 
 #%_wrapper.c:%.xml
-#      xsltproc create_wrapper.xsl $< | sed '/^$$/d' | indent   > $@
-#      xsltproc create_wrapper_impl.xsl $< | sed '/^$$/d'   > $@
+#      xsltproc $(xsltopt) create_wrapper.xsl $< | sed '/^$$/d' | indent   > $@
+#      xsltproc $(xsltopt) create_wrapper_impl.xsl $< | sed '/^$$/d'   > $@
 #      sed -i '21 i #include \<vconf.h\>' $@
 #      sed -i '22 i #include "vconf-internal-keys.h"' $@
 #      sed -i '23i\\' $@
@@ -49,14 +80,15 @@ init:
 vconf-internal-keys.h:
        echo "#ifndef __VCONF_INTERNAL_KEYS_H__" > include/vconf-internal-keys.h
        echo "#define __VCONF_INTERNAL_KEYS_H__" >> include/vconf-internal-keys.h
-       find ./include -name "*.h" -not -name "vconf-internal-keys.h" -printf "#include \"%f\" \n" >> include/vconf-internal-keys.h
+       find ./include -name "*.h" -not -name "vconf-internal-keys.h" -printf "#include \"%f\" \n" | sort >> include/vconf-internal-keys.h
        echo "#endif            /* __VCONF_INTERNAL_KEYS_H__ */" >> include/vconf-internal-keys.h
 
 clean:
-       @rm -rf report scripts include *.pc
-       @find . -name "*.html" | xargs rm 
-       @find . -name "*.sh" | xargs rm 
-       @find . -name "*.h" | xargs rm 
+       #@rm -rf report scripts include *.pc
+       @rm -rf report scripts include
+       @find . -name "*.html" -print0 | xargs -0 -r rm
+       @rm data/vconf-*.sh
+       @find . -name "*.h" -print0 | xargs -0 -r rm
 
 endproc:
        ./remove_whitespace.sh