Skip to content
This repository has been archived by the owner on Jun 4, 2019. It is now read-only.

Commit

Permalink
more make install-findlib
Browse files Browse the repository at this point in the history
  • Loading branch information
pad committed Nov 13, 2013
1 parent 8dd1618 commit 4603660
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 34 deletions.
8 changes: 6 additions & 2 deletions Makefile
Expand Up @@ -478,10 +478,14 @@ INSTALL_SUBDIRS= \
commons h_program-lang matcher \
lang_js/parsing

install-findlib: all all.opt
LIBNAME=pfff
install-findlib::
ocamlfind install $(LIBNAME) META \

install-findlib:: all all.opt
set -e; for i in $(INSTALL_SUBDIRS); do echo $$i; $(MAKE) -C $$i install-findlib; done

uninstall-findlib:
uninstall-findlib::
set -e; for i in $(INSTALL_SUBDIRS); do echo $$i; $(MAKE) -C $$i uninstall-findlib; done

version:
Expand Down
16 changes: 15 additions & 1 deletion Makefile.common
Expand Up @@ -6,6 +6,7 @@

# This file assumes the "includer" will have set a few variables and then do a
# include Makefile.common. Here are those variables:
# - TOP
# - SRC
# - INCLUDEDIRS

Expand All @@ -14,6 +15,12 @@
# - TEXMAIN
# - TEX

# For (un)installation, we assume:
# - LIBNAME

# this can set extra flags like -bin-annot that we want to be everywhere
-include $(TOP)/Makefile.config

##############################################################################
# Generic variables
##############################################################################
Expand All @@ -31,7 +38,7 @@ OPTOBJS?= $(SRC:.ml=.cmx)
#dont use -custom, it makes the bytecode unportable.

#-w +9 is for better warning on records, needs ocaml 3.12
OCAMLCFLAGS?=-g -dtypes $(OCAMLCFLAGS_EXTRA) -thread -w +9 -w -21 -warn-error +a
OCAMLCFLAGS=-g -dtypes $(OCAMLCFLAGS_EXTRA) -thread -w +9 -w -21 -warn-error +a

# This flag is also used in subdirectories so don't change its name here.
OPTFLAGS?=-thread -g
Expand Down Expand Up @@ -101,6 +108,13 @@ doti:
ps2pdf Fig_graph_mli.ps
rm -f Fig_graph_mli.ps

##############################################################################
# Install
##############################################################################

uninstall-findlib::
ocamlfind remove $(LIBNAME)

##############################################################################
# Generic ocaml rules
##############################################################################
Expand Down
7 changes: 3 additions & 4 deletions commons/Makefile
Expand Up @@ -419,15 +419,14 @@ install: all all.opt
common.mli ocaml.mli \
$(OCAMLSTDLIB)/$(LIBNAME)


# note that the dlllib.so will be added in lib/stublibs/
install-findlib: all all.opt
ocamlfind install $(LIBNAME) META \
lib.cma lib.cmxa lib.a \
ocamlfind install $(LIBNAME) META lib.cma lib.cmxa lib.a \
dlllib.so liblib.a \
$(EXPORTSRC) $(EXPORTSRC:%.mli=%.cmi) $(EXPORTSRC:%.mli=%.cmt)

uninstall-findlib:
ocamlfind remove pfff-commons
ocamlfind remove $(LIBNAME)

##############################################################################
# Literate Programming rules
Expand Down
3 changes: 2 additions & 1 deletion configure
Expand Up @@ -20,7 +20,8 @@ use Pod::Usage;
# we could make it a configuration option
# - lang_ml/ also requires compiler-libs and with the many changes in the
# .cmt format, this can easily break compilations, maybe we could also
# make it a configuration option
# make it a configuration option. In the same way we should not force
# to use -bin-annot
# - findutils? we need a good gnu find, not the macos find
# which adds some extra '//' in paths which bothers pfff
# - sharutils still?, for obrowser/ocsigen use of uuencode
Expand Down
9 changes: 6 additions & 3 deletions demos/Makefile
Expand Up @@ -112,7 +112,7 @@ clean::


##############################################################################
# Compilation once installed
# Simple compilation once installed
##############################################################################

