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