Skip to content

HTTPS clone URL

Subversion checkout URL

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