Merge "remove VCONFKEY_MOBEX_ENGINE_STATUS_INT from hotfix" into tizen
[platform/core/appfw/vconf-internal-keys.git] / Makefile
1 #all:html cmd header
2 #all:init allcmd allheader allhtml vconf-internal-keys.pc
3 #all:init allcmd allheader allhtml allwrapper
4 #all:init allcmd allhtml allheader allwrapper allwrapper_impl vconf-internal-keys.h endproc
5 #all:init allcmd postproc allhtml allheader vconf-internal-keys.h endproc
6 all:init allcmd allhtml allheader vconf-internal-keys.h endproc
7
8 allcmd: $(shell find . -name "*.xml" | sort | sed 's/xml/sh/')
9 #allcmd2: $(shell find . -name "*.xml" | sed 's/xml/sh2/')
10 allheader: $(shell find . -name "*.xml" | sort | sed 's/xml/h/')
11 allhtml: $(shell find . -name "*.xml" | sort | sed 's/xml/html/')
12 #allwrapper: $(shell find . -name "*.xml" | sed 's/.xml/_wrapper.h/')
13 #allwrapper_impl: $(shell find . -name "*.xml" | sed 's/.xml/_wrapper.c/')
14
15 MODEL=$(model)
16 XMLS=$(wildcard data/*.xml)
17
18 check:
19         echo $(XMLS)
20         $(foreach var, $(XMLS), xmllint --noout --schema check.xsd $(var) || exit;)
21
22 ifneq ($(model), )
23 xsltopt=--stringparam target $(MODEL)
24 else
25 xsltopt=--stringparam target ''
26 endif
27 init:
28         @mkdir -p report
29         @mkdir -p scripts
30         @mkdir -p include
31 #       if [ -a ./scripts/all.sh ]; \
32 #       then \
33 #               rm ./scripts/all.sh; \
34 #       fi;
35         cp all.sh.in ./scripts/all.sh
36
37 %.html:%.xml
38         xsltproc $(xsltopt) test_report.xsl $< > $@
39         mv $@ ./report
40
41 %.sh:%.xml
42         xsltproc $(xsltopt) create_cmd.xsl $< | sed '/^$$/d' > $@
43         cat $@ >> ./scripts/all.sh
44         rm $@
45         xsltproc $(xsltopt) create_init_script.xsl $< | sed '/^$$/d' > $@
46         if [ -s $@ ]; then mv $@ ./scripts; fi
47
48
49 #%.sh2:%.xml
50 #       xsltproc $(xsltopt) create_init_script.xsl $< | sed '/^$$/d' > $@
51 #       if [ -s $@ ]; then mv $@ ./scripts; fi
52
53
54 %.h:%.xml
55         xsltproc $(xsltopt) create_header.xsl $< | sed '/^$$/d' > $@
56         mv $@ ./include
57
58 #%_wrapper.h:%.xml
59 #       xsltproc $(xsltopt) create_wrapper.xsl $< | sed '/^$$/d'  > $@
60 #       xsltproc $(xsltopt) create_wrapper.xsl $< | sed '/^$$/d'   > $@
61 #       mv $@ ./include
62
63 #%_wrapper.c:%.xml
64 #       xsltproc $(xsltopt) create_wrapper.xsl $< | sed '/^$$/d' | indent   > $@
65 #       xsltproc $(xsltopt) create_wrapper_impl.xsl $< | sed '/^$$/d'   > $@
66 #       sed -i '21 i #include \<vconf.h\>' $@
67 #       sed -i '22 i #include "vconf-internal-keys.h"' $@
68 #       sed -i '23i\\' $@
69 #       mv $@ ./wrapper
70
71 vconf-internal-keys.h:
72         echo "#ifndef __VCONF_INTERNAL_KEYS_H__" > include/vconf-internal-keys.h
73         echo "#define __VCONF_INTERNAL_KEYS_H__" >> include/vconf-internal-keys.h
74         find ./include -name "*.h" -not -name "vconf-internal-keys.h" -printf "#include \"%f\" \n" | sort >> include/vconf-internal-keys.h
75         echo "#endif            /* __VCONF_INTERNAL_KEYS_H__ */" >> include/vconf-internal-keys.h
76
77 clean:
78         #@rm -rf report scripts include *.pc
79         @rm -rf report scripts include
80         @find . -name "*.html" -print0 | xargs -0 -r rm
81         @rm data/vconf-*.sh
82         @find . -name "*.h" -print0 | xargs -0 -r rm
83
84 endproc:
85         ./remove_whitespace.sh
86
87 #vconf-internal-keys.pc:vconf-internal-keys.pc.in
88 #       sed -e 's/@PREFIX@/hello/' -e 's/@LIBDIR@/hello/' -e 's/@EXEC_PREFIX@/hello/' -e 's/@INCLUDEDIR@/hello/' -e 's/@VERSION@/hello/' vconf-internal-keys.pc.in > vconf-internal-keys.pc
89
90 install:
91 #               cp cmd.sh /opt/usr
92 #               cp ${INSTALL_ROOT}/scripts/*.sh ${INSTALL_ROOT}/opt/usr