Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/regex/build/generic_gen.sh @ 29

Last change on this file since 29 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 3.2 KB
Line 
1#! /bin/bash
2
3# copyright John Maddock 2003
4# Distributed under the Boost Software License, Version 1.0.
5# (See accompanying file LICENSE_1_0.txt or copy at
6# http://www.boost.org/LICENSE_1_0.txt.
7
8libname=""
9src=""
10header=""
11all_dep=""
12
13# current makefile:
14out=""
15# temporary file:
16tout=""
17# install target temp file:
18iout=""
19# debug flag:
20debug="no"
21# compile options:
22opts=""
23# main output sub-directory:
24subdir=""
25# vcl flag:
26use_vcl="yes"
27
28
29#######################################################################
30#
31# section for generic compiler
32#
33#######################################################################
34
35
36function gen_gen_lib()
37{
38        all_dep="$all_dep $subdir $subdir/$libname ./$subdir/lib$libname.so"
39#
40# set up section comments:
41        cat >> $tout << EOF
42########################################################
43#
44# section for lib$libname.so
45#
46########################################################
47EOF
48#
49#       process source files:
50        all_obj=""
51        for file in $src
52        do
53                obj=`echo "$file" | sed 's/.*src\/\(.*\)cpp/\1o/g'`
54                obj="$subdir/$libname/$obj"
55                all_obj="$all_obj $obj"
56                echo "$obj: $file \$(ALL_HEADER)" >> $tout
57                echo "  \$(CXX) \$(INCLUDES) -o $obj $opts \$(CXXFLAGS) $file" >> $tout
58                echo "" >> $tout
59        done
60#
61#        now for the directories for this library:
62        echo "$subdir/$libname : " >> $tout
63        echo "  mkdir -p $subdir/$libname" >> $tout
64        echo "" >> $tout
65#
66#        now for the clean options for this library:
67        all_clean="$all_clean $libname""_clean"
68        echo "$libname"_clean : >> $tout
69        echo "  rm -f $subdir/$libname/*.o" >> $tout
70        echo "" >> $tout
71#
72#        now for the main target for this library:
73        echo ./$subdir/lib$libname.so : $all_obj >> $tout
74        echo "  \$(LINKER) \$(LDFLAGS) -o $subdir/lib$libname.so $all_obj \$(LIBS)" >> $tout
75        echo "" >> $tout
76}
77
78function gen_gen()
79{
80        out="generic.mak"
81        tout="temp"
82        iout="temp_install"
83        subdir="\$(DIRNAME)"
84        all_dep=""
85        all_clean=""
86        echo > $out
87        echo > $tout
88        echo > $iout
89
90        libname="boost_regex"
91        opts="\$(C1)"
92        gen_gen_lib
93       
94        cat > $out << EOF
95# copyright John Maddock 2006
96# Distributed under the Boost Software License, Version 1.0.
97# (See accompanying file LICENSE_1_0.txt or copy at
98# http://www.boost.org/LICENSE_1_0.txt.
99#
100# auto generated makefile for generic compiler
101#
102# usage:
103# make
104#   brings libraries up to date
105# make clean
106#   deletes temporary object files (but not archives).
107#
108
109#
110# the following environment variables are recognised:
111# CXXFLAGS= extra compiler options - note applies to all build variants
112# INCLUDES= additional include directories
113# LDFLAGS=  additional linker options
114# LIBS=     additional library files
115# CXX=      compiler to use
116# LINKER=   linker/archiver to use
117# name of subdirectory to use for object/archive files:
118DIRNAME=generic
119
120#
121# default compiler options for release build:
122#
123C1=-c -O2 -I../../../
124
125
126EOF
127        echo "" >> $out
128        echo "ALL_HEADER=$header" >> $out
129        echo "" >> $out
130        echo "all : $subdir $all_dep" >> $out
131        echo >> $out
132        echo "$subdir :" >> $out
133        echo "  mkdir -p $subdir" >> $out
134        echo >> $out
135        echo "clean : $all_clean" >> $out
136        echo >> $out
137        echo "install : all" >> $out
138        cat $iout >> $out
139        echo >> $out
140        cat $tout >> $out
141}
142
143. common.sh
144
145#
146# generate generic makefile:
147gen_gen
148
149#
150# remove tmep files;
151rm -f $tout $iout
152
153
154
Note: See TracBrowser for help on using the repository browser.