Move TempAwareGreedyLB out of the common set
[charm.git] / src / ck-ldb / Makefile_lb.sh
1 #!/bin/sh
2 #UNCOMMON_LDBS="TempAwareGreedyLB MetisLB ScotchLB TeamLB"
3 COMMON_LDBS="BlockLB CommLB DummyLB GreedyAgentLB GreedyCommLB GreedyLB NeighborCommLB NeighborLB OrbLB PhasebyArrayLB RandCentLB RecBipartLB RefineLB RefineCommLB RotateLB"
4 OTHER_LDBS="ComboCentLB GraphPartLB GraphBFTLB GridCommLB GridCommRefineLB GridHybridLB GridHybridSeedLB GridMetisLB HbmLB HybridLB RefineKLB RefineTopoLB TopoCentLB TopoLB WSLB"
5 ALL_LDBS="$COMMON_LDBS $OTHER_LDBS"
6
7 out="Make.lb"
8
9 echo "# Automatically generated by script Makefile_lb.sh" > $out
10 echo "#  by" `id` >> $out
11 echo "#  at" `hostname` >> $out
12 echo "#  on" `date` >> $out
13 echo "ALL_LDBS=\\" >> $out
14 for bal in $ALL_LDBS 
15 do 
16         echo "   \$(L)/libmodule$bal.a \\" >> $out 
17 done
18 echo "   manager.o" >> $out
19 echo >> $out
20
21 for bal in $ALL_LDBS $UNCOMMON_LDBS
22 do 
23         dep=""
24         [ -r libmodule$bal.dep ] && dep="cp -f libmodule$bal.dep "'$'"(L)/"
25         manager=""
26         [ $bal = 'GreedyCommLB' ] && manager="manager.o"
27         [ $bal = 'GridCommLB' ] && manager="manager.o"
28         [ $bal = 'GridCommRefineLB' ] && manager="manager.o"
29         [ $bal = 'GridHybridLB' ] && manager="manager.o"
30         [ $bal = 'GridHybridSeedLB' ] && manager="manager.o"
31         cat >> $out << EOB 
32
33 \$(L)/libmodule$bal.a: $bal.o $manager
34         \$(CHARMC) -o \$(L)/libmodule$bal.a $bal.o $manager
35         $dep
36 LBHEADERS += $bal.h $bal.decl.h
37
38 EOB
39 done
40
41 echo "// AUTOMATICALLY GENERATED FILE" > EveryLB.ci
42 echo "" >> EveryLB.ci
43 echo "module EveryLB {" >> EveryLB.ci
44 for bal in $ALL_LDBS
45 do
46         echo "  extern module $bal;" >> EveryLB.ci
47 done
48 echo "" >> EveryLB.ci
49 echo "  initnode void initEveryLB(void);" >> EveryLB.ci
50 echo "};" >> EveryLB.ci
51
52 echo "// AUTOMATICALLY GENERATED FILE" > CommonLBs.ci
53 echo "" >> CommonLBs.ci
54 echo "module CommonLBs {" >> CommonLBs.ci
55 for bal in $COMMON_LDBS
56 do
57         echo "  extern module $bal;" >> CommonLBs.ci
58 done
59 echo "" >> CommonLBs.ci
60 echo "  initnode void initCommonLBs(void);" >> CommonLBs.ci
61 echo "};" >> CommonLBs.ci
62
63 echo "# used for make depends" >> $out
64 echo "ALL_LB_OBJS=EveryLB.o \\" >> $out
65 echo "    CommonLBs.o \\" >> $out
66 for bal in $ALL_LDBS $UNCOMMON_LDBS
67 do
68         echo "    $bal.o \\" >> $out
69 done
70 echo "    manager.o" >> $out
71
72 echo "# EveryLB dependecies" >> $out
73 echo "EVERYLB_DEPS=EveryLB.o \\" >> $out
74 for bal in $ALL_LDBS
75 do
76         echo "    $bal.o \\" >> $out
77 done
78 echo "    manager.o" >> $out
79
80 echo "# CommonLBs dependencies" >> $out
81 echo "COMMONLBS_DEPS=CommonLBs.o \\" >> $out
82 for bal in $COMMON_LDBS
83 do
84         echo "    $bal.o \\" >> $out
85 done
86 echo "    manager.o" >> $out
87
88 cat >> $out <<EOB
89
90 \$(L)/libmoduleEveryLB.a: \$(EVERYLB_DEPS)
91         \$(CHARMC) -o \$(L)/libmoduleEveryLB.a \$(EVERYLB_DEPS)
92
93 \$(L)/libmoduleCommonLBs.a: \$(COMMONLBS_DEPS)
94         \$(CHARMC) -o \$(L)/libmoduleCommonLBs.a \$(COMMONLBS_DEPS)
95 EOB