3b223a7973807310f463ca4bc599c93cf610065a
[charm.git] / src / scripts / Makefile
1 #############################################################################"
2 #
3 # This one Makefile serves all of converse and charm.  It includes
4 # rules for building:
5 #
6 #     * The CONVERSE libraries
7 #     * Charm++ runtime
8 #     * ITC++ Translator
9 #     * Languages
10 #     * Documentation
11 #
12 # This Makefile is common to all machines.  This works because the charmc
13 # is smart enough to "conceal" the differences between machines.  charmc
14 # gets its smarts by reading the conv-mach.sh configuration file.
15 #
16 # If you wish to compile with debugging, optimization, or some other charm
17 # option, you can do so by setting OPTS.  For example, if you need a lot
18 # of debugging information, you could type:
19 #
20 #     make charm++ OPTS="-g -save -verbose"
21 #
22 ###############################################################################
23
24 SHELL=/bin/sh
25 L=../lib
26 INC=../include
27
28 all: charm++ bigsim LIBS AMPI f90charm TSM SM PVM doc
29
30 all-test: bigsim AMPI
31         cd ../tests ; $(MAKE) all OPTS='$(OPTS)'
32         cd ../examples ; $(MAKE) all OPTS='$(OPTS)'
33
34 charm++: basics
35         $(MAKE) charm-target
36         @echo "$(OPTS)" > OPTS
37
38 bgampi: bigsim AMPI
39
40 TSM: converse $(L)/libtsm.a
41
42 SM: converse $(L)/libsm.a
43
44 PVM: converse $(L)/libpvmc.a
45
46 AMR: charm++ LIBS
47         cd libs/ck-libs/amr; make all OPTS='$(OPTS)'
48
49 FEM: charm++
50         $(MAKE) CONVLIBS
51         $(MAKE) FEMC LIBS FEMF
52
53 FEMC: charm++ LIBS
54
55 FEMF: FEMC
56
57 ParFUM: FEM
58
59 MBLOCK: AMPI MBLOCKC MBLOCKF
60
61 MBLOCKC: charm++ LIBS
62
63 MBLOCKF: MBLOCKC
64
65 AMPI:  charm++
66         $(MAKE) CONVLIBS
67         $(MAKE) AMPIC AMPIF
68
69 ARMCI: charm++ LIBS
70
71 AMPIC: charm++ LIBS
72
73 AMPIF: AMPIC
74
75 f90charm: charm++ $(L)/libf90charm.a
76
77 default_libs: multicast
78
79 multicast:
80         cd libs/ck-libs/multicast && $(MAKE)
81
82 translators: charmxi conv-cpm
83
84 pose:  charm++
85         cd libs/ck-libs/pose && $(MAKE)
86
87 msa: charm++
88         cd libs/ck-libs/multiphaseSharedArrays && $(MAKE)
89
90 jade: charm++ msa
91 #       make the lib, include
92         cd langs/jade && $(MAKE)
93
94 fftlib: charm++
95         cd libs/ck-libs/fftlib && $(MAKE)
96
97 # This should be done offline, since the user does not need to compile
98 # parser files, etc.  All they need is the libjade + include files,
99 # antlr.jar, jade.jar, and a few scripts which the jade target takes
100 # care of.
101 jadeall: jade
102 #       make parser.g -> .java files
103         cd langs/jade && $(MAKE) p
104 #       make the jade.jar file
105         cd ../java/charm/jade && $(MAKE)
106
107 LIBS: CONVLIBS CHARMLIBS
108         cd libs; $(MAKE) otherlibs
109
110 bgtest: bigsim AMPI
111         cd ../tests ; $(MAKE) bgtest OPTS='$(OPTS)'
112         cd ../examples ; $(MAKE) bgtest OPTS='$(OPTS)'
113
114 test: bigsim AMPI
115         cd ../tests ; $(MAKE) test OPTS='$(OPTS)'
116         cd ../examples ; $(MAKE) test OPTS='$(OPTS)'
117
118 test-converse: converse
119         cd ../tests ; $(MAKE) test-converse  OPTS='$(OPTS)'
120
121 test-charm: charm++ METIS
122         cd ../tests ; $(MAKE) test-charm  OPTS='$(OPTS)'
123
124 test-AMPI: AMPI
125         cd ../tests ; $(MAKE) test-AMPI  OPTS='$(OPTS)'
126
127 test-fem: FEM
128         cd ../tests ; $(MAKE) test-fem  OPTS='$(OPTS)'
129
130 ps-doc: basics
131         cd ../doc ; make ps
132
133 pdf-doc: basics
134         cd ../doc ; make pdf
135
136 html-doc: basics
137         cd ../doc ; make html
138
139 doc: basics
140         cd ../doc ; make doc
141
142 CHARMC=../bin/charmc $(CHARMOPTS) $(OPTS)
143
144 SEQCHARMC=../bin/charmc -seq $(CHARMOPTS)
145
146 NATIVECHARMC=../bin/charmc -host $(CHARMOPTS)
147
148 CHARMXI=../bin/charmc -intrinsic $(OPTS)
149
150 DEPENDFILE = Make.depends
151
152 include $(DEPENDFILE)
153
154 ###############################################################################
155 #
156 # The basics (bin, lib, include, headers, charmc, conv-mach.sh)
157 #
158 ###############################################################################
159
160 CVHEADERS=cpthreads.h converse.h conv-trace.h conv-random.h conv-qd.h \
161       queueing.h conv-cpath.h conv-cpm.h persistent.h\
162       trace.h trace-bluegene.h trace-projections.h charm-api.h \
163       conv-ccs.h ccs-client.c ccs-client.h \
164       ccs-server.h ccs-auth.c ccs-auth.h \
165       memory-isomalloc.h debug-conv.h debug-charm.h conv-autoconfig.h \
166       conv-common.h conv-config.sh conv-config.h conv-mach.h conv-mach.sh \
167       blue.h blue-conv.h bgconverse.h \
168         convcomlibstrategy.h 3dgridrouter.h de.h hypercubetopology.h    \
169         routerstrategy.h convcomlib.h dummyconversestrategy.h  treerouter.h \
170         convcomlibmanager.h graphrouter.h petable.h gridrouter.h router.h \
171         prefixrouter.h pipebroadcastconverse.h pipelinestrategy.h cmipool.h \
172         comlib.h
173
174 # The .c files are there to be #included by clients whole
175 # This is a bit unusual, but makes client linking simpler.
176 UTILHEADERS=pup.h pupf.h pup_c.h pup_stl.h pup_mpi.h pup_toNetwork.h pup_toNetwork4.h pup_paged.h pup_cmialloc.h\
177         ckimage.h ckdll.h ckhashtable.h ckbitvector.h cklists.h ckliststring.h \
178         ckstatistics.h ckvector3d.h conv-lists.h RTH.h ckcomplex.h \
179         sockRoutines.h sockRoutines.c ckpool.h BGLTorus.h \
180         TopoManager.h CrayTorus.h BGPTorus.h cmimemcpy.h
181
182 CKHEADERS=ck.h ckstream.h envelope.h init.h qd.h charm.h charm++.h \
183           ckfutures.h ckIgetControl.h \
184           ckcallback.h CkCallback.decl.h ckcallback-ccs.h       \
185           ckarrayreductionmgr.h cknodegroupreduction.h cksection.h \
186           ckarray.h cklocation.h ckreduction.h ckcheckpoint.h ckmemcheckpoint.h ckevacuation.h\
187           ckobjQ.h readonly.h charisma.h ComlibArrayListener.h ComlibStrategy.h\
188           ComlibLearner.h $(UTILHEADERS) \
189           tempo.h waitqd.h LBDatabase.h lbdb.h lbdb++.h LBProfit.h \
190           LBDBManager.h LBComm.h LBOM.h LBObj.h LBMachineUtil.h LBAgent.h \
191           Refiner.h RefinerApprox.h RefinerComm.h ObjGraph.h heap.h \
192           elements.h CommLBHeap.h topology.h manager.h \
193           BaseLB.h CentralLB.h CentralLBMsg.h RandCentLB.h RecBisectBfLB.h \
194           RefineLB.h RefineKLB.h RefineCommLB.h OrbLB.h \
195           GreedyLB.h GreedyCommLB.h GreedyAgentLB.h Comm1LB.h MetisLB.h \
196           TopoLB.h RefineTopoLB.h  TopoCentLB.h  PhasebyArrayLB.h RotateLB.h \
197           GridCommLB.h GridCommRefineLB.h GridMetisLB.h GridHybridLB.h GridHybridSeedLB.h \
198           DummyLB.h BlockLB.h NborBaseLB.h HybridBaseLB.h HybridLB.h HybridLBMsg.h HbmLB.h \
199           NeighborLB.h NeighborCommLB.h NeighborLBMsg.h WSLB.h \
200           BlueGene.h middle.h middle-conv.h middle-blue.h \
201           CkMarshall.decl.h CkArray.decl.h CkLocation.decl.h    \
202           CkReduction.decl.h CkArrayReductionMgr.decl.h\
203           tempo.decl.h waitqd.decl.h \
204           CkFutures.decl.h CkCheckpoint.decl.h CkMemCheckpoint.decl.h \
205           LBDatabase.decl.h CentralLB.decl.h ComboCentLB.decl.h NullLB.decl.h \
206           RandCentLB.decl.h RecBisectBfLB.decl.h BaseLB.decl.h MetisLB.decl.h \
207           DummyLB.decl.h RotateLB.decl.h RefineLB.decl.h RefineKLB.decl.h BlockLB.decl.h \
208           RefineCommLB.decl.h OrbLB.decl.h GreedyLB.decl.h GreedyCommLB.decl.h \
209           Comm1LB.decl.h GreedyAgentLB.decl.h \
210           GridCommLB.decl.h GridCommRefineLB.decl.h GridMetisLB.decl.h GridHybridLB.decl.h \
211           GridHybridSeedLB.decl.h PhasebyArrayLB.decl.h TopoLB.decl.h RefineTopoLB.decl.h \
212           TopoCentLB.decl.h NborBaseLB.decl.h NeighborLB.decl.h \
213           NeighborCommLB.decl.h HbmLB.decl.h \
214           HybridBaseLB.decl.h HybridLB.decl.h WSLB.decl.h EveryLB.decl.h \
215           charisma.decl.h TraceSummary.decl.h TraceProjections.decl.h \
216           BlueGene.decl.h \
217           comlib.decl.h ComlibManager.h DummyStrategy.h \
218           DirectMulticastStrategy.h RingMulticastStrategy.h     \
219           MultiRingMulticast.h \
220           EachToManyMulticastStrategy.h MsgPacker.h StreamingStrategy.h \
221           NodeMulticast.h PipeBroadcastStrategy.h MeshStreamingStrategy.h \
222           PrioStreaming.h MPIStrategy.h MsgPacker.h StreamingStrategy.h \
223           BroadcastStrategy.h ComlibSectionInfo.h AAPLearner.h \
224           AAMLearner.h ComlibStats.h \
225           RectMulticastStrategy.h \
226           $(CVHEADERS)
227
228 ALLHEADERS=$(CKHEADERS) \
229     simplemsg.h sm.h pvmc.h pvm3.h sdag.h \
230         graph.h bitvecset.h Set.h LBSimulation.h  \
231         $(BLUE_HEADERS)
232
233 basics: headers
234         touch basics
235
236 # Headers is used only for the dependencies
237 headers: dirs+sources
238         $(MAKE) headerlinks
239
240 conv-autoconfig.h: configure
241         ./configure
242
243 headerlinks: dirs+sources Makefile $(ALLHEADERS)
244         @echo "Soft-linking headers..."
245         -@for hdr in $(ALLHEADERS) ; do test ! -f "../include/$$hdr" && ./system_ln "../tmp/$$hdr" ../include ; done
246         touch headerlinks
247
248 dirs+sources:
249         rm -f .gdir
250         (cd .. ; basename "`pwd`" | sed -e 's@-.*@@')   > .gdir
251         test -f ../../src/arch/`cat .gdir`/gdir_link && cat ../../src/arch/`cat .gdir`/gdir_link > .gdir.new && mv .gdir.new .gdir || true
252         pwd
253         find . -type l -exec rm {} \;
254         rm -rf QuickThreads
255         rm -rf libs
256         rm -rf ../bin ; mkdir ../bin
257         rm -rf ../lib ; mkdir ../lib
258         rm -rf ../lib_so ; mkdir ../lib_so; touch ../lib_so/.charmso
259         rm -rf ../examples
260         rm -rf ../tests
261         rm -rf ../doc ; ln -s ../doc ../doc
262         ../../src/scripts/gatherflat ../../src/scripts .
263         ./gatherflat ../../src/conv-core        .
264         ./gatherflat ../../src/conv-ldb         .
265         ./gatherflat ../../src/conv-ccs         .
266         ./gatherflat ../../src/conv-perf        .
267         ./gatherflat ../../src/ck-core          .
268         ./gatherflat ../../src/util             .
269         ./gatherflat ../../src/ck-perf          .
270         ./gatherflat ../../src/ck-ldb           .
271         ./gatherflat ../../src/ck-com           .
272         ./gatherflat ../../src/conv-com           .
273         ./gatherflat ../../src/langs/simplemsg  .
274         ./gatherflat ../../src/langs/pvmc       .
275         ./gatherflat ../../src/langs/bluegene   .
276         ./gatherflat ../../src/langs/f90charm   .
277         ./gatherflat ../../src/xlat-i           .
278         ./gatherflat ../../src/xlatcpm          .
279         ./gathertree ../../src/QuickThreads QuickThreads
280         ./gathertree ../../src/libs libs
281         ./gathertree ../../src/arch/util      .
282         ./gathertree ../../src/langs langs
283         ./gathertree ../../src/langs/jade langs/jade
284         ./gathertree ../../src/arch/common           .
285         ./gathertree ../../src/arch/`cat .gdir`      .
286         ./gatherflat ../../src/arch/`cat .vdir`      .
287         ./gathertree ../../examples ../examples
288         ./gathertree ../../tests ../tests
289         rm -f ../bin/dep.pl ; cp dep.pl ../bin/
290         chmod +x charmc
291         -./system_ln  ../tmp/charmc ../bin/
292         -ln -s ../../java/bin charmjavabin
293         -ln -s ../../java/bin ../bin/charmjavabin
294         -ln -s charmjavabin/* ../bin/
295         -ln -s ../java ..
296         rm -f .gdir
297         rm -rf ../include ; mkdir ../include
298         -./system_ln  ../tmp/conv-*.*h ../include
299         -./system_ln  ../tmp/cc-*.*h ../include
300         if [ -x ./special.sh ] ; then ./special.sh ; fi
301         if [ ! -f conv-common.h ] ; then ( touch conv-common.h ) ; fi
302         touch dirs+sources
303
304 ###############################################################################
305 #
306 # Converse Libraries
307 #
308 ###############################################################################
309 CLBLIBS=$(L)/libldb-rand.o $(L)/libldb-spray.o $(L)/libldb-neighbor.o $(L)/libldb-none.o $(L)/libldb-test.o $(L)/libldb-bluegene.o
310 TRACELIBS=$(L)/libtrace-projections.a  $(L)/libtrace-summary.a \
311           $(L)/libtrace-counter.a $(L)/libtrace-bluegene.a \
312           $(L)/libtrace-projector.a $(L)/libtrace-all.a $(L)/libtrace-converse.a \
313           $(L)/libtrace-recordreplay.a  $(L)/libtracef_f.a $(L)/libtrace-memory.a
314 MEMLIBS=$(L)/libmemory-default.o $(L)/libmemory-os.o $(L)/libmemory-gnu.o \
315           $(L)/libmemory-gnuold.o $(L)/libmemory-verbose.o      \
316           $(L)/libmemory-paranoid.o \
317           $(L)/libmemory-leak.o $(L)/libmemory-isomalloc.o \
318           $(L)/libmemory-charmdebug.o 
319 THREADLIBS=$(L)/libthreads-default.o $(L)/libthreads-qt.o       \
320           $(L)/libthreads-context.o $(L)/libthreads-uJcontext.o \
321           $(L)/libthreads-pthreads.o $(L)/libthreads-fibers.o \
322           $(L)/libthreads-stackcopy.o $(L)/libthreads-memoryalias.o \
323           $(L)/libthreads-qt-memoryalias.o      \
324           $(L)/libthreads-context-memoryalias.o \
325           $(L)/libthreads-uJcontext-memoryalias.o
326
327 CVLIBS=$(L)/libconv-core.a \
328         $(L)/libconv-cplus-y.a $(L)/libconv-cplus-n.a \
329         $(L)/libconv-util.a $(L)/libconv-utilf.a \
330         $(CLBLIBS) $(TRACELIBS) $(MEMLIBS) $(THREADLIBS) \
331         $(L)/libccs-client.a
332
333 LIBCONV_CORE= convcore.o conv-conds.o queueing.o msgmgr.o \
334         cpm.o cpthreads.o futures.o cldb.o topology.o random.o \
335         debug-conv.o generate.o edgelist.o conv-ccs.o ccs-builtins.o \
336         traceCore.o traceCoreCommon.o tracec.o \
337         converseProjections.o machineProjections.o \
338         quiescence.o isomalloc.o conv-counter.o \
339         global-nop.o cmipool.o
340
341 #############################################
342 #
343 #Comlib Core objects
344 #
345 #############################################
346 #These go into libconv-util.a and are always linked
347 CONVERSE_COM_CORE_OBJS = convcomlibstrategy.o
348
349 #These go into libck.a
350 COMLIB_CORE_OBJS = ComlibStrategy.o ComlibArrayListener.o
351 ##############################################
352
353 LIBCONV_UTIL=pup_util.o pup_toNetwork.o pup_toNetwork4.o                \
354         pup_xlater.o pup_c.o pup_paged.o pup_cmialloc.o                 \
355         ckimage.o ckdll.o ckhashtable.o sockRoutines.o                  \
356         conv-lists.o RTH.o persist-comm.o $(CONVERSE_COM_CORE_OBJS) \
357         ckbitvector.o TopoManager.o CrayNid.o
358
359 LIBCONV_UTILF=pup_f.o
360
361 converse: basics
362         $(MAKE) QuickThreads/libqt.a
363         $(MAKE) converse-target
364
365 converse-target:  $(CVLIBS) fmain-ok charmrun-target swapglobal-target conv-cpm
366
367 charmrun-target: sockRoutines.c sockRoutines.h ccs-server.c ccs-server.h sockRoutines-seq.o
368         if [ -d charmrun ] ; then ( cd charmrun ; $(MAKE) OPTS='$(OPTS)' ) ; fi
369         if [ -f charmrun ] ; then ( cp -f charmrun ../bin ) ; fi
370
371 fmain-ok: fmain.f90
372         -@$(CHARMC) -c fmain.f90
373         -@cp fmain.o ../lib
374         -@touch fmain-ok
375
376 QT:
377         cd QuickThreads && make clean
378         make QuickThreads/libqt.a
379
380 QuickThreads/libqt.a:  $(CVHEADERS)
381         cd QuickThreads;./configure
382         rm -f QuickThreads/libqt.a
383         cd QuickThreads ; $(MAKE) qt  OPTS='$(OPTS)'
384         cp -f QuickThreads/libqt.a ../lib/libckqt.a
385         -(CHARMINC=.; . ./conv-config.sh; \
386           test -d ../lib_so && \
387           cp -f QuickThreads/libqt.$$CMK_SHARED_SUF ../lib_so && \
388           cp -f QuickThreads/libqt.$$CMK_SHARED_SUF ../lib_so/libckqt.$$CMK_SHARED_SUF)
389
390 METIS:  charm++
391         cd libs/ck-libs/parmetis/METISLib && $(MAKE) OPTS='$(OPTS)'
392
393 CONVLIBS: converse
394         cd libs; $(MAKE) convlibs OPTS='$(OPTS)'
395
396 $(L)/libconv-core.a: $(LIBCONV_CORE)
397         $(CHARMC) -o $@ $(LIBCONV_CORE)
398
399 $(L)/libconv-cplus-y.a: $(L)/libconv-cplus-n.a
400
401 include Makefile.machine
402
403 $(L)/libconv-cplus-n.a: machine.c $(CVHEADERS)
404         @-test -f $(INC)/mpi.h && mv -f $(INC)/mpi.h $(INC)/mpi.BAK || true
405         $(CHARMC) -o machine.o  -DFOR_CPLUS=1 machine.c
406         @-test -f ./bglmachine.C && $(CHARMC) -o machine.o  -DFOR_CPLUS=1 bglmachine.C || true
407         $(CHARMC) -o $(L)/libconv-cplus-y.a machine.o
408         $(CHARMC) -o $(L)/libconv-cplus-n.a -DFOR_CPLUS=0 machine.c
409         @-test -f $(INC)/mpi.BAK && mv -f $(INC)/mpi.BAK $(INC)/mpi.h || true
410
411 $(L)/libconv-util.a: $(LIBCONV_UTIL)
412         $(CHARMC) -o $@ $(LIBCONV_UTIL)
413
414 $(L)/libconv-utilf.a: $(LIBCONV_UTILF)
415         -$(CHARMC) -o $@ $(LIBCONV_UTILF) || touch $@
416
417 $(L)/libccs-client.a: ccs-client.o
418         $(CHARMC) -o $@ ccs-client.o
419
420 ccs-client.o: ccs-client.c $(CVHEADERS)
421         $(CHARMC) ccs-client.c
422
423 sockRoutines.o: sockRoutines.c $(CVHEADERS) $(UTILHEADERS)
424         $(CHARMC) -DCMK_USE_CONVERSE=1 sockRoutines.c
425
426 sockRoutines-seq.o: sockRoutines.c $(CVHEADERS) $(UTILHEADERS)
427         $(SEQCHARMC) -o sockRoutines-seq.o sockRoutines.c
428
429 pup_util.o: pup_util.C $(CVHEADERS) $(UTILHEADERS)
430         $(CHARMC) -o pup_util.o pup_util.C
431
432 pup_toNetwork.o: pup_toNetwork.C $(CVHEADERS) $(UTILHEADERS)
433         $(CHARMC) -o pup_toNetwork.o pup_toNetwork.C
434
435 pup_toNetwork4.o: pup_toNetwork4.C $(CVHEADERS) $(UTILHEADERS)
436         $(CHARMC) -o pup_toNetwork4.o pup_toNetwork4.C
437
438 pup_xlater.o: pup_xlater.C $(CVHEADERS) $(UTILHEADERS)
439         $(CHARMC) -o pup_xlater.o pup_xlater.C
440
441 pup_c.o: pup_c.C $(CVHEADERS) $(UTILHEADERS)
442         $(CHARMC) -o pup_c.o pup_c.C
443
444 pup_paged.o: pup_paged.C $(CVHEADERS) $(UTILHEADERS)
445         $(CHARMC) -o pup_paged.o pup_paged.C
446
447 pup_f.o: pup_f.f90 $(CVHEADERS)
448         -$(CHARMC) -c pup_f.f90 && $(CHARMC) -cpmod ../include pupmod.M || touch pup_f.o
449
450 pup_cmialloc.o: pup_cmialloc.C $(CVHEADERS) $(UTILHEADERS)
451         $(CHARMC) -o pup_cmialloc.o pup_cmialloc.C
452
453 ckhashtable.o: ckhashtable.C ckhashtable.h $(CVHEADERS)
454         $(CHARMC) -o ckhashtable.o ckhashtable.C
455
456 TopoManager.o: TopoManager.C TopoManager.h BGLTorus.h CrayTorus.h BGPTorus.h CrayNid.c $(CVHEADERS) $(UTILHEADERS)
457         $(CHARMC) -o TopoManager.o TopoManager.C
458
459 CrayNid.o: CrayNid.c $(CVHEADERS) $(UTILHEADERS)
460         $(CHARMC) -c -o CrayNid.o CrayNid.c
461
462 ckbitvector.o: ckbitvector.C ckbitvector.h $(CVHEADERS)
463         $(CHARMC) -o ckbitvector.o ckbitvector.C
464
465 ckdll.o: ckdll.C ckdll.h $(CVHEADERS)
466         $(CHARMC) -o ckdll.o ckdll.C
467
468 ckimage.o: ckimage.C ckimage.h $(CVHEADERS)
469         $(CHARMC) -o ckimage.o ckimage.C
470
471 RTH.o: RTH.C RTH.h $(CVHEADERS)
472         $(CHARMC) -o RTH.o RTH.C
473
474 persist-comm.o: persist-comm.c persist_impl.h $(CVHEADERS)
475         $(CHARMC) -o persist-comm.o persist-comm.c
476
477 conv-lists.o: conv-lists.C $(UTILHEADERS) $(CVHEADERS)
478         $(CHARMC) -o conv-lists.o conv-lists.C
479
480 ## Converse load balancers (seed balancers, -balance)
481 $(L)/libldb-none.o: cldb.none.c $(CVHEADERS)
482         $(CHARMC) -o $@ cldb.none.c
483
484 $(L)/libldb-rand.o: cldb.rand.c cldb.h $(CVHEADERS)
485         $(CHARMC) -o $@ cldb.rand.c
486
487 $(L)/libldb-neighbor.o: cldb.neighbor.c cldb.neighbor.h graph.h $(CVHEADERS)
488         $(CHARMC) -o $@ cldb.neighbor.c
489
490 $(L)/libldb-spray.o: cldb.spray.c $(CVHEADERS)
491         $(CHARMC) -o $@ cldb.spray.c
492
493 $(L)/libldb-test.o: cldb.test.c $(CVHEADERS)
494         $(CHARMC) -o $@ cldb.test.c
495
496 $(L)/libldb-bluegene.o: cldb.bluegene.c $(CVHEADERS)
497         $(CHARMC) -o $@ cldb.bluegene.c
498
499 ## Memory allocation libraries (-memory)
500 MEM_DEPS=memory.c memory-gnu.c memory-gnuold.c converse.h conv-mach.h $(CVHEADERS)
501 $(L)/libmemory-default.o: $(MEM_DEPS)
502         $(CHARMC) -o $@ -DCMK_MEMORY_BUILD_DEFAULT memory.c
503
504 $(L)/libmemory-os.o: $(MEM_DEPS)
505         $(CHARMC) -o $@ -DCMK_MEMORY_BUILD_OS memory.c
506
507 # If the system doesn't have sbrk, these compilations may fail.
508 #  This is OK, but then we can't use "-memory gnu" or friends.
509 $(L)/libmemory-gnu.o: $(MEM_DEPS)
510         -$(CHARMC) -o $@ -DCMK_MEMORY_BUILD_GNU memory.c || touch $@
511
512 $(L)/libmemory-gnuold.o: $(MEM_DEPS)
513         -$(CHARMC) -o $@ -DCMK_MEMORY_BUILD_GNUOLD memory.c || touch $@
514
515 $(L)/libmemory-verbose.o: memory-verbose.c $(MEM_DEPS)
516         -$(CHARMC) -o $@ -DCMK_MEMORY_BUILD_VERBOSE memory.c || touch $@
517
518 $(L)/libmemory-paranoid.o: memory-paranoid.c $(MEM_DEPS)
519         -$(CHARMC) -o $@ -DCMK_MEMORY_BUILD_PARANOID memory.c || touch $@
520
521 $(L)/libmemory-leak.o: memory-leak.c $(MEM_DEPS)
522         -$(CHARMC) -o $@ -DCMK_MEMORY_BUILD_LEAK memory.c || touch $@
523
524 $(L)/libmemory-cache.o: memory-cache.c $(MEM_DEPS)
525         -$(CHARMC) -o $@ -DCMK_MEMORY_BUILD_CACHE memory.c || touch $@
526
527 $(L)/libmemory-isomalloc.o: memory-isomalloc.c $(MEM_DEPS)
528         -$(CHARMC) -o $@ -DCMK_MEMORY_BUILD_ISOMALLOC memory.c || touch $@
529
530 $(L)/libmemory-charmdebug.o: memory-charmdebug.c $(MEM_DEPS)
531         -$(CHARMC) -o $@ -DCMK_MEMORY_BUILD_CHARMDEBUG memory.c || touch $@
532
533 ## Thread libraries (-thread)
534 $(L)/libthreads-default.o: threads.c $(CVHEADERS)
535         $(CHARMC) -o $@ -DCMK_THREADS_BUILD_DEFAULT=1 -IQuickThreads -I. threads.c
536
537 $(L)/libthreads-qt.o: threads.c $(CVHEADERS)
538         $(CHARMC) -o $@ -DCMK_THREADS_BUILD_QT=1 -IQuickThreads threads.c
539
540 $(L)/libthreads-context.o: threads.c $(CVHEADERS)
541         -$(CHARMC) -o $@ -DCMK_THREADS_BUILD_CONTEXT=1 -IQuickThreads threads.c || touch $@
542
543 $(L)/libthreads-uJcontext.o: threads.c uJcontext.c $(CVHEADERS)
544         -$(CHARMC) -o $@ -DCMK_THREADS_BUILD_JCONTEXT=1 -IQuickThreads -I. threads.c || touch $@
545
546 $(L)/libthreads-pthreads.o: threads.c $(CVHEADERS)
547         -$(CHARMC) -o $@ -DCMK_THREADS_BUILD_PTHREADS=1 -IQuickThreads threads.c || touch $@
548
549 $(L)/libthreads-fibers.o: threads.c $(CVHEADERS)
550         -$(CHARMC) -o $@ -DCMK_THREADS_BUILD_FIBERS=1 -IQuickThreads threads.c 2> /dev/null || touch $@
551
552 $(L)/libthreads-stackcopy.o: threads.c $(CVHEADERS)
553         -$(CHARMC) -o $@ -DCMK_THREADS_BUILD_STACKCOPY=1 -IQuickThreads threads.c || touch $@
554
555 $(L)/libthreads-memoryalias.o: threads.c $(CVHEADERS)
556         -$(CHARMC) -o $@ -DCMK_THREADS_ALIAS_STACK=1 -DCMK_THREADS_BUILD_DEFAULT=1 -IQuickThreads threads.c || touch $@
557
558 $(L)/libthreads-qt-memoryalias.o: threads.c $(CVHEADERS)
559         -$(CHARMC) -o $@ -DCMK_THREADS_ALIAS_STACK=1 -DCMK_THREADS_BUILD_QT=1 -IQuickThreads threads.c || touch $@
560
561 $(L)/libthreads-context-memoryalias.o: threads.c $(CVHEADERS)
562         -$(CHARMC) -o $@ -DCMK_THREADS_ALIAS_STACK=1 -DCMK_THREADS_BUILD_CONTEXT=1 -IQuickThreads threads.c || touch $@
563
564 $(L)/libthreads-uJcontext-memoryalias.o: threads.c $(CVHEADERS)
565         -$(CHARMC) -o $@ -DCMK_THREADS_ALIAS_STACK=1 -DCMK_THREADS_BUILD_JCONTEXT=1 -IQuickThreads -I. threads.c || touch $@
566
567 ## Global swapping (-swapglobal)
568 swapglobal-target: $(L)/libglobal-swap.o $(L)/libglobal-copy.o $(L)/loadsym.o
569
570 $(L)/libglobal-swap.o: global-elfgot.C $(CVHEADERS)
571         -$(CHARMC) -c global-elfgot.C -o $@ || touch $@
572
573 $(L)/libglobal-copy.o: global-elfcopy.C  $(CVHEADERS)
574         -$(CHARMC) -c global-elfcopy.C -o $@ || touch $@
575
576 $(L)/loadsym.o: loadsym.c  $(CVHEADERS)
577         -$(CHARMC) -c loadsym.c -o $@ || touch $@
578
579 ###############################################################################
580 #
581 # Charm Libraries
582 #
583 ###############################################################################
584
585 CK_LIBS_CORE=$(L)/libck.a
586
587 LIBCK_CORE=trace-common.o tracef.o init.o register.o qd.o ck.o main.o  \
588            msgalloc.o ckfutures.o ckIgetControl.o debug-message.o debug-charm.o ckcallback.o \
589            cklocation.o ckarray.o ckreduction.o ckarrayreductionmgr.o\
590            tempo.o waitqd.o LBDatabase.o lbdb.o lbdbf.o charisma.o ckobjQ.o  \
591            LBAgent.o LBProfit.o ckcheckpoint.o ckmemcheckpoint.o ckevacuation.o\
592            LBDBManager.o LBComm.o LBObj.o LBMachineUtil.o CentralPredictor.o \
593            BaseLB.o CentralLB.o HybridBaseLB.o NborBaseLB.o WSLB.o \
594            ObjGraph.o graph.o LButil.o Refiner.o RefinerApprox.o  \
595            RefinerComm.o bitvecset.o Set.o heap.o CommLBHeap.o \
596            NullLB.o LBSimulation.o $(COMLIB_CORE_OBJS) \
597            charmProjections.o
598
599 charm-target: converse $(L)/libck.a $(L)/libckf.a loadbalancers default_libs comlib_objs
600
601 CHARMLIBS: charm++
602         cd libs; $(MAKE) charmlibs OPTS='$(OPTS)'
603
604 $(L)/libck.a: $(LIBCK_CORE)
605         $(CHARMC) -o $@ $(LIBCK_CORE)
606
607 CkFutures.def.h: CkFutures.decl.h
608
609 CkFutures.decl.h: ckfutures.ci charmxi
610         $(CHARMXI) ckfutures.ci
611
612 tempo.def.h: tempo.decl.h
613
614 tempo.decl.h: tempo.ci charmxi
615         $(CHARMXI) tempo.ci
616
617 waitqd.def.h: waitqd.decl.h
618
619 waitqd.decl.h: waitqd.ci charmxi
620         $(CHARMXI) waitqd.ci
621
622 LBDatabase.def.h: LBDatabase.decl.h
623
624 LBDatabase.decl.h: LBDatabase.ci charmxi
625         $(CHARMXI) LBDatabase.ci
626
627 NullLB.def.h: NullLB.decl.h
628
629 NullLB.decl.h: NullLB.ci charmxi
630         $(CHARMXI) NullLB.ci
631
632 BaseLB.def.h: BaseLB.decl.h
633
634 BaseLB.decl.h: BaseLB.ci charmxi
635         $(CHARMXI) BaseLB.ci
636
637 TraceProjections.def.h: TraceProjections.decl.h
638
639 TraceProjections.decl.h: trace-projections.ci charmxi
640         $(CHARMXI) trace-projections.ci
641
642 TraceSummary.def.h: TraceSummary.decl.h
643
644 TraceSummary.decl.h: trace-summary.ci charmxi
645         $(CHARMXI) trace-summary.ci
646
647 CkReduction.def.h: CkReduction.decl.h
648
649 CkReduction.decl.h: ckreduction.ci charmxi
650         $(CHARMXI) ckreduction.ci
651
652 CkCheckpoint.def.h: CkCheckpoint.decl.h
653
654 CkCheckpoint.decl.h: ckcheckpoint.ci charmxi
655         $(CHARMXI) ckcheckpoint.ci
656
657 CkMemCheckpoint.def.h: CkMemCheckpoint.decl.h
658
659 CkMemCheckpoint.decl.h: ckmemcheckpoint.ci charmxi
660         $(CHARMXI) ckmemcheckpoint.ci
661
662 CkMarshall.def.h: CkMarshall.decl.h
663
664 CkMarshall.decl.h: ckmarshall.ci charmxi
665         $(CHARMXI) ckmarshall.ci
666
667 CkArrayReductionMgr.def.h: CkArrayReductionMgr.decl.h
668
669 CkArrayReductionMgr.decl.h: ckarrayreductionmgr.ci charmxi
670         $(CHARMXI) ckarrayreductionmgr.ci
671
672 CkArray.def.h: CkArray.decl.h
673
674 CkArray.decl.h : ckarray.ci charmxi
675         $(CHARMXI) ckarray.ci
676
677 CkLocation.def.h: CkLocation.decl.h
678
679 CkLocation.decl.h: cklocation.ci charmxi
680         $(CHARMXI) cklocation.ci
681
682 CkCallback.def.h: CkCallback.decl.h
683
684 CkCallback.decl.h: ckcallback.ci charmxi
685         $(CHARMXI) ckcallback.ci
686
687 charisma.def.h: charisma.decl.h
688
689 charisma.decl.h: charisma.ci charmxi
690         $(CHARMXI) charisma.ci
691
692 ## Charm++ Load balancer (Dynamic load balancer)
693
694 CentralLB.def.h: CentralLB.decl.h
695
696 CentralLB.decl.h: CentralLB.ci charmxi
697         $(CHARMXI) CentralLB.ci
698
699 NborBaseLB.def.h: NborBaseLB.decl.h
700
701 NborBaseLB.decl.h: NborBaseLB.ci charmxi
702         $(CHARMXI) NborBaseLB.ci
703
704 HybridBaseLB.def.h: HybridBaseLB.decl.h
705
706 HybridBaseLB.decl.h: HybridBaseLB.ci charmxi
707         $(CHARMXI) HybridBaseLB.ci
708
709 ## Charm fortran AMPI
710
711 CK_FOR_LIBS_CORE=$(L)/libckf.a
712
713 LIBCKF_CORE=charmf.o charmmod.o
714
715 $(L)/libckf.a: $(LIBCKF_CORE)
716         -$(CHARMC) -o $@ $(LIBCKF_CORE) || touch $@
717
718 charmf.o:  charmf.C $(CKHEADERS) charmf.h
719         $(CHARMC) -c -I. charmf.C
720
721 charmmod.o: charmmod.f90
722         -$(CHARMC) -c charmmod.f90 || touch $@
723         -$(CHARMC) -cpmod ../include charm.M
724
725 ## Tracing libraries (profiling, -tracemode)
726 LIBTRACE_PROJ=trace-projections.o
727 $(L)/libtrace-projections.a: $(LIBTRACE_PROJ)
728         $(CHARMC) -o $@ $(LIBTRACE_PROJ)
729
730 LIBTRACE_SUMM=trace-summary.o
731 $(L)/libtrace-summary.a: $(LIBTRACE_SUMM)
732         $(CHARMC) -o $@ $(LIBTRACE_SUMM)
733
734 LIBTRACE_RECREP=trace-recordreplay.o
735 $(L)/libtrace-recordreplay.a: $(LIBTRACE_RECREP)
736         $(CHARMC) -o $@ $(LIBTRACE_RECREP)
737
738 LIBTRACE_COUNT=trace-counter.o
739 $(L)/libtrace-counter.a: $(LIBTRACE_COUNT)
740         $(CHARMC) -o $@ $(LIBTRACE_COUNT)
741
742 LIBTRACE_BG=trace-bluegene.o
743 $(L)/libtrace-bluegene.a:$(LIBTRACE_BG)
744         $(CHARMC) -o $@ $(LIBTRACE_BG)
745
746 tracec.o: tracec.h tracec.C
747         $(CHARMC) -o $@ tracec.C
748
749 LIBTRACE_MEMORY=trace-memory.o
750 $(L)/libtrace-memory.a: $(LIBTRACE_MEMORY)
751         $(CHARMC) -o $@ $(LIBTRACE_MEMORY)
752
753 LIBTRACE_ALL=trace-all.o trace-projections.o trace-summary.o trace-recordreplay.o trace-projector.o traceCore.o traceCoreCommon.o charmProjections.o converseProjections.o machineProjections.o trace-memory.o
754 $(L)/libtrace-all.a: $(LIBTRACE_ALL)
755         $(CHARMC) -o $@ $(LIBTRACE_ALL)
756
757 LIBTRACE_PROJECTOR=trace-projector.o traceCore.o traceCoreCommon.o charmProjections.o converseProjections.o machineProjections.o
758 $(L)/libtrace-projector.a: $(LIBTRACE_PROJECTOR)
759         $(CHARMC) -o  $@ $(LIBTRACE_PROJECTOR)
760
761 LIBTRACE_CONVERSE=trace-converse.o
762 $(L)/libtrace-converse.a: $(LIBTRACE_CONVERSE)
763         $(CHARMC) -o  $@ $(LIBTRACE_CONVERSE)
764
765 LIBTRACE_FOR=tracef_f.o
766 $(L)/libtracef_f.a: $(LIBTRACE_FOR)
767         -$(CHARMC) -o $@ $(LIBTRACE_FOR) || touch $@
768
769 tracef_f.o: tracef_f.f90
770         -$(CHARMC) -o $@ -c tracef_f.f90 && $(CHARMC) -cpmod ../include tracemod.M  || touch $@
771
772 # used for make depends
773 TRACE_OBJS =  trace-projections.o  trace-summary.o  trace-counter.o     \
774               trace-bluegene.o trace-projector.o trace-converse.o trace-all.o \
775               trace-recordreplay.o trace-memory.o
776
777 ###############################################################################
778 #
779 # Dynamic Load Balancers
780 #
781 ###############################################################################
782
783
784 # Automatically generated by script Makefile_lb.sh
785 include Make.lb
786
787 loadbalancers: $(LOADBALANCERS) $(L)/libmoduleEveryLB.a
788
789
790 ######################################################################
791 #
792 #Communication Optimization Library
793 #
794 ######################################################################
795
796 STRATEGY_OBJS = MPIStrategy.o StreamingStrategy.o \
797                 DummyStrategy.o NodeMulticast.o \
798                 EachToManyMulticastStrategy.o ComlibSectionInfo.o \
799                 AAPLearner.o ComlibStats.o AAMLearner.o \
800                 MsgPacker.o DirectMulticastStrategy.o \
801                 RingMulticastStrategy.o MultiRingMulticast.o\
802                 PipeBroadcastStrategy.o MeshStreamingStrategy.o \
803                 PrioStreaming.o BroadcastStrategy.o RectMulticastStrategy.o
804
805 CONVERSE_COM_OBJS = gridrouter.o de.o treerouter.o petable.o \
806         3dgridrouter.o graphrouter.o hypercubetopology.o \
807         routerstrategy.o convcomlibmanager.o pipebroadcastconverse.o \
808         pipelinestrategy.o prefixrouter.o
809
810 comlib.def.h: comlib.decl.h
811
812 comlib.decl.h : ComlibManager.ci charmxi
813         $(CHARMXI) ComlibManager.ci
814
815 COMLIB_OBJS = ComlibManager.o $(STRATEGY_OBJS) $(CONVERSE_COM_OBJS)
816
817 comlib_objs: $(L)/libmodulecomlib.a $(L)/libconvcom.a
818
819 $(L)/libconvcom.a: $(COMLIB_OBJS)
820         $(CHARMC) -o $(L)/libconvcom.a $(CONVERSE_COM_OBJS)
821
822 #for backward compatibility, keep libmodulecommlib.a with double m.
823 $(L)/libmodulecomlib.a: $(COMLIB_OBJS)
824         $(CHARMC) -o $(L)/libmodulecomlib.a $(COMLIB_OBJS)
825         $(CHARMC) -o $(L)/libmodulecommlib.a $(COMLIB_OBJS)
826
827 ###############################################################################
828 #
829 # BlueGene Emulator
830 #
831 ###############################################################################
832
833 bigsim:  basics
834         $(MAKE) bigsim-target
835
836 bigemulator: bigsim
837
838 bigsim-target: charm++ $(L)/libconv-bigsim.a $(L)/libconv-bigsim-logs.a $(L)/libconv-bluegene-stub.a $(L)/libblue-standalone.a METIS
839
840 # old (Charm++) Blue Gene emulator
841 BlueGene.decl.h BlueGene.def.h : BlueGene.ci charmxi
842         $(CHARMXI) BlueGene.ci
843
844 $(L)/libbluegene.a: BlueGene.C BlueGene.h BlueGene.decl.h BlueGene.def.h
845         $(CHARMC) -c BlueGene.C
846         $(CHARMC) -o $@ BlueGene.o
847
848 # (Converse) Blue Gene emulator
849 BLUE_HEADERS = blue_types.h blue_timing.h blue_defs.h bigsim_logs.h blue.h blue_impl.h blue_network.h
850 BLUE_OBJS = blue.o bigsim_node.o bigsim_proc.o bigsim_init.o blue_timing.o
851 BIGSIM_IO_OBJS = bigsim_IO.o bigsim_logs.o bigsim_api.o
852
853 LIBBLUE_OBJS = $(BLUE_OBJS) $(BIGSIM_IO_OBJS) blue_stub.o blue_standalone.o
854
855 $(L)/libconv-bigsim.a: $(BLUE_OBJS)
856         $(CHARMC) -o $@  $(BLUE_OBJS)
857
858 $(L)/libconv-bigsim-logs.a: $(BIGSIM_IO_OBJS)
859         $(CHARMC) -o $@  $(BIGSIM_IO_OBJS)
860
861 $(L)/libconv-bluegene-stub.a:  blue_stub.o
862         $(CHARMC) -o $@  blue_stub.o
863
864 $(L)/libblue-standalone.a: blue_standalone.o
865         $(CHARMC) -o $@  blue_standalone.o
866
867 ###############################################################################
868 #
869 # The CPM scanner
870 #
871 ###############################################################################
872
873 conv-cpm: conv-cpm.o
874         $(NATIVECHARMC) -language c -o conv-cpm -cp ../bin/ conv-cpm.o
875
876 conv-cpm.o: conv-cpm.c $(CVHEADERS)
877         $(NATIVECHARMC) conv-cpm.c
878
879 ###############################################################################
880 #
881 # The interface translator
882 #
883 ###############################################################################
884
885 XIHEADERS=conv-autoconfig.h xi-symbol.h xi-util.h xi-grammar.tab.h
886 CHARMXIOBJ=xi-main.o xi-symbol.o xi-grammar.tab.o xi-scan.o xi-util.o
887 SDAGOBJ=sdag-globals.o CSdagConstruct.o CEntry.o
888 SDAGHEADERS= CToken.h EToken.h CParsedFile.h \
889         sdag-globals.h CEntry.h
890
891 charmxi: ../bin/charmxi
892
893 ../bin/charmxi: $(CHARMXIOBJ) $(SDAGOBJ)
894         $(NATIVECHARMC) -language c++ -cp ../bin/ -o charmxi $(CHARMXIOBJ) $(SDAGOBJ)
895
896 xi-main.o: xi-main.C $(XIHEADERS) $(SDAGHEADERS)
897         $(NATIVECHARMC) xi-main.C
898
899 xi-symbol.o: xi-symbol.C $(XIHEADERS) $(SDAGHEADERS)
900         $(NATIVECHARMC) xi-symbol.C
901
902 xi-util.o: xi-util.C $(XIHEADERS) $(SDAGHEADERS)
903         $(NATIVECHARMC) xi-util.C
904
905 xi-grammar.tab.o: xi-grammar.tab.C $(XIHEADERS) $(SDAGHEADERS)
906         $(NATIVECHARMC) xi-grammar.tab.C
907
908 xi-scan.o: xi-scan.C $(XIHEADERS) $(SDAGHEADERS)
909         $(NATIVECHARMC) -I. -DYY_NEVER_INTERACTIVE xi-scan.C
910
911 sdag-globals.o: sdag-globals.C $(XIHEADERS) $(SDAGHEADERS)
912         $(NATIVECHARMC) -c sdag-globals.C
913
914 CSdagConstruct.o: CSdagConstruct.C $(XIHEADERS) $(SDAGHEADERS)
915         $(NATIVECHARMC) -c CSdagConstruct.C
916
917 CEntry.o: CEntry.C $(XIHEADERS) $(SDAGHEADERS)
918         $(NATIVECHARMC) -c CEntry.C
919
920 ###############################################################################
921 #
922 # Simple Messaging
923 #
924 ###############################################################################
925
926 $(L)/libtsm.a: converse simplemsg.c simplemsg.h
927         $(CHARMC) -o $@ simplemsg.c
928
929 $(L)/libsm.a: converse sm.c sm.h
930         $(CHARMC) -o $@ sm.c
931
932 ###############################################################################
933 #
934 # PVM
935 #
936 ###############################################################################
937
938 PVMC=pvmc_buf.o pvmc_comm.o pvmc_conv.o pvmc_main.o pvmc_pack.o pvmc_groups.o
939
940 $(L)/libpvmc.a: $(PVMC)
941         $(CHARMC) -o $@ $(PVMC)
942
943 pvmc_buf.o: pvmc_buf.c pvmc.h pvm3.h
944         $(CHARMC) -o $@ pvmc_buf.c
945
946 pvmc_conv.o: pvmc_conv.c pvmc.h pvm3.h
947         $(CHARMC) -o $@ pvmc_conv.c
948
949 pvmc_pack.o: pvmc_pack.c pvmc.h pvm3.h
950         $(CHARMC) -o $@ pvmc_pack.c
951
952 pvmc_comm.o: pvmc_comm.c pvmc.h pvm3.h
953         $(CHARMC) -o $@ pvmc_comm.c
954
955 pvmc_groups.o: pvmc_groups.c pvmc.h pvm3.h
956         $(CHARMC) -o $@ pvmc_groups.c
957
958 pvmc_main.o: pvmc_main.c pvmc.h pvm3.h
959         $(CHARMC) -o $@ pvmc_main.c
960
961 $(L)/libf90charm.a: charmxi f90main.ci f90main.h f90main.C futil.f90
962         $(CHARMC) f90main.ci
963         $(CHARMC) -c -DAMPI_FORTRAN=1 f90main.C
964         -$(CHARMC) -c futil.f90
965         -$(CHARMC) -o $@ f90main.o futil.o
966
967 ###############################################################################
968 #
969 # Make clean
970 #
971 ###############################################################################
972
973 install:
974         @test ! -d $(DESTDIR)/include && mkdir -p $(DESTDIR)/include || true
975         @test ! -d $(DESTDIR)/lib && mkdir -p $(DESTDIR)/lib || true
976         @test ! -d $(DESTDIR)/lib_so && mkdir -p $(DESTDIR)/lib_so || true
977         @test ! -d $(DESTDIR)/bin && mkdir -p $(DESTDIR)/bin || true
978         cp -f ../include/*   $(DESTDIR)/include
979         cp -f ../lib/*       $(DESTDIR)/lib
980         cp -f ../lib_so/*    $(DESTDIR)/lib_so
981 #       cp -f ../bin/*       $(DESTDIR)/bin
982         for f in ../bin/*; do if test -f $$f; then cp -f $$f $(DESTDIR)/bin; fi; done
983
984
985 clean:
986         rm -f conv-autoconfig.h config.cache
987         rm -f QuickThreads/libqt.a
988         rm -f charmxi conv-cpm
989         rm -f TAGS basics cmk_extras core
990         rm -f core *.a
991         rm -f core *.o
992         rm -f core #*#
993         rm -f core *~
994         if [ -d charmrun ] ; then ( cd charmrun; make clean ) ; fi
995         -( cd doc && make clean )
996         ( cd libs; make clean )
997         ( cd ../examples && make clean )
998         ( cd ../tests && make clean )
999
1000 veryclean:
1001         rm -rf ../bin
1002         rm -rf ../lib
1003         rm -rf ../src
1004         rm -rf ../examples
1005         rm -rf ../tests
1006         rm -rf ../include
1007         rm -rf ../doc
1008         mv Makefile .Makefile
1009         mv Make.depends .Make.depends
1010         rm -rf [a-z]* [A-Z]*
1011         mv .Make.depends Make.depends
1012         rm -rf .[a-z]* .[A-Z]*
1013
1014
1015 config: configure.in
1016         autoconf && autoheader
1017
1018 depends: basics
1019         echo "Creating " $(DEPENDFILE) " ...";
1020         if [ -f $(DEPENDFILE) ]; then \
1021            /bin/cp -f $(DEPENDFILE) $(DEPENDFILE).old; \
1022         fi; \
1023         echo '#generated by make depends' > $(DEPENDFILE); \
1024         processFiles='';        \
1025         for i in $(LIBCONV_CORE) $(TRACE_OBJS) $(LIBCK_CORE) $(LB_OBJ) $(LIBBLUE_OBJS) $(CONVERSE_COM_CORE_OBJS) $(COMLIB_OBJS); do \
1026               processed='false';        \
1027               for f in $$processFiles; do       \
1028                 if test $$i = $$f ; then        \
1029                   processed=true;  break;       \
1030                 fi;     \
1031               done;     \
1032               test $$processed = 'true'  && continue;   \
1033               processFiles="$$processFiles $$i";        \
1034               SRCFILE=`basename $$i .o`.C ; \
1035               [ ! -f $$SRCFILE ] && SRCFILE=`basename $$i .o`.c ;       \
1036               echo "checking dependencies for $$SRCFILE" ; \
1037               if g++ -MM -Wno-deprecated -I. -I$(INC) $$SRCFILE  >> $(DEPENDFILE); then   echo '        $$(CHARMC) -c -I. '$$SRCFILE >> $(DEPENDFILE) ; else echo '' ; echo "Compilation of '$$SRCFILE' failed, please fix it first!!!!" ; exit; fi;  \
1038               echo '' >> $(DEPENDFILE) ; \
1039         done;
1040