Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/regex/build/sun_gen.sh @ 12

Last change on this file since 12 was 12, checked in by landauf, 18 years ago

added boost

File size: 4.2 KB
Line 
1#! /bin/bash
2
3libname=""
4src=""
5header=""
6all_dep=""
7
8# current makefile:
9out=""
10# temporary file:
11tout=""
12# install target temp file:
13iout=""
14# debug flag:
15debug="no"
16# compile options:
17opts=""
18# main output sub-directory:
19subdir=""
20# vcl flag:
21use_vcl="yes"
22
23#######################################################################
24#
25# section for Sun Forte 6.1 (5.1 compiler)
26#
27#######################################################################
28
29function sun_gen_lib()
30{
31        all_dep="$all_dep $subdir/$libname $subdir/$libname.a"
32
33#
34# set up section comments:
35        cat >> $tout << EOF
36########################################################
37#
38# section for $libname.a
39#
40########################################################
41EOF
42#
43#       process source files:
44        all_obj=""
45        all_lib_obj=""
46        for file in $src
47        do
48                obj=`echo "$file" | sed 's/.*src\/\(.*\)cpp/\1o/g'`
49                obj="$subdir/$libname/$obj"
50                all_obj="$all_obj $obj"
51                all_lib_obj="$all_lib_obj $obj"
52                echo "$obj: $file \$(ALL_HEADER)" >> $tout
53                echo "  CC -c \$(INCLUDES) $opts \$(CXXFLAGS) -o $obj $file" >> $tout
54                echo "" >> $tout
55        done
56#
57#        now for the directories for this library:
58        echo "$subdir/$libname : " >> $tout
59        echo "  mkdir -p $subdir/$libname" >> $tout
60        echo "" >> $tout
61#
62#        now for the clean options for this library:
63        all_clean="$all_clean $libname""_clean"
64        echo "$libname"_clean : >> $tout
65        echo "  rm -f $subdir/$libname/"'*.o' >> $tout
66        echo "  rm -fr $subdir/$libname/\$(SUNWS_CACHE_NAME)" >> $tout
67        echo "" >> $tout
68#
69#        now for the main target for this library:
70        echo $subdir/$libname.a : $all_obj >> $tout
71        echo "  CC -xar \$(CXXFLAGS) \$(LDFLAGS) -o $subdir/$libname.a $all_lib_obj" >> $tout
72        echo "" >> $tout
73}
74
75function sun_gen_dll()
76{
77        all_dep="$all_dep $subdir/shared_$libname $subdir/$libname.so"
78#
79# set up section comments:
80        cat >> $tout << EOF
81########################################################
82#
83# section for $libname.so
84#
85########################################################
86EOF
87#
88#       process source files:
89        all_obj=""
90        for file in $src
91        do
92                obj=`echo "$file" | sed 's/.*src\/\(.*\)cpp/\1o/g'`
93                obj="$subdir/shared_$libname/$obj"
94                all_obj="$all_obj $obj"
95                echo "$obj: $file \$(ALL_HEADER)" >> $tout
96                echo "  CC -c \$(INCLUDES) $opts \$(CXXFLAGS) -o $obj $file" >> $tout
97                echo "" >> $tout
98        done
99#
100#        now for the directories for this library:
101        echo "$subdir/shared_$libname :" >> $tout
102        echo "  mkdir -p $subdir/shared_$libname" >> $tout
103        echo "" >> $tout
104#
105#        now for the clean options for this library:
106        all_clean="$all_clean $libname""_clean_shared"
107        echo "$libname"_clean_shared : >> $tout
108        echo "  rm -f $subdir/shared_$libname/"'*.o' >> $tout
109        echo "  rm -fr $subdir/shared_$libname/\$(SUNWS_CACHE_NAME)" >> $tout
110        echo "" >> $tout
111#
112#        now for the main target for this library:
113        echo $subdir/$libname.so : $all_obj >> $tout
114        echo "  CC $opts -G -o $subdir/$libname.so \$(LDFLAGS) $all_obj \$(LIBS)" >> $tout
115        echo "" >> $tout
116}
117
118
119
120function sun_gen()
121{
122        tout="temp"
123        iout="temp_install"
124        all_dep="$subdir"
125        all_clean=""
126        echo > $out
127        echo > $tout
128        rm -f $iout
129
130        libname="libboost_regex\$(LIBSUFFIX)"
131        opts="-O2 -I../../../"
132        sun_gen_lib
133
134        libname="libboost_regex_mt\$(LIBSUFFIX)"
135        opts="-O2 -mt -I../../../"
136        sun_gen_lib
137       
138        libname="libboost_regex\$(LIBSUFFIX)"
139        opts="-KPIC -O2 -I../../../"
140        sun_gen_dll
141
142        libname="libboost_regex_mt\$(LIBSUFFIX)"
143        opts="-KPIC -O2 -mt -I../../../"
144        sun_gen_dll
145       
146       
147        cat > $out << EOF
148#
149# auto generated makefile for Sun Forte 6.1
150#
151# usage:
152# make
153#   brings libraries up to date
154# make clean
155#   removes all temporary files.
156
157#
158# Add additional compiler options here:
159#
160CXXFLAGS=
161#
162# Add additional include directories here:
163#
164INCLUDES=
165#
166# add additional linker flags here:
167#
168LDFLAGS=
169#
170# add additional libraries to link to here:
171#
172LIBS=
173#
174# lib suffix string:
175#
176LIBSUFFIX=
177#
178# template cache path:
179#
180SUNWS_CACHE_NAME=SunWS_cache
181
182
183EOF
184        echo "" >> $out
185        echo "ALL_HEADER=$header" >> $out
186        echo "" >> $out
187        echo "all : $all_dep" >> $out
188        echo >> $out
189        echo "clean : $all_clean" >> $out
190        echo >> $out
191        echo "install : all" >> $out
192#       cat $iout >> $out
193        echo >> $out
194        echo $subdir : >> $out
195        echo "  mkdir -p $subdir" >> $out
196        echo "" >> $out
197
198        cat $tout >> $out
199}
200
201. common.sh
202
203#
204# generate Sun 6.1 makefile:
205out="sunpro.mak"
206subdir="sunpro"
207sun_gen
208
209
210#
211# remove tmep files;
212rm -f $tout $iout
213
214
Note: See TracBrowser for help on using the repository browser.