Skip to content

HTTPS clone URL

Subversion checkout URL

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