Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 734 lines (573 sloc) 20.722 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_pm_d...
aryx authored
25 PROGS+=pm_depend
26
8634b74 initial import into fresh git repo.
pad authored
27 PROGS+=ppp
28
a5fa1c6 update Makefile and readme for new pfff_db_heavy
pad authored
29 # note that without bdb, pfff_db will be incomplete regarding PHP
30 PROGS+=pfff_db
8634b74 initial import into fresh git repo.
pad authored
31 PROGS+=scheck
32
1b506a9 added main_test.ml to run the unit tests
pad authored
33 PROGS+=pfff_test
34
685c004 putting back support for persistent berkeley DB
pad authored
35 ifeq ($(FEATURE_BDB), 1)
a5fa1c6 update Makefile and readme for new pfff_db_heavy
pad authored
36 PROGS+=pfff_db_heavy
9efc1da introduce scheck_heavy
pad authored
37 PROGS+=scheck_heavy
685c004 putting back support for persistent berkeley DB
pad authored
38 endif
39
8634b74 initial import into fresh git repo.
pad authored
40 ifeq ($(FEATURE_VISUAL), 1)
6dea9bd rename pfff_visual in CodeMap and worked on the toc of the codemap manua...
pad authored
41 PROGS+=codemap
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)
144 VISUALDIR=visual
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 \
30b92d9 @aryx erlang: basic lexer
aryx authored
169 lang_erlang/parsing/lib.cma \
81bbf50 @aryx adding lang_html/parsing/, and integrate ocamlnet in compilation chain
aryx authored
170 lang_html/parsing/lib.cma \
c7092a9 @aryx add skeleton for lang_css/parsing/
aryx authored
171 lang_js/parsing/lib.cma \
172 lang_css/parsing/lib.cma \
e241606 @aryx lang_web: empty -dump_web
aryx authored
173 lang_web/parsing/lib.cma \
49aefce org_mode: parsing support and skeleton for codemap
pad authored
174 lang_text/lib.cma \
8634b74 initial import into fresh git repo.
pad authored
175
176 BASICSYSLIBS=nums.cma bigarray.cma str.cma unix.cma
177
178 LIBS= commons/commons.cma \
179 $(BTCMA) \
180 $(BDBCMA) \
181 $(REGEXPCMA) \
182 $(MPICMA) \
81bbf50 @aryx adding lang_html/parsing/, and integrate ocamlnet in compilation chain
aryx authored
183 $(OCAMLNETCMA) \
8634b74 initial import into fresh git repo.
pad authored
184 $(GRAPHCMA) \
185 commons/commons_features.cma \
186 h_version-control/lib.cma \
187 h_visualization/lib.cma \
188 h_program-lang/lib.cma \
189 h_program-visual/lib.cma \
190 globals/globals.cma \
191 lang_ml/parsing/lib.cma \
192 lang_ml/analyze/lib.cma \
ca330f9 Makefiles: adding lang_nw/
pad authored
193 lang_nw/parsing/lib.cma \
194 lang_nw/analyze/lib.cma \
270df00 skeleton for lang_lisp/
pad authored
195 lang_lisp/parsing/lib.cma \
196 lang_lisp/analyze/lib.cma \
f42b930 first proto for haskell lexer and highlighter
pad authored
197 lang_haskell/parsing/lib.cma \
198 lang_haskell/analyze/lib.cma \
8634b74 initial import into fresh git repo.
pad authored
199 lang_php/parsing/lib.cma \
200 lang_php/analyze/basic/lib.cma \
201 lang_php/analyze/foundation/lib.cma \
202 lang_php/analyze/typing/lib.cma \
203 lang_php/analyze/tools/lib.cma \
204 lang_php/analyze/checker/lib.cma \
205 lang_php/mini/lib.cma \
206 lang_php/matcher/lib.cma \
3d099fe removed some dependencies to ocamlbdb
pad authored
207 lang_php/analyze/database/lib.cma \
208 lang_php/analyze/finder/lib.cma \
209 lang_php/analyze/static_analysis/lib.cma \
4eba308 make top works again. Also add file_type for readme and .emacs
pad authored
210 lang_php/analyze/dynamic_analysis/lib.cma \
3d099fe removed some dependencies to ocamlbdb
pad authored
211 lang_php/analyze/qa_test/lib.cma \
685c004 putting back support for persistent berkeley DB
pad authored
212 lang_php/analyze/lib.cma \
8634b74 initial import into fresh git repo.
pad authored
213 lang_sql/parsing/lib.cma \
214 lang_js/parsing/lib.cma \
215 lang_js/analyze/lib.cma \
216 lang_cpp/parsing/lib.cma \
217 lang_cpp/analyze/lib.cma \
9919d5b adding lang_java/ to help visualize java code
pad authored
218 lang_java/parsing/lib.cma \
219 lang_java/analyze/lib.cma \
244ff04 lang_python: first skeleton
pad authored
220 lang_python/parsing/lib.cma \
221 lang_python/analyze/lib.cma \
58edd37 lang_csharp: parser and basic highlighter
pad authored
222 lang_csharp/parsing/lib.cma \
223 lang_csharp/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/mini \
254 lang_php/matcher \
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 \
30b92d9 @aryx erlang: basic lexer
aryx authored
266 lang_erlang/parsing \
ebdc9ad @aryx erlang: basic highlighter
aryx authored
267 lang_erlang/analyze \
8634b74 initial import into fresh git repo.
pad authored
268 lang_php/analyze \
269 lang_php/analyze/basic \
270 lang_php/analyze/foundation \
5f353d3 Skeleton for type inference of PHP via the PIL
pad authored
271 lang_php/analyze/typing \
8634b74 initial import into fresh git repo.
pad authored
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 \
8634b74 initial import into fresh git repo.
pad authored
283 $(VISUALDIR) \
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 manua...
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 #------------------------------------------------------------------------------
7966cbd @aryx * lang_ml/analyze/graph_modules_packages_ml.ml: new file, also main_pm_d...
aryx authored
404 # pm_depend targets
405 #------------------------------------------------------------------------------
406
8bf36da @aryx pm_depend now use phylomel, test
aryx authored
407 SYSLIBS_PM= external/phylomel/src/lib.cma
78f625e @aryx phylomel: started migration to pad style
aryx authored
408
8bf36da @aryx pm_depend now use phylomel, test
aryx authored
409 # external/ocamlgtk/src/lablgtk.cma \
410 # external/ocamlcairo/src/cairo.cma \
411 # external/ocamlcairo/src/cairo_lablgtk.cma \
78f625e @aryx phylomel: started migration to pad style
aryx authored
412
7966cbd @aryx * lang_ml/analyze/graph_modules_packages_ml.ml: new file, also main_pm_d...
aryx authored
413
8bf36da @aryx pm_depend now use phylomel, test
aryx authored
414 pm_depend: $(LIBS) $(SYSLIBS_PM) main_pm_depend.cmo
415 $(OCAMLC) $(CUSTOM) -o $@ $(BASICSYSLIBS) $^
416
417 pm_depend.opt: $(SYSLIBS_PM:.cma=.cmxa) $(LIBS:.cma=.cmxa) main_pm_depend.cmx
7966cbd @aryx * lang_ml/analyze/graph_modules_packages_ml.ml: new file, also main_pm_d...
aryx authored
418 $(OCAMLOPT) $(STATIC) -o $@ $(BASICSYSLIBS:.cma=.cmxa) $^
419
420 clean::
421 rm -f pm_depend
422
423 #------------------------------------------------------------------------------
8634b74 initial import into fresh git repo.
pad authored
424 # sgrep targets
425 #------------------------------------------------------------------------------
426
427 sgrep: $(LIBS) main_sgrep.cmo
6024490 @aryx sgrep: support for regexp when matching strings
aryx authored
428 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $(REGEXPCMA) $^
8634b74 initial import into fresh git repo.
pad authored
429
430 sgrep.opt: $(BASICLIBS:.cma=.cmxa) main_sgrep.cmx
6024490 @aryx sgrep: support for regexp when matching strings
aryx authored
431 $(OCAMLOPT) $(STATIC) -o $@ $(BASICSYSLIBS:.cma=.cmxa) \
432 $(REGEXPCMA:.cma=.cmxa) $^
8634b74 initial import into fresh git repo.
pad authored
433
434 clean::
435 rm -f sgrep
436
437 #------------------------------------------------------------------------------
438 # spatch targets
439 #------------------------------------------------------------------------------
440
441 spatch: $(LIBS) main_spatch.cmo
442 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $^
443
444 spatch.opt: $(LIBS:.cma=.cmxa) main_spatch.cmx
445 $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $^
446
447 clean::
448 rm -f spatch
449
450 #------------------------------------------------------------------------------
451 # scheck targets
452 #------------------------------------------------------------------------------
453
454 scheck: $(LIBS) main_scheck.cmo
455 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $^
456
457 scheck.opt: $(LIBS:.cma=.cmxa) main_scheck.cmx
458 $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $^
459
460 clean::
461 rm -f scheck
462
463 #------------------------------------------------------------------------------
9efc1da introduce scheck_heavy
pad authored
464 # scheck_heavy targets
465 #------------------------------------------------------------------------------
466
467 scheck_heavy: $(LIBS) main_scheck_heavy.cmo
468 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $^
469
470 scheck_heavy.opt: $(LIBS:.cma=.cmxa) $(LIBS2:.cma=.cmxa) $(OBJS2:.cmo=.cmx) main_scheck_heavy.cmx
471 $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $^
472
473 clean::
474 rm -f scheck_heavy
475
476 #------------------------------------------------------------------------------
8634b74 initial import into fresh git repo.
pad authored
477 # ppp targets
478 #------------------------------------------------------------------------------
479
480 ppp: $(LIBS) main_ppp.cmo
481 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $^
482
483 ppp.opt: $(LIBS:.cma=.cmxa) main_ppp.cmx
484 $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $^
485
486 clean::
487 rm -f ppp
488
489 #------------------------------------------------------------------------------
490 # pfff_db targets
491 #------------------------------------------------------------------------------
492
493 pfff_db: $(LIBS) main_db.cmo
494 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $^
495
496 pfff_db.opt: $(LIBS:.cma=.cmxa) $(LIBS2:.cma=.cmxa) $(OBJS2:.cmo=.cmx) main_db.cmx
497 $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $^
498
499 clean::
500 rm -f pfff_db
501
502 #------------------------------------------------------------------------------
a5fa1c6 update Makefile and readme for new pfff_db_heavy
pad authored
503 # pfff_db_heavy targets
8634b74 initial import into fresh git repo.
pad authored
504 #------------------------------------------------------------------------------
505
a5fa1c6 update Makefile and readme for new pfff_db_heavy
pad authored
506 pfff_db_heavy: $(LIBS) main_db_heavy.cmo
8634b74 initial import into fresh git repo.
pad authored
507 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $^
508
a5fa1c6 update Makefile and readme for new pfff_db_heavy
pad authored
509 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
510 $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $^
511
512 clean::
a5fa1c6 update Makefile and readme for new pfff_db_heavy
pad authored
513 rm -f pfff_db_heavy
8634b74 initial import into fresh git repo.
pad authored
514
515 #------------------------------------------------------------------------------
e07dec2 moving main_gui.ml, to be able to use 'make dot'
pad authored
516 # OBSOLETE: pfff_browser target
8634b74 initial import into fresh git repo.
pad authored
517 #------------------------------------------------------------------------------
518 SYSLIBS2=external/ocamlgtk/src/lablgtk.cma
519 LIBS2=commons/commons_gui.cma gui/gui.cma
520 OBJS2=
521
522 #need linker to find dlllabltk2.so so need adjust LD_LIBRARY_PATH if
523 # use ocamlgtk/src instead of the standard -I +lablgtk2
524 # cf env.sh
525
526 pfff_browser: $(LIBS) $(LIBS2) $(OBJS2) main_gui.cmo
527 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $(SYSLIBS2) $^
528
529 pfff_browser.opt: $(LIBS:.cma=.cmxa) $(LIBS2:.cma=.cmxa) $(OBJS2:.cmo=.cmx) main_gui.cmx
530 $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $(SYSLIBS2:.cma=.cmxa) $^
531
532 clean::
533 rm -f pfff_browser
534
535 #------------------------------------------------------------------------------
6dea9bd rename pfff_visual in CodeMap and worked on the toc of the codemap manua...
pad authored
536 # codemap target (was pfff_visual)
8634b74 initial import into fresh git repo.
pad authored
537 #------------------------------------------------------------------------------
538 SYSLIBS3= \
539 external/ocamlgtk/src/lablgtk.cma \
540 external/ocamlcairo/src/cairo.cma \
541 external/ocamlcairo/src/cairo_lablgtk.cma \
542
543 OBJS3=visual/lib.cma
544
545 GTKLOOP=gtkThread.cmo gtkInit.cmo
546
3c78ed5 renamed main_visual.ml
pad authored
547 codemap: $(LIBS) commons/commons_gui.cma $(OBJS3) main_codemap.cmo
8634b74 initial import into fresh git repo.
pad authored
548 $(OCAMLC) -thread $(CUSTOM) -o $@ $(SYSLIBS) threads.cma $(SYSLIBS3) $(GTKLOOP) $^
549
3c78ed5 renamed main_visual.ml
pad authored
550 codemap.opt: $(LIBS:.cma=.cmxa) commons/commons_gui.cmxa $(OBJS3:.cma=.cmxa) main_codemap.cmx
8634b74 initial import into fresh git repo.
pad authored
551 $(OCAMLOPT) -thread $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) threads.cmxa $(SYSLIBS3:.cma=.cmxa) $(GTKLOOP:.cmo=.cmx) $^
552
553 clean::
6dea9bd rename pfff_visual in CodeMap and worked on the toc of the codemap manua...
pad authored
554 rm -f codemap
8634b74 initial import into fresh git repo.
pad authored
555
556
557 #------------------------------------------------------------------------------
558 # pfff_misc targets
559 #------------------------------------------------------------------------------
560 pfff_misc: $(LIBS) main_misc.cmo
561 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $(SYSLIBS4) $^
562
563 pfff_misc.opt: $(LIBS:.cma=.cmxa) main_misc.cmx
564 $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $(SYSLIBS4:.cma=.cmxa) $^
565
566 clean::
567 rm -f pfff_misc
568
569
1b506a9 added main_test.ml to run the unit tests
pad authored
570 #------------------------------------------------------------------------------
571 # pfff_test targets
572 #------------------------------------------------------------------------------
573
574 pfff_test: $(LIBS) main_test.cmo
575 $(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $^
576
577 pfff_test.opt: $(LIBS:.cma=.cmxa) main_test.cmx
578 $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $^
579
580 clean::
581 rm -f pfff_test
582
583
8634b74 initial import into fresh git repo.
pad authored
584 ##############################################################################
585 # Build documentation
586 ##############################################################################
587 .PHONY:: docs
588
589 ##############################################################################
590 # Install
591 ##############################################################################
592
593 VERSION=$(shell cat globals/config.ml.in |grep version |perl -p -e 's/.*"(.*)".*/$$1/;')
594
595 # note: don't remove DESTDIR, it can be set by package build system like ebuild
596 install: all
3e4dc5e fixing make install, thx to ymotongpo for the bug report
pad authored
597 mkdir -p $(DESTDIR)$(BINDIR)
8634b74 initial import into fresh git repo.
pad authored
598 mkdir -p $(DESTDIR)$(SHAREDIR)
3e4dc5e fixing make install, thx to ymotongpo for the bug report
pad authored
599 cp -a $(PROGS) $(BINDIR)
600 cp -a data $(DESTDIR)$(SHAREDIR)
8634b74 initial import into fresh git repo.
pad authored
601 @echo ""
3e4dc5e fixing make install, thx to ymotongpo for the bug report
pad authored
602 @echo "You can also install pfff by copying the programs"
603 @echo "available in this directory anywhere you want and"
8634b74 initial import into fresh git repo.
pad authored
604 @echo "give it the right options to find its configuration files."
605
606 uninstall:
3e4dc5e fixing make install, thx to ymotongpo for the bug report
pad authored
607 rm -rf $(DESTDIR)$(SHAREDIR)/data
8634b74 initial import into fresh git repo.
pad authored
608
609 version:
610 @echo $(VERSION)
611
612
aeaa31c misc
pad authored
613
614 update:
615 make opt
616 cp codemap.opt ~/bin
41e910f misc
pad authored
617 cp scheck.opt ~/bin
aeaa31c misc
pad authored
618
8634b74 initial import into fresh git repo.
pad authored
619 ##############################################################################
620 # Package rules
621 ##############################################################################
622
623 PACKAGE=$(TARGET)-$(VERSION)
624 TMP=/tmp
625
626
627 package:
628 make srctar
629
630 srctar:
631 make clean
632 cp -a . $(TMP)/$(PACKAGE)
633 cd $(TMP); tar cvfz $(PACKAGE).tgz --exclude=CVS --exclude=_darcs $(PACKAGE)
634 rm -rf $(TMP)/$(PACKAGE)
635
636 ##############################################################################
637 # Website rules
638 ##############################################################################
639
640 WEBSITE=/home/pad/mobile/homepage/software/project-pfff
641
642 gen-html:
643 emacs -l ~/.emacs --eval "(progn (htmlize-many-files '(\"changes.txt\")) (kill-emacs))"
644
645 website:
646 cp $(TMP)/$(PACKAGE).tgz $(WEBSITE)
647
648 # make gen-html
649 # cp changes.txt.html $(WEBSITE)/changes-$(VERSION).html
650
651 ##############################################################################
652 # Developer rules
653 ##############################################################################
654
a358bcc @aryx layer_vcs: add fine grained information about the age of the lines
aryx authored
655 .PHONY:: tags db layers visual
8634b74 initial import into fresh git repo.
pad authored
656
1b506a9 added main_test.ml to run the unit tests
pad authored
657
8634b74 initial import into fresh git repo.
pad authored
658 tags:
4bdc054 misc
pad authored
659 ./stags -verbose -lang ml .
8634b74 initial import into fresh git repo.
pad authored
660 db:
16ee6f1 @aryx codemap: git grep now works again. When clicking Top the dw_stack
aryx authored
661 ./pfff_db -verbose -lang ml -o DB_LIGHT.marshall .
7b1fc10 @aryx misc
aryx authored
662 layers:
663 ./pfff_db_heavy -gen_age_layer /home/pad/local/pfff-for-layers \
664 layer_age.marshall
a358bcc @aryx layer_vcs: add fine grained information about the age of the lines
aryx authored
665 ./pfff_db_heavy -gen_age_layer /home/pad/local/pfff-for-layers \
666 layer_age.json
7b1fc10 @aryx misc
aryx authored
667
8634b74 initial import into fresh git repo.
pad authored
668 visual:
4c62df2 main_spatch/sgrep: move out code in facebook/
pad authored
669 ./codemap -profile -ss 2 \
623bba6 @aryx deadcode: let pbs = ref [] ...
aryx authored
670 -with_info DB_LIGHT.marshall -with_layers . -ocaml_filter .
8e9f0f6 @aryx misc
aryx authored
671
1b506a9 added main_test.ml to run the unit tests
pad authored
672 test:
673 ./pfff_test all
8a3b7bf misc
pad authored
674 push:
675 git push origin master
452072b misc
pad authored
676 pull:
677 git pull
678 cd facebook; git pull
8a3b7bf misc
pad authored
679
1b506a9 added main_test.ml to run the unit tests
pad authored
680 #refactoring:
681 # 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
682
1b506a9 added main_test.ml to run the unit tests
pad authored
683 DSRC=$(SRC)
ea99ce2 moving a few files so that 'make dotall' can now work
pad authored
684 DIRS= $(filter-out commons external/ocamlgtk/src external/ocamlpcre external/ocamlcairo external/ocamlgraph facebook, $(MAKESUBDIRS))
685 #DIRS=lang_php/parsing
686 DSRC+=$(DIRS:=/*.ml)
687 DSRC+=$(wildcard main_*.ml)
688
66391b3 @aryx archi: add more colors for 'make archi' (but got some errors)
aryx authored
689 #PP1=-pp camlp4o
690 DOTCOLORS=green,darkgoldenrod2,cyan,red,magenta,yellow,burlywood1,aquamarine,purple,lightpink,salmon,mediumturquoise,black,slategray3
691
1b506a9 added main_test.ml to run the unit tests
pad authored
692 archi:
66391b3 @aryx archi: add more colors for 'make archi' (but got some errors)
aryx authored
693 ocamldoc $(PP1) -I +threads $(INCLUDES) $(DSRC) \
694 -dot -dot-reduce -dot-colors $(DOTCOLORS)
e07dec2 moving main_gui.ml, to be able to use 'make dot'
pad authored
695 dot -Tps ocamldoc.out > dot.ps
696 mv dot.ps Fig_graph_ml.ps
697 ps2pdf Fig_graph_ml.ps
698 rm -f Fig_graph_ml.ps
699
700
44e870f @aryx misc
aryx authored
701 visual_bis:
702 ./codemap -profile -ss 2 \
703 -with_info DB_LIGHT.marshall -with_layers . -pfff_filter .
1b506a9 added main_test.ml to run the unit tests
pad authored
704 visualopt:
705 ./codemap.opt -profile -ss 2 \
706 -with_info DB_LIGHT .
707 visual_test: codemap
708 ./codemap -verbose -profile -ss 1 -ft 1. \
709 -with_info DB_LIGHT -filter 'pad:ml' commons/
710 visualhead:
711 ./codemap -ss 1 -ft 0.5 -commitid HEAD
712
713
8634b74 initial import into fresh git repo.
pad authored
714 ##############################################################################
715 # Pad specific rules
716 ##############################################################################
717
718 DARCSFORESTS=commons commons/lib-sexp \
719 ocamltarzan ocamltarzan/lib-sexp \
720 h_version-control h_program-lang \
721 lang_php/parsing \
722 lang_php/analyze \
723 gui \
724 facebook
725
726 update_darcs:
727 darcs pull
728 set -e; for i in $(DARCSFORESTS); do cd $$i; darcs pull; cd ..; done
729
730 diff_darcs:
731 @echo "----- REPO:" top "----------------------"
732 darcs diff -u
733 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.