Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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