Commit fa970e46 authored by bguillaum's avatar bguillaum

Factorize out dep2pict option lib handling

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/semagramme/libcaml-grew/trunk@8807 7838e531-6607-4d57-9587-6c381814729c
parent 9f8ef015
all:
@make -C src libgrew.cmxa
@make -C src libgrew.cma
include config/Makefile
conf: config/configure.ac
cd config && rm -rf ac_lib_checking.*
cd config && wget https://gforge.inria.fr/scm/viewvc.php/*checkout*/ac_lib_checking/ac_lib_checking.m4?root=semagramme --no-check-certificate || true
cd config && mv ac_lib_checking.m4?root=semagramme ac_lib_checking.m4 || true
cd config && aclocal
cd config && autoconf -o ../configure configure.ac
rm -rf config.status config.log autom4te.cache config/autom4te.cache config/ac_lib_checking.m4
clean:
@make -C src clean
@make -C src/parser clean
rm -f config.log confdefs.h config.status
purge: clean
rm -f config/Makefile
rm -f config/ac_lib_checking.m4
rm -f Makefile src/Makefile test/Makefile
rm -rf doc
LIB_DEP = libgrew_types.cmi libgrew.cmi libgrew.cma libgrew.cmxa libgrew.a
uninstall:
$(OCAMLFIND) remove libgrew > /dev/null
......@@ -32,7 +10,6 @@ uninstall:
uninstall_dev:
$(OCAMLFIND) remove libgrew_dev > /dev/null
LIB_DEP = libgrew_types.cmi libgrew.cmi libgrew.cma libgrew.cmxa libgrew.a
install: uninstall
cp META META_
......@@ -53,8 +30,27 @@ install_dev: uninstall_dev
mv META_ META
cp data/style.css $(DESTDIR)$(DATA_DIR)/
conf: config/configure.ac
cd config && rm -rf ac_lib_checking.*
cd config && wget https://gforge.inria.fr/scm/viewvc.php/*checkout*/ac_lib_checking/ac_lib_checking.m4?root=semagramme --no-check-certificate || true
cd config && mv ac_lib_checking.m4?root=semagramme ac_lib_checking.m4 || true
cd config && aclocal
cd config && autoconf -o ../configure configure.ac
rm -rf config.status config.log autom4te.cache config/autom4te.cache config/ac_lib_checking.m4
.PHONY: doc
clean:
@make -C src clean
@make -C src/parser clean
rm -f config.log confdefs.h config.status
purge: clean
rm -f config/Makefile
rm -f config/ac_lib_checking.m4
rm -f Makefile src/Makefile test/Makefile
rm -rf doc
.PHONY: doc
doc:
@make -C src doc
include config/Makefile
......@@ -26,10 +26,15 @@ XML_LIGHT_DIR = @XMLLIGHT_INCLUDE@
XML_LIGHT_BYTE = $(XML_LIGHT_DIR) xml-light.cma
XML_LIGHT_OPT = $(XML_LIGHT_DIR) xml-light.cmxa
DEP2PICT=@DEP2PICT@
ifeq (@DEP2PICT@,no)
DEP2PICT=no
else
DEP2PICT=yes
DEP2PICT_DIR = @DEP2PICT_INCLUDE@
DEP2PICT_BYTE = $(DEP2PICT_DIR) dep2pict.cma
DEP2PICT_OPT = $(DEP2PICT_DIR) dep2pict.cmxa
endif
ANSITERMINAL_DIR = @ANSITERMINAL_INCLUDE@
ANSITERMINAL_BYTE = $(ANSITERMINAL_DIR) ANSITerminal.cma
......
......@@ -67,15 +67,15 @@ if test "$config" = yes ; then
AC_LIB_CHECKING(Xml-light,xml-light,xml-light,xml-light,XmlParser,"",true,true)
AC_SUBST(XMLLIGHT_INCLUDE,$LIB_INCLUDE)
# Dep2pict is optionnal
AC_LIB_CHECKING(Dep2pict,dep2pict,dep2pict,dep2pict,Dep2pict,"",false,true)
AC_SUBST(DEP2PICT_INCLUDE,$LIB_INCLUDE)
if test "$dep2pict" = no || test "$DEP2PICT_INCLUDE_INCLUDE" = no ; then
AC_SUBST(DEP2PICT,no)
else
AC_SUBST(DEP2PICT,yes)
fi
# Dep2pict is optionnal
AC_LIB_CHECKING(Dep2pict,dep2pict,dep2pict,dep2pict,Dep2pict,"",false,true)
if test "$dep2pict" = no; then
AC_SUBST(DEP2PICT,no)
else
AC_SUBST(DEP2PICT,yes)
AC_SUBST(DEP2PICT_INCLUDE,$LIB_INCLUDE)
fi
fi
......
......@@ -592,8 +592,8 @@ INFO
MESSAGE
WARNING
DEBUG
DEP2PICT
DEP2PICT_INCLUDE
DEP2PICT
XMLLIGHT_INCLUDE
LOG_INCLUDE
ANSITERMINAL_INCLUDE
......@@ -2382,8 +2382,9 @@ $as_echo "The $NAME library is missing." >&6; }
XMLLIGHT_INCLUDE=$LIB_INCLUDE
# Dep2pict is optionnal
MACRO="A"
# Dep2pict is optionnal
MACRO="A"
MACRO=$MACRO"C_LIB_CHECKING"
......@@ -2513,16 +2514,15 @@ $as_echo "The $NAME library is missing." >&6; }
rm c_check_$STD_FOLDER.cmo >& /dev/null
rm c_check_$STD_FOLDER.cmi >& /dev/null
DEP2PICT_INCLUDE=$LIB_INCLUDE
if test "$dep2pict" = no; then
DEP2PICT=no
else
DEP2PICT=yes
if test "$dep2pict" = no || test "$DEP2PICT_INCLUDE_INCLUDE" = no ; then
DEP2PICT=no
else
DEP2PICT=yes
DEP2PICT_INCLUDE=$LIB_INCLUDE
fi
fi
fi
......
ifeq (@DEP2PICT@,no)
PP = -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\"'
else
PP = -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\" -DDEP2PICT'
endif
PRE_FILES_DEP = grew_base grew_types grew_ast
PRE_FILES_CMO = $(PRE_FILES_DEP:%=%.cmo)
......@@ -32,22 +37,12 @@ parser_byte:
@make -C parser byte
libgrew.cma : $(FILES_CMO) parser_byte libgrew.mli libgrew.ml
ifeq (@DEP2PICT@,no)
$(OCAMLC) -c -pp 'camlp4o pa_macro.cmo' $(BYTE_FLAGS) $(FILES_CMO) $(XML_LIGHT_BYTE) str.cma -I parser $(PARSER_CMO) libgrew.mli
$(OCAMLC) -a -o libgrew.cma $(BYTE_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\"' -linkall -I parser $(LOG_DIR) $(PRE_FILES_CMO) $(PARSER_CMO) $(POST_FILES_CMO) libgrew.ml
else
$(OCAMLC) -c -pp 'camlp4o pa_macro.cmo -DDEP2PICT' $(BYTE_FLAGS) $(FILES_CMO) $(XML_LIGHT_BYTE) str.cma -I parser $(PARSER_CMO) libgrew.mli
$(OCAMLC) -a -o libgrew.cma $(BYTE_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\" -DDEP2PICT' -linkall -I parser $(LOG_DIR) $(DEP2PICT_DIR) $(PRE_FILES_CMO) $(PARSER_CMO) $(POST_FILES_CMO) libgrew.ml
endif
$(OCAMLC) -c $(PP) $(BYTE_FLAGS) $(FILES_CMO) $(XML_LIGHT_BYTE) str.cma -I parser $(PARSER_CMO) libgrew.mli
$(OCAMLC) -a -o libgrew.cma $(BYTE_FLAGS) $(PP) -linkall -I parser $(LOG_DIR) $(DEP2PICT_DIR) $(PRE_FILES_CMO) $(PARSER_CMO) $(POST_FILES_CMO) libgrew.ml
libgrew.cmxa : $(FILES_CMX) parser_opt libgrew.mli libgrew.ml
ifeq (@DEP2PICT@,no)
$(OCAMLOPT) -c -pp 'camlp4o pa_macro.cmo' $(OPT_FLAGS) $(FILES_CMX) $(LOG_OPT) $(XML_LIGHT_OPT) str.cmxa -I parser $(PARSER_CMX) libgrew.mli
$(OCAMLOPT) -a -o libgrew.cmxa $(OPT_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\"' -linkall -I parser $(LOG_DIR) $(PRE_FILES_CMX) $(PARSER_CMX) $(POST_FILES_CMX) libgrew.ml
else
$(OCAMLOPT) -c -pp 'camlp4o pa_macro.cmo -DDEP2PICT' $(FILES_CMX) $(XML_LIGHT_OPT) str.cmxa -I parser $(PARSER_CMX) libgrew.mli
$(OCAMLOPT) -a -o libgrew.cmxa -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\" -DDEP2PICT' -linkall -I parser $(LOG_DIR) $(DEP2PICT_DIR) $(PRE_FILES_CMX) $(PARSER_CMX) $(POST_FILES_CMX) libgrew.ml
endif
$(OCAMLOPT) -c $(PP) $(FILES_CMX) $(XML_LIGHT_OPT) str.cmxa -I parser $(PARSER_CMX) libgrew.mli
$(OCAMLOPT) -a -o libgrew.cmxa $(PP) -linkall -I parser $(LOG_DIR) $(DEP2PICT_DIR) $(PRE_FILES_CMX) $(PARSER_CMX) $(POST_FILES_CMX) libgrew.ml
DEPENDS_DIR= -I parser $(LOG_DIR)
......@@ -110,10 +105,10 @@ grew_html.cmi: $(GREW_HTML_CMI) grew_html.mli
$(OCAMLC) -c grew_html.mli
grew_html.cmo: $(GREW_HTML_CMO) grew_html.cmi grew_html.ml
$(OCAMLC) $(BYTE_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\"' -c $(DEPENDS_DIR) grew_html.ml
$(OCAMLC) $(BYTE_FLAGS) $(PP) -c $(DEPENDS_DIR) grew_html.ml
grew_html.cmx: $(GREW_HTML_CMX) grew_html.cmi grew_html.ml
$(OCAMLOPT) $(OPT_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\"' -c $(DEPENDS_DIR) grew_html.ml
$(OCAMLOPT) $(OPT_FLAGS) $(PP) -c $(DEPENDS_DIR) grew_html.ml
################################################################################
###### grew_fs.ml ##############################################################
......@@ -228,18 +223,10 @@ grew_rule.cmi: $(GREW_RULE_CMI) grew_rule.mli
$(OCAMLC) -c grew_rule.mli
grew_rule.cmo: $(GREW_RULE_CMO) grew_rule.cmi grew_rule.ml
ifeq (@DEP2PICT@,no)
$(OCAMLC) -pp 'camlp4o pa_macro.cmo' $(BYTE_FLAGS) -c $(DEPENDS_DIR) grew_rule.ml
else
$(OCAMLC) -pp 'camlp4o pa_macro.cmo -DDEP2PICT' $(BYTE_FLAGS) -c $(DEPENDS_DIR) $(DEP2PICT_BYTE) grew_rule.ml
endif
$(OCAMLC) $(PP) $(BYTE_FLAGS) -c $(DEPENDS_DIR) $(DEP2PICT_BYTE) grew_rule.ml
grew_rule.cmx: $(GREW_RULE_CMX) grew_rule.cmi grew_rule.ml
ifeq (@DEP2PICT@,no)
$(OCAMLOPT) -pp 'camlp4o pa_macro.cmo' $(OPT_FLAGS) -c $(DEPENDS_DIR) grew_rule.ml
else
$(OCAMLOPT) -pp 'camlp4o pa_macro.cmo -DDEP2PICT' $(OPT_FLAGS) -c $(DEPENDS_DIR) $(DEP2PICT_OPT) grew_rule.ml
endif
$(OCAMLOPT) $(PP) $(OPT_FLAGS) -c $(DEPENDS_DIR) $(DEP2PICT_OPT) grew_rule.ml
################################################################################
......@@ -253,10 +240,10 @@ grew_grs.cmi: $(GREW_GRS_CMI) grew_grs.mli
$(OCAMLC) -c grew_grs.mli
grew_grs.cmo: parser_byte $(GREW_GRS_CMO) grew_grs.cmi grew_grs.ml
$(OCAMLC) $(BYTE_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\"' -c $(DEPENDS_DIR) grew_grs.ml
$(OCAMLC) $(BYTE_FLAGS) $(PP) -c $(DEPENDS_DIR) grew_grs.ml
grew_grs.cmx: parser_opt $(GREW_GRS_CMX) grew_grs.cmi grew_grs.ml
$(OCAMLOPT) $(OPT_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\"' -c $(DEPENDS_DIR) grew_grs.ml
$(OCAMLOPT) $(OPT_FLAGS) $(PP) -c $(DEPENDS_DIR) grew_grs.ml
################################################################################
# others
......
......@@ -83,7 +83,7 @@ let build_html_doc ?(corpus=false) dir grs =
) ()
ELSE
let build_html_doc ?(corpus=false) dir grs =
handle ~name:"build_doc [without Dep2pict]" (fun () -> Html_doc.build ~corpus ~dep:false grs_ dir) ()
handle ~name:"build_doc [without Dep2pict]" (fun () -> Html_doc.build ~corpus ~dep:false dir grs) ()
END
let load_grs file =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment