Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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