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