1 ########################## User's variables #####################
3 # The Caml sources (including camlyacc and camllex source files)
5 SOURCES
= types.ml parser.mly lexer.mll value.ml signal.ml faustexp.ml interpreter.ml preprocess.ml main.ml preprocess_stubs.
cpp
7 # The executable file to generate
11 # Path to sndfile library
12 SNDFILE_PATH
= /home
/wang
/Desktop
/libsndfile-ocaml
15 FAUST_PATH
= faust-0.9
.47mr3
17 # Path to preprocessor library
18 PREPROCESSOR_PATH
= $(FAUST_PATH
)/compiler
20 # Path to preprocessor header files
21 PREPROCESSOR_INCLUDE_PATH
= $(PREPROCESSOR_PATH
)/headers
23 # Path to the interpretor documentation
24 OCAML_DOC_PATH
= ..
/documentation
26 ########################## Advanced user's variables #####################
29 # You may fix here the path to access the Caml compiler on your machine
30 # You may also have to add various -I options.
39 # The list of Caml libraries needed by the program
41 # LIBS=$(WITHGRAPHICS) $(WITHUNIX) $(WITHSTR) $(WITHNUMS) $(WITHTHREADS)\
44 LIBS
= $(WITHSNDFILE
) $(WITHUNIX
)
46 # Should be set to -INCLUDE if you use any of the libraries above
47 # or if any C code have to be linked with your program
48 # (irrelevant for ocamlopt)
52 INCLUDE
= -I
$(SNDFILE_PATH
)
54 # Default setting of the WITH* variables. Should be changed if your
55 # local libraries are not found by the compiler.
56 #WITHGRAPHICS =graphics.cma -cclib -lgraphics -cclib -L/usr/X11R6/lib -cclib -lX11
58 #WITHUNIX =unix.cma -cclib -lunix
60 #WITHSTR =str.cma -cclib -lstr
62 #WITHNUMS =nums.cma -cclib -lnums
64 #WITHTHREADS =threads.cma -cclib -lthreads
66 #WITHDBM =dbm.cma -cclib -lmldbm -cclib -lndbm
70 WITHSNDFILE
= sndfile.cma
75 # The list of options for each compiler
76 CAMLC_OPTIONS
= $(GPP_CALL
) $(INCLUDE
) $(LIBS
)
77 CAMLOPT_OPTIONS
= -p
$(GPP_CALL
) $(INCLUDE
) $(LIBS
:.cma
=.cmxa
)
78 CAMLDOC_OPTIONS
= -d
$(OCAML_DOC_PATH
) -html
$(INCLUDE
)
79 CC_OPTIONS
= -c
-I
$(PREPROCESSOR_INCLUDE_PATH
)
81 ################ End of user's variables #####################
84 ##############################################################
85 ################ This part should be generic
86 ################ Nothing to set up or fix here
87 ##############################################################
89 all:: .depend.input .depend preprocessor
$(EXEC
)
91 opt
: .depend.input .depend preprocessor
$(EXEC
).opt
95 #ocamlc -INCLUDE other options graphics.cma other files -cclib -lgraphics -cclib -lX11
96 #ocamlc -thread -INCLUDE other options threads.cma other files -cclib -lthreads
97 #ocamlc -INCLUDE other options str.cma other files -cclib -lstr
98 #ocamlc -INCLUDE other options nums.cma other files -cclib -lnums
99 #ocamlc -INCLUDE other options unix.cma other files -cclib -lunix
100 #ocamlc -INCLUDE other options dbm.cma other files -cclib -lmldbm -cclib -lndbm
102 SMLIY
= $(SOURCES
:.mly
=.ml
)
103 SMLIYL
= $(SMLIY
:.mll
=.ml
)
104 SMLYL
= $(filter %.ml
, $(SMLIYL
))
105 OBJS
= $(SMLYL
:.ml
=.cmo
)
106 OPTOBJS
= $(OBJS
:.cmo
=.cmx
)
108 CSOURCES
= $(filter %.
cpp, $(SOURCES
))
109 COBJS
= $(CSOURCES
:.
cpp=.o
)
110 CLIBS
= $(PREPROCESSOR_PATH
)/preprocess.a
112 PARSER_MLY
= $(filter %.mly
, $(SOURCES
))
113 LEXER_MLL
= $(filter %.mll
, $(SOURCES
))
114 MIDDLE_ML
= $(PARSER_MLY
:.mly
=.ml
) $(LEXER_MLL
:.mll
=.ml
)
117 @
(cd
$(FAUST_PATH
) && $(MAKE
))
119 $(EXEC
): $(OBJS
) $(COBJS
)
120 $(CAMLC
) $(CAMLC_OPTIONS
) -o
$(EXEC
) $(OBJS
) $(COBJS
) $(CLIBS
)
122 $(EXEC
).opt
: $(OPTOBJS
) $(COBJS
)
123 $(CAMLOPT
) $(CAMLOPT_OPTIONS
) -o
$(EXEC
) $(OPTOBJS
) $(COBJS
) $(CLIBS
)
125 document
: $(SMLYL
) $(OBJS
)
126 $(CAMLDOC
) $(CAMLDOC_OPTIONS
) $(SMLYL
)
129 $(CAMLC
) $(INCLUDE
) -c
$<
132 $(CAMLOPT
) $(INCLUDE
) -c
$<
134 preprocess.cmo
: preprocess.ml
135 $(CAMLC
) $(GPP_CALL
) -c
$<
137 preprocess.cmx
: preprocess.ml
138 $(CAMLOPT
) $(GPP_CALL
) -c
$<
140 preprocess_stubs.o
: preprocess_stubs.
cpp
141 $(CC
) $(CC_OPTIONS
) $<
143 .SUFFIXES
: .ml .mli .cmo .cmi .cmx .mll .mly
183 rm -f
*.cm
[iox
] *~ .
*~
#*#
185 rm -f
$(MIDDLE_ML
) *.o
*.mli
187 .depend.input
: Makefile
188 @echo
-n
'--Checking Ocaml input files: '
189 @
(ls
$(SMLIY
) $(SMLIY
:.ml
=.mli
) 2>/dev
/null || true
) \
191 @diff .depend.new .depend.input
2>/dev
/null
1>/dev
/null
&& \
192 (echo
'unchanged'; rm -f .depend.new
) || \
193 (echo
'changed'; mv .depend.new .depend.input
)
197 .depend
:: $(SMLIY
) .depend.input
198 @echo
'--Re-building dependencies'
199 $(CAMLDEP
) $(SMLIY
) $(SMLIY
:.ml
=.mli
) > .depend