LIBS2= \
Expand All @@ -121,11 +121,14 @@ LIBS2= \
$(shell ocamlfind query pfff-matcher) \
$(shell ocamlfind query pfff-lang_js) \

STUBDIR=$(shell ocamlfind query pfff-commons)/../stublibs \

# -custom so that don't need to find the dlllib.so
test_install: pfff_linking.ml
ocamlc $(SYSLIBS) $(LIBS2:%=%/lib.cma) $(LIBS2:%=-I %) pfff_linking.ml -o pfff_linking
ocamlc -custom $(SYSLIBS) $(LIBS2:%=%/lib.cma) $(LIBS2:%=-I %) -I $(STUBDIR) pfff_linking.ml -o pfff_linking

test_install.opt: pfff_linking.ml
ocamlopt $(SYSLIBS:%.cma=%.cmxa) $(LIBS2:%=%/lib.cmxa) $(LIBS2:%=-I %) pfff_linking.ml -o pfff_linking
ocamlopt $(SYSLIBS:%.cma=%.cmxa) $(LIBS2:%=%/lib.cmxa) $(LIBS2:%=-I %) -I $(STUBDIR) pfff_linking.ml -o pfff_linking.opt


##############################################################################
Expand Down
3 changes: 3 additions & 0 deletions demos/pfff_linking.ml
@@ -1,5 +1,8 @@
open Common

(* usage: ./pfff_linking ../demos/foo.js which will dump the AST of a
* javascript program
*)
let main () =
let file = Sys.argv.(1) in
let ((ast, _toks), _) = Parse_js.parse file in
Expand Down
10 changes: 2 additions & 8 deletions h_program-lang/Makefile
Expand Up @@ -63,7 +63,6 @@ clean::
rm -f $(TARGET).top



archi_code_lexer.ml: archi_code_lexer.mll
$(OCAMLLEX) $<
clean::
Expand All @@ -73,15 +72,10 @@ beforedepend:: archi_code_lexer.ml
##############################################################################
# install
##############################################################################
OCAMLSTDLIB=`ocamlc -where`
LIBNAME=pfff-h_program-lang
DESTDIR=$(OCAMLSTDLIB)/$(LIBNAME)
EXPORTSRC=parse_info.mli

install-findlib: all all.opt
ocamlfind install $(LIBNAME) META \
lib.cma lib.cmxa lib.a \
parse_info.mli parse_info.cmi

uninstall-findlib:
ocamlfind remove $(LIBNAME)

$(EXPORTSRC) $(EXPORTSRC:%.mli=%.cmi) $(EXPORTSRC:%.mli=%.cmt)
13 changes: 3 additions & 10 deletions lang_js/parsing/Makefile
Expand Up @@ -76,19 +76,12 @@ visitor_js.cmo: visitor_js.ml
##############################################################################
# install
##############################################################################
OCAMLSTDLIB=`ocamlc -where`
LIBNAME=pfff-lang_js
DESTDIR=$(OCAMLSTDLIB)/$(LIBNAME)

EXPORTSRC=meta_ast_js.mli \
parser_js.mli parse_js.mli \
lib_parsing_js.mli visitor_js.mli \

install-findlib:
ocamlfind install $(LIBNAME) META \
lib.cma lib.cmxa lib.a \
ast_js.ml ast_js.cmi \
$(EXPORTSRC) $(EXPORTSRC:%.mli=%.cmi)

uninstall-findlib:
ocamlfind remove $(LIBNAME)
ocamlfind install $(LIBNAME) META lib.cma lib.cmxa lib.a \
$(EXPORTSRC) $(EXPORTSRC:%.mli=%.cmi) $(EXPORTSRC:%.mli=%.cmt) \
ast_js.ml ast_js.cmi
6 changes: 1 addition & 5 deletions matcher/Makefile
Expand Up @@ -49,14 +49,10 @@ clean::
##############################################################################
# install
##############################################################################
OCAMLSTDLIB=`ocamlc -where`
LIBNAME=pfff-matcher
DESTDIR=$(OCAMLSTDLIB)/$(LIBNAME)
EXPORTSRC=

install-findlib: all all.opt
ocamlfind install $(LIBNAME) META \
lib.cma lib.cmxa lib.a \

uninstall-findlib:
ocamlfind remove $(LIBNAME)

0 comments on commit 4603660

Please sign in to comment.