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