Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

added boost

File size: 2.8 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#
26# section for generic compiler
27#
28#######################################################################
29
30
31function gen_gen_lib()
32{
33        all_dep="$all_dep $subdir $subdir/$libname ./$subdir/lib$libname.so"
34#
35# set up section comments:
36        cat >> $tout << EOF
37########################################################
38#
39# section for lib$libname.so
40#
41########################################################
42EOF
43#
44#       process source files:
45        all_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                echo "$obj: $file \$(ALL_HEADER)" >> $tout
52                echo "  \$(CXX) \$(INCLUDES) -o $obj $opts \$(CXXFLAGS) $file" >> $tout
53                echo "" >> $tout
54        done
55#
56#        now for the directories for this library:
57        echo "$subdir/$libname : " >> $tout
58        echo "  mkdir -p $subdir/$libname" >> $tout
59        echo "" >> $tout
60#
61#        now for the clean options for this library:
62        all_clean="$all_clean $libname""_clean"
63        echo "$libname"_clean : >> $tout
64        echo "  rm -f $subdir/$libname/*.o" >> $tout
65        echo "" >> $tout
66#
67#        now for the main target for this library:
68        echo ./$subdir/lib$libname.so : $all_obj >> $tout
69        echo "  \$(LINKER) \$(LDFLAGS) -o $subdir/lib$libname.so $all_obj \$(LIBS)" >> $tout
70        echo "" >> $tout
71}
72
73function gen_gen()
74{
75        out="generic.mak"
76        tout="temp"
77        iout="temp_install"
78        subdir="\$(DIRNAME)"
79        all_dep=""
80        all_clean=""
81        echo > $out
82        echo > $tout
83        echo > $iout
84
85        libname="boost_regex"
86        opts="\$(C1)"
87        gen_gen_lib
88       
89        cat > $out << EOF
90#
91# auto generated makefile for generic compiler
92#
93# usage:
94# make
95#   brings libraries up to date
96# make clean
97#   deletes temporary object files (but not archives).
98#
99
100#
101# the following environment variables are recognised:
102# CXXFLAGS= extra compiler options - note applies to all build variants
103# INCLUDES= additional include directories
104# LDFLAGS=  additional linker options
105# LIBS=     additional library files
106# CXX=      compiler to use
107# LINKER=   linker/archiver to use
108# name of subdirectory to use for object/archive files:
109DIRNAME=generic
110
111#
112# default compiler options for release build:
113#
114C1=-c -O2 -I../../../
115
116
117EOF
118        echo "" >> $out
119        echo "ALL_HEADER=$header" >> $out
120        echo "" >> $out
121        echo "all : $subdir $all_dep" >> $out
122        echo >> $out
123        echo "$subdir :" >> $out
124        echo "  mkdir -p $subdir" >> $out
125        echo >> $out
126        echo "clean : $all_clean" >> $out
127        echo >> $out
128        echo "install : all" >> $out
129        cat $iout >> $out
130        echo >> $out
131        cat $tout >> $out
132}
133
134. common.sh
135
136#
137# generate generic makefile:
138gen_gen
139
140#
141# remove tmep files;
142rm -f $tout $iout
143
144
Note: See TracBrowser for help on using the repository browser.