Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 719 lines (565 sloc) 20.506 kb
8634b74 initial import into fresh git repo.
pad authored
1 #############################################################################
2 # Configuration section
3 #############################################################################
4
5 -include Makefile.config
6
7 ##############################################################################
8 # Variables
9 ##############################################################################
10 TOP=$(shell pwd)
11
12 SRC=test.ml main.ml
13
14 TARGET=pfff
15
16 #------------------------------------------------------------------------------
17 # Program related variables
18 #------------------------------------------------------------------------------
19
20 PROGS=pfff
21
22 PROGS+=sgrep
23 PROGS+=spatch
e8fac8d renamed main_tags.ml
pad authored
24 PROGS+=stags
7966cbd @aryx * lang_ml/analyze/graph_modules_packages_ml.ml: new file, also main_p…
aryx authored
25 PROGS+=pm_depend
26
8634b74 initial import into fresh git repo.
pad authored
27 PROGS+=ppp
28
a5fa1c6 update Makefile and readme for new pfff_db_heavy
pad authored
29 # note that without bdb, pfff_db will be incomplete regarding PHP
30 PROGS+=pfff_db
8634b74 initial import into fresh git repo.
pad authored
31 PROGS+=scheck
32
1b506a9 added main_test.ml to run the unit tests
pad authored
33 PROGS+=pfff_test
34
685c004 putting back support for persistent berkeley DB
pad authored
35 ifeq ($(FEATURE_BDB), 1)
a5fa1c6 update Makefile and readme for new pfff_db_heavy
pad authored
36 PROGS+=pfff_db_heavy
9efc1da introduce scheck_heavy
pad authored
37 PROGS+=scheck_heavy
685c004 putting back support for persistent berkeley DB
pad authored
38 endif
39
8634b74 initial import into fresh git repo.
pad authored
40 ifeq ($(FEATURE_VISUAL), 1)
6dea9bd rename pfff_visual in CodeMap and worked on the toc of the codemap ma…
pad authored
41 PROGS+=codemap
8634b74 initial import into fresh git repo.
pad authored
42 endif
43
44 OPTPROGS= $(PROGS:=.opt)
45
46 #------------------------------------------------------------------------------
47 #package dependencies
48 #------------------------------------------------------------------------------
49
50 #format: XXXDIR, XXXCMD, XXXCMDOPT, XXXINCLUDE (if different XXXDIR), XXXCMA
51 #template:
52 # ifeq ($(FEATURE_XXX), 1)
53 # XXXDIR=xxx
54 # XXXCMD= $(MAKE) -C xxx && $(MAKE) xxx -C commons
55 # XXXCMDOPT= $(MAKE) -C xxx && $(MAKE) xxx.opt -C commons
56 # XXXCMA=xxx/xxx.cma commons/commons_xxx.cma
57 # XXXSYSCMA=xxx.cma
58 # XXXINCLUDE=xxx
59 # else
60 # XXXCMD=
61 # XXXCMDOPT=
62 # endif
63
64
a5fa1c6 update Makefile and readme for new pfff_db_heavy
pad authored
65 # cf also below for target pfff_db_heavy
8634b74 initial import into fresh git repo.
pad authored
66 ifeq ($(FEATURE_BDB), 1)
67 BDBDIR=external/ocamlbdb
68 BDBCMD= $(MAKE) all -C $(BDBDIR) && $(MAKE) bdb -C commons
69 BDBCMDOPT= $(MAKE) all.opt -C $(BDBDIR) && $(MAKE) bdb.opt -C commons
70 BDBCMA=external/ocamlbdb/bdb.cma commons/commons_bdb.cma
71 BDBSYSCMA=
72 else
73 endif
74
75 # cf also below the target for pfff_browser
76 ifeq ($(FEATURE_GUI),1)
26cc32a Makefiles and configure: make cairo+gtk the default.
pad authored
77 GUIDIR=external/ocamlgtk
78 GUICMD= $(MAKE) all -C $(GUIDIR) && $(MAKE) gui -C commons
79 GUICMDOPT= $(MAKE) opt -C $(GUIDIR) && $(MAKE) gui.opt -C commons;
80 GTKINCLUDE=external/ocamlgtk/src
81 endif
82
83 # cf also below for target pfff_visual
84 ifeq ($(FEATURE_VISUAL),1)
85 CAIRODIR=external/ocamlcairo
86 CAIROINCLUDE=external/ocamlcairo/src
8634b74 initial import into fresh git repo.
pad authored
87 endif
88
89 ifeq ($(FEATURE_BACKTRACE), 1)
90 BTCMD= $(MAKE) backtrace -C commons
91 BTCMDOPT= $(MAKE) backtrace.opt -C commons
92 BTCMA=commons/commons_backtrace.cma
93 else
94 endif
95
96 ifeq ($(FEATURE_PCRE), 1)
97 REGEXPDIR=external/ocamlpcre
98 REGEXPCMD= $(MAKE) -C $(REGEXPDIR) && $(MAKE) regexp -C commons
99 REGEXPCMDOPT= $(MAKE) -C $(REGEXPDIR) && $(MAKE) regexp.opt -C commons
100 REGEXPCMA=external/ocamlpcre/lib/pcre.cma commons/commons_regexp.cma
26cc32a Makefiles and configure: make cairo+gtk the default.
pad authored
101 PCREINCLUDE=external/ocamlpcre/lib
8634b74 initial import into fresh git repo.
pad authored
102 else
103 endif
104
105 ifeq ($(FEATURE_MPI),1)
106 MPIDIR=external/ocamlmpi
107 MPICMD= $(MAKE) all -C $(MPIDIR) && $(MAKE) distribution -C commons
108 MPICMDOPT= $(MAKE) all.opt -C $(MPIDIR) && $(MAKE) distribution.opt -C commons
109 MPICMA=external/ocamlmpi/mpi.cma commons/commons_mpi.cma
110 endif
111
112 #------------------------------------------------------------------------------
113
114 # should be FEATURE_OCAMLGRAPH, or should give dependencies between features
115 GRAPHCMA=external/ocamlgraph/ocamlgraph.cma commons/commons_graph.cma
116 GRAPHDIR=external/ocamlgraph
117 GRAPHCMD= $(MAKE) all -C $(GRAPHDIR) && $(MAKE) graph -C commons
118 GRAPHCMDOPT= $(MAKE) all.opt -C $(GRAPHDIR) && $(MAKE) graph.opt -C commons
3d099fe removed some dependencies to ocamlbdb
pad authored
119
2d8dff7 Makefile: compiling ocamlthrift
pad authored
120 # for the moment it's used only by facebook/ code so could move in
121 # facebook/external/
122 THRIFTDIR=external/ocamlthrift
8634b74 initial import into fresh git repo.
pad authored
123
81bbf50 @aryx adding lang_html/parsing/, and integrate ocamlnet in compilation chain
aryx authored
124 # could be under some ifeq($(FEATURE_WEB))
125 OCAMLNETDIR=external/ocamlnet
dbdffae @aryx Makefiles, misc
aryx authored
126 OCAMLNETINCLUDE=external/ocamlnet/netsys external/ocamlnet/netstring
127 OCAMLNETCMA= \
128 external/ocamlnet/netsys/netsys_oothr.cma \
129 external/ocamlnet/netsys/netsys.cma \
130 external/ocamlnet/netstring/netstring.cma \
131
ab6a96e @aryx make opt now works again
aryx authored
132 # external/ocamlnet/netstring/netaccel.cma \
133
8bf36da @aryx pm_depend now use phylomel, test
aryx authored
134 PHYLOMELDIR=external/phylomel/src
135 PHYLOMELINCLUDE=external/phylomel/src
136 PHYLOMELCMA=external/phylomel/src/lib.cma
137
81bbf50 @aryx adding lang_html/parsing/, and integrate ocamlnet in compilation chain
aryx authored
138
8634b74 initial import into fresh git repo.
pad authored
139 ifeq ($(FEATURE_GRAPHICS), 1)
140 #GRAPHICSCMXA=graphics.cmxa
141 endif
142
26cc32a Makefiles and configure: make cairo+gtk the default.
pad authored
143 ifeq ($(FEATURE_VISUAL),1)
144 VISUALDIR=visual
145 endif
8634b74 initial import into fresh git repo.
pad authored
146
2f1bfad misc
pad authored
147 ifeq ($(FEATURE_FACEBOOK),1)
148 FACEBOOKDIR=facebook
149 endif
150
8634b74 initial import into fresh git repo.
pad authored
151 #------------------------------------------------------------------------------
152 # Main variables
153 #------------------------------------------------------------------------------
154 SYSLIBS=nums.cma bigarray.cma str.cma unix.cma
155
156 # used for sgrep and other small utilities which I dont want to depend
3d099fe removed some dependencies to ocamlbdb
pad authored
157 # on too much things
8634b74 initial import into fresh git repo.
pad authored
158 BASICLIBS=commons/commons.cma \
159 globals/globals.cma \
160 h_program-lang/lib.cma \
161 lang_ml/parsing/lib.cma \
ca330f9 Makefiles: adding lang_nw/
pad authored
162 lang_nw/parsing/lib.cma \
8634b74 initial import into fresh git repo.
pad authored
163 lang_php/parsing/lib.cma \
164 lang_php/matcher/lib.cma \
c7092a9 @aryx add skeleton for lang_css/parsing/
aryx authored
165 lang_cpp/parsing/lib.cma \
9919d5b adding lang_java/ to help visualize java code
pad authored
166 lang_java/parsing/lib.cma \
244ff04 lang_python: first skeleton
pad authored
167 lang_python/parsing/lib.cma \
58edd37 lang_csharp: parser and basic highlighter
pad authored
168 lang_csharp/parsing/lib.cma \
fc28b66 @aryx introduce lang_opa/
aryx authored
169 lang_opa/parsing/lib.cma \
30b92d9 @aryx erlang: basic lexer
aryx authored
170 lang_erlang/parsing/lib.cma \
81bbf50 @aryx adding lang_html/parsing/, and integrate ocamlnet in compilation chain
aryx authored
171 lang_html/parsing/lib.cma \
c7092a9 @aryx add skeleton for lang_css/parsing/
aryx authored
172 lang_js/parsing/lib.cma \
173 lang_css/parsing/lib.cma \
e241606 @aryx lang_web: empty -dump_web
aryx authored
174 lang_web/parsing/lib.cma \
49aefce org_mode: parsing support and skeleton for codemap
pad authored
175 lang_text/lib.cma \
8634b74 initial import into fresh git repo.
pad authored
176
177 BASICSYSLIBS=nums.cma bigarray.cma str.cma unix.cma
178
179 LIBS= commons/commons.cma \
180 $(BTCMA) \
181 $(BDBCMA) \
182 $(REGEXPCMA) \
183 $(MPICMA) \
81bbf50 @aryx adding lang_html/parsing/, and integrate ocamlnet in compilation chain
aryx authored
184 $(OCAMLNETCMA) \
b06171f @aryx * Makefile: fix for phylomel
aryx authored
185 $(GRAPHCMA) $(PHYLOMELCMA) \
8634b74 initial import into fresh git repo.
pad authored
186 commons/commons_features.cma \
187 h_version-control/lib.cma \
188 h_visualization/lib.cma \
189 h_program-lang/lib.cma \
190 h_program-visual/lib.cma \
191 globals/globals.cma \
192 lang_ml/parsing/lib.cma \
193 lang_ml/analyze/lib.cma \
ca330f9 Makefiles: adding lang_nw/
pad authored
194 lang_nw/parsing/lib.cma \
195 lang_nw/analyze/lib.cma \
270df00 skeleton for lang_lisp/
pad authored
196 lang_lisp/parsing/lib.cma \
197 lang_lisp/analyze/lib.cma \
f42b930 first proto for haskell lexer and highlighter
pad authored
198 lang_haskell/parsing/lib.cma \
199 lang_haskell/analyze/lib.cma \
8634b74 initial import into fresh git repo.
pad authored
200 lang_php/parsing/lib.cma \
201 lang_php/analyze/foundation/lib.cma \
202 lang_php/analyze/tools/lib.cma \
203 lang_php/analyze/checker/lib.cma \
204 lang_php/matcher/lib.cma \
3d099fe removed some dependencies to ocamlbdb
pad authored
205 lang_php/analyze/database/lib.cma \
206 lang_php/analyze/static_analysis/lib.cma \
4eba308 make top works again. Also add file_type for readme and .emacs
pad authored
207 lang_php/analyze/dynamic_analysis/lib.cma \
3d099fe removed some dependencies to ocamlbdb
pad authored
208 lang_php/analyze/qa_test/lib.cma \
685c004 putting back support for persistent berkeley DB
pad authored
209 lang_php/analyze/lib.cma \
adcf589 @aryx * lang_php/pretty/Makefile: julien's pretty printer, coming from private
aryx authored
210 lang_php/pretty/lib.cma \
8634b74 initial import into fresh git repo.
pad authored
211 lang_sql/parsing/lib.cma \
212 lang_js/parsing/lib.cma \
213 lang_js/analyze/lib.cma \
214 lang_cpp/parsing/lib.cma \
215 lang_cpp/analyze/lib.cma \
9919d5b adding lang_java/ to help visualize java code
pad authored
216 lang_java/parsing/lib.cma \
217 lang_java/analyze/lib.cma \
244ff04 lang_python: first skeleton
pad authored
218 lang_python/parsing/lib.cma \
219 lang_python/analyze/lib.cma \
58edd37 lang_csharp: parser and basic highlighter
pad authored
220 lang_csharp/parsing/lib.cma \
221 lang_csharp/analyze/lib.cma \
fc28b66 @aryx introduce lang_opa/
aryx authored
222 lang_opa/parsing/lib.cma \
223 lang_opa/analyze/lib.cma \
30b92d9 @aryx erlang: basic lexer
aryx authored
224 lang_erlang/parsing/lib.cma \
ebdc9ad @aryx erlang: basic highlighter
aryx authored
225 lang_erlang/analyze/lib.cma \
81bbf50 @aryx adding lang_html/parsing/, and integrate ocamlnet in compilation chain
aryx authored
226 lang_text/lib.cma \
227 lang_html/parsing/lib.cma \
d62b500 @aryx adding an empty lang_html/analyze/
aryx authored
228 lang_html/analyze/lib.cma \
c7092a9 @aryx add skeleton for lang_css/parsing/
aryx authored
229 lang_css/parsing/lib.cma \
e241606 @aryx lang_web: empty -dump_web
aryx authored
230 lang_web/parsing/lib.cma \
81bbf50 @aryx adding lang_html/parsing/, and integrate ocamlnet in compilation chain
aryx authored
231
8634b74 initial import into fresh git repo.
pad authored
232
233 MAKESUBDIRS=commons \
234 $(BDBDIR) $(REGEXPDIR) $(MPIDIR) \
8bf36da @aryx pm_depend now use phylomel, test
aryx authored
235 $(GRAPHDIR) $(PHYLOMELDIR) \
2d8dff7 Makefile: compiling ocamlthrift
pad authored
236 $(THRIFTDIR) \
81bbf50 @aryx adding lang_html/parsing/, and integrate ocamlnet in compilation chain
aryx authored
237 $(OCAMLNETDIR) \
26cc32a Makefiles and configure: make cairo+gtk the default.
pad authored
238 $(GUIDIR) $(CAIRODIR) \
8634b74 initial import into fresh git repo.
pad authored
239 h_version-control \
240 h_visualization \
241 h_program-lang \
242 h_program-visual \
243 globals \
244 lang_ml/parsing \
245 lang_ml/analyze \
ca330f9 Makefiles: adding lang_nw/
pad authored
246 lang_nw/parsing \
247 lang_nw/analyze \
270df00 skeleton for lang_lisp/
pad authored
248 lang_lisp/parsing \
249 lang_lisp/analyze \
f42b930 first proto for haskell lexer and highlighter
pad authored
250 lang_haskell/parsing \
251 lang_haskell/analyze \
8634b74 initial import into fresh git repo.
pad authored
252 lang_php/parsing \
253 lang_php/matcher \
adcf589 @aryx * lang_php/pretty/Makefile: julien's pretty printer, coming from private
aryx authored
254 lang_php/pretty \
8634b74 initial import into fresh git repo.
pad authored
255 lang_sql/parsing \
256 lang_js/parsing \
257 lang_js/analyze \
258 lang_cpp/parsing \
259 lang_cpp/analyze \
9919d5b adding lang_java/ to help visualize java code
pad authored
260 lang_java/parsing \
261 lang_java/analyze \
244ff04 lang_python: first skeleton
pad authored
262 lang_python/parsing \
263 lang_python/analyze \
58edd37 lang_csharp: parser and basic highlighter
pad authored
264 lang_csharp/parsing \
265 lang_csharp/analyze \
fc28b66 @aryx introduce lang_opa/
aryx authored
266 lang_opa/parsing \
267 lang_opa/analyze \
30b92d9 @aryx erlang: basic lexer
aryx authored
268 lang_erlang/parsing \
ebdc9ad @aryx erlang: basic highlighter
aryx authored
269 lang_erlang/analyze \
8634b74 initial import into fresh git repo.
pad authored
270 lang_php/analyze \
271 lang_php/analyze/foundation \
272 lang_php/analyze/checker \
3d099fe removed some dependencies to ocamlbdb
pad authored
273 lang_php/analyze/database \
ea99ce2 moving a few files so that 'make dotall' can now work
pad authored
274 lang_php/analyze/tools \
275 lang_php/analyze/qa_test \
276 lang_php/analyze/dynamic_analysis \
3d099fe removed some dependencies to ocamlbdb
pad authored
277 lang_php/analyze/static_analysis \
81bbf50 @aryx adding lang_html/parsing/, and integrate ocamlnet in compilation chain
aryx authored
278 lang_html/parsing \
d62b500 @aryx adding an empty lang_html/analyze/
aryx authored
279 lang_html/analyze \
c7092a9 @aryx add skeleton for lang_css/parsing/
aryx authored
280 lang_css/parsing \
e241606 @aryx lang_web: empty -dump_web
aryx authored
281 lang_web/parsing \
49aefce org_mode: parsing support and skeleton for codemap
pad authored
282 lang_text \
8634b74 initial import into fresh git repo.
pad authored
283 $(VISUALDIR) \
2f1bfad misc
pad authored
284 $(FACEBOOKDIR)
8634b74 initial import into fresh git repo.
pad authored
285
286 INCLUDEDIRS=$(MAKESUBDIRS) \
ea99ce2 moving a few files so that 'make dotall' can now work
pad authored
287 commons/ocamlextra commons/ocollection \
288 commons/lib-json commons/lib-xml commons/lib-sexp \
8bf36da @aryx pm_depend now use phylomel, test
aryx authored
289 $(GTKINCLUDE) $(CAIROINCLUDE) $(PCREINCLUDE) $(OCAMLNETINCLUDE) \
290 $(PHYLOMELINCLUDE)
8634b74 initial import into fresh git repo.
pad authored
291
292 ##############################################################################
293 # Generic
294 ##############################################################################
295 -include $(TOP)/Makefile.common
296
297 ##############################################################################
298 # Top rules
299 ##############################################################################
300
301 .PHONY:: all all.opt opt top clean distclean
302
303 #note: old: was before all: rec $(EXEC) ... but can not do that cos make -j20
304 #could try to compile $(EXEC) before rec. So here force sequentiality.
305
306 all:: Makefile.config
307 $(MAKE) rec
308 $(MAKE) $(PROGS)
309 opt:
310 $(MAKE) rec.opt
311 $(MAKE) $(OPTPROGS)
312 all.opt: opt
313 top: $(TARGET).top
314
315 rec:
316 $(MAKE) -C commons
317 $(BTCMD)
318 $(BDBCMD)
319 $(REGEXPCMD)
320 $(MPICMD)
321 $(GRAPHCMD)
322 $(GUICMD)
323 $(MAKE) features -C commons
324 set -e; for i in $(MAKESUBDIRS); do $(MAKE) -C $$i all || exit 1; done
325
326 rec.opt:
327 $(MAKE) all.opt -C commons
328 $(BTCMDOPT)
329 $(BDBCMDOPT)
330 $(REGEXPCMDOPT)
331 $(MPICMDOPT)
332 $(GRAPHCMDOPT)
333 $(GUICMDOPT)
334 $(MAKE) features.opt -C commons
335 set -e; for i in $(MAKESUBDIRS); do $(MAKE) -C $$i all.opt || exit 1; done
336
337
338 $(TARGET): $(LIBS) $(OBJS)
339 $(OCAMLC) $(BYTECODE_STATIC) -o $@ $(SYSLIBS) $^
340
341 $(TARGET).opt: $(LIBS:.cma=.cmxa) $(OPTOBJS)
342 $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $^
343
344
345 $(TARGET).top: $(LIBS) $(OBJS)
346 $(OCAMLMKTOP) -o $@ $(SYSLIBS) threads.cma $^
347
348
349
350
351 clean::
352 rm -f $(TARGET)
353 clean::
354 rm -f $(TARGET).top
355 clean::
356 set -e; for i in $(MAKESUBDIRS); do $(MAKE) -C $$i clean; done
357
358 clean::
359 rm -f *.opt
360
361 depend::
362 set -e; for i in $(MAKESUBDIRS); do $(MAKE) -C $$i depend; done
363
364 Makefile.config:
365 @echo "Makefile.config is missing. Have you run ./configure?"
366 @exit 1
367
368
369 distclean:: clean
370 set -e; for i in $(MAKESUBDIRS); do $(MAKE) -C $$i $@; done
371 rm -f .depend
372 rm -f Makefile.config
373 rm -f globals/config.ml
374 rm -f TAGS
375 # find -name ".#*1.*" | xargs rm -f
376
377 # add -custom so dont need add e.g. ocamlbdb/ in LD_LIBRARY_PATH
378 CUSTOM=-custom
379
380 static:
381 rm -f $(EXEC).opt $(EXEC)
382 $(MAKE) STATIC="-ccopt -static" $(EXEC).opt
383 cp $(EXEC).opt $(EXEC)
384
385 purebytecode:
386 rm -f $(EXEC).opt $(EXEC)
387 $(MAKE) BYTECODE_STATIC="" $(EXEC)
388
389
390 #------------------------------------------------------------------------------
6dea9bd rename pfff_visual in CodeMap and worked on the toc of the codemap ma…
pad authored
391 # stags targets (was pfff_tags)
8634b74 initial import into fresh git repo.
pad authored
392 #------------------------------------------------------------------------------
393
e8fac8d renamed main_tags.ml
pad authored
394 stags: $(LIBS) main_stags.cmo
8634b74 initial import into fresh git repo.
pad authored
395 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $^
396
e8fac8d renamed main_tags.ml
pad authored
397 stags.opt: $(LIBS:.cma=.cmxa) main_stags.cmx
8634b74 initial import into fresh git repo.
pad authored
398 $(OCAMLOPT) $(STATIC) -o $@ $(BASICSYSLIBS:.cma=.cmxa) $^
399
400 clean::
e8fac8d renamed main_tags.ml
pad authored
401 rm -f stags
8634b74 initial import into fresh git repo.
pad authored
402
403 #------------------------------------------------------------------------------
7966cbd @aryx * lang_ml/analyze/graph_modules_packages_ml.ml: new file, also main_p…
aryx authored
404 # pm_depend targets
405 #------------------------------------------------------------------------------
406
b06171f @aryx * Makefile: fix for phylomel
aryx authored
407 #SYSLIBS_PM= external/phylomel/src/lib.cma
78f625e @aryx phylomel: started migration to pad style
aryx authored
408
8bf36da @aryx pm_depend now use phylomel, test
aryx authored
409 # external/ocamlgtk/src/lablgtk.cma \
410 # external/ocamlcairo/src/cairo.cma \
411 # external/ocamlcairo/src/cairo_lablgtk.cma \
78f625e @aryx phylomel: started migration to pad style
aryx authored
412
b06171f @aryx * Makefile: fix for phylomel
aryx authored
413 pm_depend: $(LIBS) main_pm_depend.cmo
8bf36da @aryx pm_depend now use phylomel, test
aryx authored
414 $(OCAMLC) $(CUSTOM) -o $@ $(BASICSYSLIBS) $^
415
b06171f @aryx * Makefile: fix for phylomel
aryx authored
416 pm_depend.opt: $(LIBS:.cma=.cmxa) main_pm_depend.cmx
7966cbd @aryx * lang_ml/analyze/graph_modules_packages_ml.ml: new file, also main_p…
aryx authored
417 $(OCAMLOPT) $(STATIC) -o $@ $(BASICSYSLIBS:.cma=.cmxa) $^
418
419 clean::
420 rm -f pm_depend
421
422 #------------------------------------------------------------------------------
8634b74 initial import into fresh git repo.
pad authored
423 # sgrep targets
424 #------------------------------------------------------------------------------
425
426 sgrep: $(LIBS) main_sgrep.cmo
6024490 @aryx sgrep: support for regexp when matching strings
aryx authored
427 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $(REGEXPCMA) $^
8634b74 initial import into fresh git repo.
pad authored
428
429 sgrep.opt: $(BASICLIBS:.cma=.cmxa) main_sgrep.cmx
6024490 @aryx sgrep: support for regexp when matching strings
aryx authored
430 $(OCAMLOPT) $(STATIC) -o $@ $(BASICSYSLIBS:.cma=.cmxa) \
431 $(REGEXPCMA:.cma=.cmxa) $^
8634b74 initial import into fresh git repo.
pad authored
432
433 clean::
434 rm -f sgrep
435
436 #------------------------------------------------------------------------------
437 # spatch targets
438 #------------------------------------------------------------------------------
439
440 spatch: $(LIBS) main_spatch.cmo
441 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $^
442
443 spatch.opt: $(LIBS:.cma=.cmxa) main_spatch.cmx
444 $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $^
445
446 clean::
447 rm -f spatch
448
449 #------------------------------------------------------------------------------
450 # scheck targets
451 #------------------------------------------------------------------------------
452
453 scheck: $(LIBS) main_scheck.cmo
454 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $^
455
456 scheck.opt: $(LIBS:.cma=.cmxa) main_scheck.cmx
457 $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $^
458
459 clean::
460 rm -f scheck
461
462 #------------------------------------------------------------------------------
9efc1da introduce scheck_heavy
pad authored
463 # scheck_heavy targets
464 #------------------------------------------------------------------------------
465
466 scheck_heavy: $(LIBS) main_scheck_heavy.cmo
467 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $^
468
469 scheck_heavy.opt: $(LIBS:.cma=.cmxa) $(LIBS2:.cma=.cmxa) $(OBJS2:.cmo=.cmx) main_scheck_heavy.cmx
470 $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $^
471
472 clean::
473 rm -f scheck_heavy
474
475 #------------------------------------------------------------------------------
f7748eb @aryx * main_codemap.ml: factorize filters
aryx authored
476 # OBSOLETE: ppp targets (obsolete now that have closures in hphp)
8634b74 initial import into fresh git repo.
pad authored
477 #------------------------------------------------------------------------------
478
479 ppp: $(LIBS) main_ppp.cmo
480 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $^
481
482 ppp.opt: $(LIBS:.cma=.cmxa) main_ppp.cmx
483 $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $^
484
485 clean::
486 rm -f ppp
487
488 #------------------------------------------------------------------------------
489 # pfff_db targets
490 #------------------------------------------------------------------------------
491
492 pfff_db: $(LIBS) main_db.cmo
493 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $^
494
495 pfff_db.opt: $(LIBS:.cma=.cmxa) $(LIBS2:.cma=.cmxa) $(OBJS2:.cmo=.cmx) main_db.cmx
496 $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $^
497
498 clean::
499 rm -f pfff_db
500
501 #------------------------------------------------------------------------------
a5fa1c6 update Makefile and readme for new pfff_db_heavy
pad authored
502 # pfff_db_heavy targets
8634b74 initial import into fresh git repo.
pad authored
503 #------------------------------------------------------------------------------
504
a5fa1c6 update Makefile and readme for new pfff_db_heavy
pad authored
505 pfff_db_heavy: $(LIBS) main_db_heavy.cmo
8634b74 initial import into fresh git repo.
pad authored
506 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $^
507
a5fa1c6 update Makefile and readme for new pfff_db_heavy
pad authored
508 pfff_db_heavy.opt: $(LIBS:.cma=.cmxa) $(LIBS2:.cma=.cmxa) $(OBJS2:.cmo=.cmx) main_db_heavy.cmx
8634b74 initial import into fresh git repo.
pad authored
509 $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $^
510
511 clean::
a5fa1c6 update Makefile and readme for new pfff_db_heavy
pad authored
512 rm -f pfff_db_heavy
8634b74 initial import into fresh git repo.
pad authored
513
514 #------------------------------------------------------------------------------
e07dec2 moving main_gui.ml, to be able to use 'make dot'
pad authored
515 # OBSOLETE: pfff_browser target
8634b74 initial import into fresh git repo.
pad authored
516 #------------------------------------------------------------------------------
517 SYSLIBS2=external/ocamlgtk/src/lablgtk.cma
518 LIBS2=commons/commons_gui.cma gui/gui.cma
519 OBJS2=
520
521 #need linker to find dlllabltk2.so so need adjust LD_LIBRARY_PATH if
522 # use ocamlgtk/src instead of the standard -I +lablgtk2
523 # cf env.sh
524
525 pfff_browser: $(LIBS) $(LIBS2) $(OBJS2) main_gui.cmo
526 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $(SYSLIBS2) $^
527
528 pfff_browser.opt: $(LIBS:.cma=.cmxa) $(LIBS2:.cma=.cmxa) $(OBJS2:.cmo=.cmx) main_gui.cmx
529 $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $(SYSLIBS2:.cma=.cmxa) $^
530
531 clean::
532 rm -f pfff_browser
533
534 #------------------------------------------------------------------------------
6dea9bd rename pfff_visual in CodeMap and worked on the toc of the codemap ma…
pad authored
535 # codemap target (was pfff_visual)
8634b74 initial import into fresh git repo.
pad authored
536 #------------------------------------------------------------------------------
537 SYSLIBS3= \
538 external/ocamlgtk/src/lablgtk.cma \
539 external/ocamlcairo/src/cairo.cma \
540 external/ocamlcairo/src/cairo_lablgtk.cma \
541
542 OBJS3=visual/lib.cma
543
544 GTKLOOP=gtkThread.cmo gtkInit.cmo
545
3c78ed5 renamed main_visual.ml
pad authored
546 codemap: $(LIBS) commons/commons_gui.cma $(OBJS3) main_codemap.cmo
8634b74 initial import into fresh git repo.
pad authored
547 $(OCAMLC) -thread $(CUSTOM) -o $@ $(SYSLIBS) threads.cma $(SYSLIBS3) $(GTKLOOP) $^
548
3c78ed5 renamed main_visual.ml
pad authored
549 codemap.opt: $(LIBS:.cma=.cmxa) commons/commons_gui.cmxa $(OBJS3:.cma=.cmxa) main_codemap.cmx
8634b74 initial import into fresh git repo.
pad authored
550 $(OCAMLOPT) -thread $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) threads.cmxa $(SYSLIBS3:.cma=.cmxa) $(GTKLOOP:.cmo=.cmx) $^
551
552 clean::
6dea9bd rename pfff_visual in CodeMap and worked on the toc of the codemap ma…
pad authored
553 rm -f codemap
8634b74 initial import into fresh git repo.
pad authored
554
555 #------------------------------------------------------------------------------
556 # pfff_misc targets
557 #------------------------------------------------------------------------------
558 pfff_misc: $(LIBS) main_misc.cmo
559 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $(SYSLIBS4) $^
560
561 pfff_misc.opt: $(LIBS:.cma=.cmxa) main_misc.cmx
562 $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $(SYSLIBS4:.cma=.cmxa) $^
563
564 clean::
565 rm -f pfff_misc
566
1b506a9 added main_test.ml to run the unit tests
pad authored
567 #------------------------------------------------------------------------------
568 # pfff_test targets
569 #------------------------------------------------------------------------------
570
571 pfff_test: $(LIBS) main_test.cmo
572 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $^
573
574 pfff_test.opt: $(LIBS:.cma=.cmxa) main_test.cmx
575 $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $^
576
577 clean::
578 rm -f pfff_test
579
580
8634b74 initial import into fresh git repo.
pad authored
581 ##############################################################################
582 # Build documentation
583 ##############################################################################
584 .PHONY:: docs
585
586 ##############################################################################
587 # Install
588 ##############################################################################
589
590 VERSION=$(shell cat globals/config.ml.in |grep version |perl -p -e 's/.*"(.*)".*/$$1/;')
591
592 # note: don't remove DESTDIR, it can be set by package build system like ebuild
593 install: all
3e4dc5e fixing make install, thx to ymotongpo for the bug report
pad authored
594 mkdir -p $(DESTDIR)$(BINDIR)
8634b74 initial import into fresh git repo.
pad authored
595 mkdir -p $(DESTDIR)$(SHAREDIR)
3e4dc5e fixing make install, thx to ymotongpo for the bug report
pad authored
596 cp -a $(PROGS) $(BINDIR)
597 cp -a data $(DESTDIR)$(SHAREDIR)
8634b74 initial import into fresh git repo.
pad authored
598 @echo ""
3e4dc5e fixing make install, thx to ymotongpo for the bug report
pad authored
599 @echo "You can also install pfff by copying the programs"
600 @echo "available in this directory anywhere you want and"
8634b74 initial import into fresh git repo.
pad authored
601 @echo "give it the right options to find its configuration files."
602
603 uninstall:
3e4dc5e fixing make install, thx to ymotongpo for the bug report
pad authored
604 rm -rf $(DESTDIR)$(SHAREDIR)/data
8634b74 initial import into fresh git repo.
pad authored
605
606 version:
607 @echo $(VERSION)
608
609 ##############################################################################
610 # Package rules
611 ##############################################################################
612
613 PACKAGE=$(TARGET)-$(VERSION)
614 TMP=/tmp
615
616 package:
617 make srctar
618
619 srctar:
620 make clean
621 cp -a . $(TMP)/$(PACKAGE)
622 cd $(TMP); tar cvfz $(PACKAGE).tgz --exclude=CVS --exclude=_darcs $(PACKAGE)
623 rm -rf $(TMP)/$(PACKAGE)
624
625 ##############################################################################
626 # Website rules
627 ##############################################################################
628
629 WEBSITE=/home/pad/mobile/homepage/software/project-pfff
630
631 gen-html:
632 emacs -l ~/.emacs --eval "(progn (htmlize-many-files '(\"changes.txt\")) (kill-emacs))"
633
634 website:
635 cp $(TMP)/$(PACKAGE).tgz $(WEBSITE)
636
637 # make gen-html
638 # cp changes.txt.html $(WEBSITE)/changes-$(VERSION).html
639
640 ##############################################################################
641 # Developer rules
642 ##############################################################################
643
eefc1ee @aryx * Makefile: make test
aryx authored
644 .PHONY:: tags db layers visual tests test
8634b74 initial import into fresh git repo.
pad authored
645
1b506a9 added main_test.ml to run the unit tests
pad authored
646
8634b74 initial import into fresh git repo.
pad authored
647 tags:
4bdc054 misc
pad authored
648 ./stags -verbose -lang ml .
8634b74 initial import into fresh git repo.
pad authored
649 db:
16ee6f1 @aryx codemap: git grep now works again. When clicking Top the dw_stack
aryx authored
650 ./pfff_db -verbose -lang ml -o DB_LIGHT.marshall .
7b1fc10 @aryx misc
aryx authored
651 layers:
652 ./pfff_db_heavy -gen_age_layer /home/pad/local/pfff-for-layers \
653 layer_age.marshall
a358bcc @aryx layer_vcs: add fine grained information about the age of the lines
aryx authored
654 ./pfff_db_heavy -gen_age_layer /home/pad/local/pfff-for-layers \
655 layer_age.json
7b1fc10 @aryx misc
aryx authored
656
8634b74 initial import into fresh git repo.
pad authored
657 visual:
a2b9fcd @aryx * Makefile: make visual with no legend
aryx authored
658 ./codemap -no_legend -profile -ss 2 \
889db0f @aryx * main_codemap.ml: filter pfff now show PHP and Prolog
aryx authored
659 -with_info DB_LIGHT.marshall -with_layers . -filter pfff .
674ac61 @aryx misc
aryx authored
660 visual2:
661 ./codemap -no_legend -profile -ss 2 \
662 -with_info DB_LIGHT.marshall -with_layers . .
8e9f0f6 @aryx misc
aryx authored
663
eefc1ee @aryx * Makefile: make test
aryx authored
664 tests:
db81496 @aryx no more log spew in 'make test' !!
aryx authored
665 ./pfff_test -verbose all
674ac61 @aryx misc
aryx authored
666 test:
667 make tests
f7748eb @aryx * main_codemap.ml: factorize filters
aryx authored
668
8a3b7bf misc
pad authored
669 push:
670 git push origin master
452072b misc
pad authored
671 pull:
672 git pull
673 cd facebook; git pull
8a3b7bf misc
pad authored
674
1b506a9 added main_test.ml to run the unit tests
pad authored
675 #refactoring:
676 # git grep -l Source_high | xargs perl -p -i -e 's/Source_highlight/Highlight_code/g'
ea99ce2 moving a few files so that 'make dotall' can now work
pad authored
677
1b506a9 added main_test.ml to run the unit tests
pad authored
678 DSRC=$(SRC)
ea99ce2 moving a few files so that 'make dotall' can now work
pad authored
679 DIRS= $(filter-out commons external/ocamlgtk/src external/ocamlpcre external/ocamlcairo external/ocamlgraph facebook, $(MAKESUBDIRS))
680 #DIRS=lang_php/parsing
681 DSRC+=$(DIRS:=/*.ml)
682 DSRC+=$(wildcard main_*.ml)
683
66391b3 @aryx archi: add more colors for 'make archi' (but got some errors)
aryx authored
684 #PP1=-pp camlp4o
685 DOTCOLORS=green,darkgoldenrod2,cyan,red,magenta,yellow,burlywood1,aquamarine,purple,lightpink,salmon,mediumturquoise,black,slategray3
686
1b506a9 added main_test.ml to run the unit tests
pad authored
687 archi:
66391b3 @aryx archi: add more colors for 'make archi' (but got some errors)
aryx authored
688 ocamldoc $(PP1) -I +threads $(INCLUDES) $(DSRC) \
689 -dot -dot-reduce -dot-colors $(DOTCOLORS)
e07dec2 moving main_gui.ml, to be able to use 'make dot'
pad authored
690 dot -Tps ocamldoc.out > dot.ps
691 mv dot.ps Fig_graph_ml.ps
692 ps2pdf Fig_graph_ml.ps
693 rm -f Fig_graph_ml.ps
694
1b506a9 added main_test.ml to run the unit tests
pad authored
695 visualhead:
696 ./codemap -ss 1 -ft 0.5 -commitid HEAD
697
698
8634b74 initial import into fresh git repo.
pad authored
699 ##############################################################################
700 # Pad specific rules
701 ##############################################################################
702
703 DARCSFORESTS=commons commons/lib-sexp \
704 ocamltarzan ocamltarzan/lib-sexp \
705 h_version-control h_program-lang \
706 lang_php/parsing \
707 lang_php/analyze \
708 gui \
709 facebook
710
711 update_darcs:
712 darcs pull
713 set -e; for i in $(DARCSFORESTS); do cd $$i; darcs pull; cd ..; done
714
715 diff_darcs:
716 @echo "----- REPO:" top "----------------------"
717 darcs diff -u
718 set -e; for i in $(DARCSFORESTS); do cd $$i; echo "----- REPO:" $$i "-----------------"; darcs diff -u; cd $(TOP); done
Something went wrong with that request. Please try again.