2 # Makefile to generate SPPoC
6 # Some constants for compilation
9 include Etc
/Makefile.config
12 # Some constants for the project
14 TOP_DIRS
=Omega CipolCore Pip CInterface
$(CAML_DIRS
)
15 TOP_LIBS_DIRS
=-I
$(OCAML_INCLUDES
) $(OINCLUDES
) \
16 -cclib
"-LLibs $(patsubst %,-L%,$(LIBS_LIBS))"
17 TOP_LIBS_DIRS_INSTALL
=-I
$(OCAML_INCLUDES
) $(OINCLUDES
) \
18 -cclib
"-L$(INSTALL_LIB_DIR) $(patsubst %,-L%,$(LIBS_LIBS))"
19 TOP_LIBS
=$(OCAML_LIBS
) -cclib
"-lstdc++ -lunix -lstr -lnums -linterf \
20 -lpip -lomega -lomegastub -lpoly -lsys -lcom -lsys -lcipol \
21 -lgmp -lpolylib$(BITS)"
22 CAML_LIBS
=$(shell echo
$(CAML_DIRS
)| sed
's/\([^ ]*\)/\1\/\1$(EXTBIB)/g')
23 C_LIBS
=CInterface
/libinterf.a Pip
/libpip.a \
24 CipolCore
/Polylib
/libpoly.a CipolCore
/System
/libsys.a \
25 CipolCore
/System
/libsys.a CipolCore
/Common
/libcom.a \
26 CipolCore
/libcipol.a Omega
/libomega.a Omega
/libomegastub.a
27 C_LIBS_INSTALLED
=$(foreach LIB
,$(notdir $(C_LIBS
)),Libs
/$(LIB
))
33 all: links
$(patsubst %, _dir_
%, $(TOP_DIRS
)) Bin
/sppoctop \
34 Bin
/libsppoc.cma Bin
/camlp5sppoc
36 Bin
/sppoctop
: $(CAML_LIBS
) $(C_LIBS_INSTALLED
)
37 $(OMKTOP
) -o Bin
/sppoctop
$(TOP_LIBS_DIRS
) $(TOP_LIBS
) \
38 $(OCAMLLIBS
) $(CAML_LIBS
)
40 Bin
/libsppoc.cma
: $(CAML_LIBS
) $(C_LIBS_INSTALLED
)
41 $(OCC
) -a
-o Bin
/libsppoc.cma
$(TOP_LIBS_DIRS
) $(TOP_LIBS
) \
42 $(OCAMLLIBS
) $(CAML_LIBS
)
44 Bin
/camlp5sppoc
: $(CAML_LIBS
)
45 $(MKCAMLP5
) -custom
-o Bin
/camlp5sppoc pa_o.cmo pa_op.cmo Formel
/quotes.cmo pr_dump.cmo
47 $(patsubst %,_dir_
%,$(TOP_DIRS
)):
48 cd
$(patsubst _dir_
%,%,$@
) && $(MAKE
)
51 # To copy all the C libraries at the same place
53 Libs
/libomega.a
: Omega
/libomega.a
56 Libs
/libomegastub.a
: Omega
/libomegastub.a
59 Libs
/libinterf.a
: CInterface
/libinterf.a
62 Libs
/libpip.a
: Pip
/libpip.a
65 Libs
/libpoly.a
: CipolCore
/Polylib
/libpoly.a
68 Libs
/libsys.a
: CipolCore
/System
/libsys.a
71 Libs
/libcom.a
: CipolCore
/Common
/libcom.a
74 Libs
/libcipol.a
: CipolCore
/libcipol.a
78 # Targets to make the links needed by the compilation
80 .PHONY
: links links_make_ocaml links_make_test
81 links
: links_make_ocaml links_make_test
85 for
dir in
$(CAML_DIRS
) ; do \
86 ( cd
$${dir} ; test -L Makefile || \
87 ln
-s ..
/Etc
/Makefile.ocaml Makefile
); done
90 for
dir in
$(TEST_DIRS
) ; do \
91 ( cd
$${dir} ; test -L Makefile || \
92 ln
-s ..
/Etc
/Makefile.
test Makefile
); done
98 depend
: links
$(patsubst %, _dep_
%, $(TOP_DIRS
))
100 $(patsubst %,_dep_
%,$(TOP_DIRS
)):
101 cd
$(patsubst _dep_
%,%,$@
) && $(MAKE
) depend
106 install: all sppoc libsppoc.cma
107 install -d
$(INSTALL_BIN_DIR
)
108 install -m a
=rx
,u
+w sppoc Bin
/sppoctop Bin
/camlp5sppoc
$(INSTALL_BIN_DIR
)
109 install -d
$(INSTALL_LIB_DIR
)
110 install -m a
=r
,u
+w Libs
/*.a libsppoc.cma Formel
/sPPoC.cmi Etc
/sppocinit.ml Etc
/.ocamlinit
$(INSTALL_LIB_DIR
)
113 sppoc
: Makefile Etc
/Makefile.config
114 echo
'#!/bin/sh' > sppoc
115 echo
'# *** WARNING *** AUTOMATICALLY GENERATED PART *** SHOULD\
116 NOT BE MODIFIED ***' >> sppoc
117 echo
'LEDIT=`which ledit` 2> /dev/null' >> sppoc
118 echo
'if [ ! -x "$${LEDIT}" ] ; then LEDIT="" ; fi' >> sppoc
119 echo
'if [ ! -f ".ocamlinit" ] ; then cp $(INSTALL_LIB_DIR)/.ocamlinit . ; chmod a=r,u+w .ocamlinit ; fi' >> sppoc
120 echo
'exec $${LEDIT} $(INSTALL_BIN_DIR)/sppoctop -I $(INSTALL_LIB_DIR) -I `camlp5 -where` $$@' >> sppoc
122 libsppoc.cma
: Makefile Etc
/Makefile.config Bin
/libsppoc.cma
123 $(OCC
) -a
-o libsppoc.cma
$(TOP_LIBS_DIRS_INSTALL
) $(TOP_LIBS
) \
124 camlp5.cma
$(OCAMLLIBS
) $(CAML_LIBS
)
132 for
dir in
$(TOP_DIRS
) ; do
(cd
$$dir; $(MAKE
) clean); done
136 for
dir in
$(TOP_DIRS
) ; do
(cd
$$dir; $(MAKE
) realclean); done
137 -rm -rf Bin
/sppoctop Libs
141 distclean : realclean
142 -rm -rf CVS .cvsignore
143 -rm -rf
*/CVS
*/.cvsignore
144 -rm -rf
*/*/CVS
*/*/.cvsignore
145 -rm -rf
*/*/*/CVS
*/*/*/.cvsignore
146 -rm -rf
*/*/*/*/CVS
*/*/*/*/.cvsignore
149 # To build a distribution
152 cd ..
&& tar czf sppoc.tgz sppoc