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