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