]> git.saurik.com Git - wxWidgets.git/blame - install/unix/setup/general/createall
Dang, can't remember what I changed now
[wxWidgets.git] / install / unix / setup / general / createall
CommitLineData
a1a2adef
RR
1#! /bin/sh
2
0059a102
UA
3# Just grab dirbase/dir(s)
4readbase ()
5{
6 DIRBASE=$1
7 DIRCONTENTS=$2
8 for each in $DIRBASE/*
9 do
10 if test -d $each
11 then
12 DIRCONTENTS="$DIRCONTENTS $each"
13 fi
14 done
15 echo $DIRCONTENTS
16}
17
18# Prefer subdir/src over subdir, use whichever available
19readbase2 ()
20{
21 DIRBASE=$1
22 DIRCONTENTS=$2
23 for each in $DIRBASE/*
24 do
25 if test -d $each
26 then
27 if test -d $each/src
28 then
29 DIRCONTENTS="$DIRCONTENTS $each/src"
30 else
31 DIRCONTENTS="$DIRCONTENTS $each"
32 fi
33 fi
34 done
35 echo $DIRCONTENTS
36}
37
a1a2adef
RR
38OS=$OSTYPE
39
40if test "x$OS" = x; then
41 echo "please set the environment variable OSTYPE "
42 echo "to a value appropriate for your system."
43 echo "to do so type: setenv OSTYPE `uname` for the csh, tcsh"
44 echo " export OSTYPE=`uname` for other shells"
45 exit 1
46fi
47
cd53f341 48SRC_DIR=`readbase src src`
0059a102
UA
49SAMPLES_DIR=`readbase2 samples`
50UTILS_DIR=`readbase2 utils`
51USER_DIR=`readbase2 user`
a1a2adef
RR
52
53ALL_DIR="$SRC_DIR $SAMPLES_DIR $UTILS_DIR $USER_DIR"
54
55echo Creating for: $OS
56
57# create defaults
58if test ! -d install/unix/setup/$OS; then
59 mkdir install/unix/setup/$OS
60fi
61
62SUBSTFILE=install/unix/setup/$OS/substit
63
64# the substit file first
65if test -f install/unix/setup/substit ; then
66 cat install/unix/setup/substit | sed "s/*/@/g" > $SUBSTFILE;
67 rm -f install/unix/setup/substit
68fi
69# now the template file
70cat install/unix/setup/maketmpl.in | sed -f $SUBSTFILE > install/unix/setup/$OS/maketmpl
71
72# now the config header file
73#if test -f setup/wx_setup.h ; then
74# cat setup/wx_setup.h > setup/$OS/wx_setup.h;
75# rm -f setup/wx_setup.h
76#fi
77
78# create lib and bin directory
79if test ! -d lib; then
80 mkdir lib
81fi
82if test ! -d lib/$OS; then
83 mkdir lib/$OS
84fi
85if test ! -d bin; then
86 mkdir bin
87fi
88if test ! -d bin/$OS; then
89 mkdir bin/$OS
90fi
91
92# create makefiles
93for each in $ALL_DIR; do
94 DIR=$each/$OS
95 # create Makefile in directory
96 if test -r $each/Makefile.in ; then
97 # create directory
98 if test ! -d $DIR; then
99 echo "Creating Directory: $DIR..."
100 mkdir $DIR
101 fi
102 echo "Creating: $DIR/Makefile..."
103 cat $each/Makefile.in | sed -f $SUBSTFILE > $DIR/Makefile
104 (cd $DIR; make subdirs > /dev/null;)
105 fi
106done