Skip to content

HTTPS clone URL

Subversion checkout URL

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