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