Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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