Skip to content

HTTPS clone URL

Subversion checkout URL

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