| 1 | #!/bin/csh | 
|---|
| 2 | # $Id: mkmflib,v 1.3 1999-10-25 16:24:49 ansari Exp $ | 
|---|
| 3 |  | 
|---|
| 4 | cd ../$1 | 
|---|
| 5 |  | 
|---|
| 6 | if ( ! -f exclude ) touch exclude | 
|---|
| 7 | if ( ! $?TMPDIR ) set TMPDIR = /tmp | 
|---|
| 8 | sort exclude >! $TMPDIR/exclude.sort | 
|---|
| 9 |  | 
|---|
| 10 | ############################################## | 
|---|
| 11 | ########### fichier de la liste des .o ####### | 
|---|
| 12 | ############################################## | 
|---|
| 13 |  | 
|---|
| 14 | set liblist = $1.o.list | 
|---|
| 15 | rm -f $liblist | 
|---|
| 16 | ls *.{c,cc} | comm -3 -1 $TMPDIR/exclude.sort - | sed -e 's/\.cc/.o/' | sed -e 's/\.c/.o/' >> $liblist | 
|---|
| 17 | unset liblist | 
|---|
| 18 |  | 
|---|
| 19 | ############################################## | 
|---|
| 20 | ########### Creation de GNUmakefile ########## | 
|---|
| 21 | ############################################## | 
|---|
| 22 |  | 
|---|
| 23 | set libf='$(LIB)lib'$1'.a' | 
|---|
| 24 |  | 
|---|
| 25 | set hfcxxlibs = '-L$(LIB)' | 
|---|
| 26 | set i = 1 | 
|---|
| 27 | while ($i <= $#argv) | 
|---|
| 28 | set hfcxxlibs = "$hfcxxlibs -l$argv[$i]" | 
|---|
| 29 | @ i++ | 
|---|
| 30 | end | 
|---|
| 31 |  | 
|---|
| 32 |  | 
|---|
| 33 | rm -f GNUmakefile | 
|---|
| 34 |  | 
|---|
| 35 | echo 'include ../Mgr/Makefile.h' >> GNUmakefile | 
|---|
| 36 |  | 
|---|
| 37 | echo " " >> GNUmakefile | 
|---|
| 38 | echo 'all:' $libf  >> GNUmakefile | 
|---|
| 39 |  | 
|---|
| 40 | echo 'clean:' >> GNUmakefile | 
|---|
| 41 | set toto='rm -f' | 
|---|
| 42 | foreach f (*.cc *.c) | 
|---|
| 43 | set toto= ( $toto '$(OBJ)'$f:r.o ) | 
|---|
| 44 | end | 
|---|
| 45 | echo '  '$toto >> GNUmakefile | 
|---|
| 46 | echo '  rm -f '$libf >> GNUmakefile | 
|---|
| 47 |  | 
|---|
| 48 | echo $libf ':' \ | 
|---|
| 49 | `ls *.{c,cc} | comm -3 -1 $TMPDIR/exclude.sort - | sed -e 's/\.cc/.o/' | sed -e 's/\.c/.o/' | sed -e 's/^/$(OBJ)/'` >> GNUmakefile | 
|---|
| 50 | echo '  $(ARCXX) $(ARCXXFLAGS) $@ $?' >> GNUmakefile | 
|---|
| 51 | #  Pour faire compiler les instantiations automatique de cxx (DEC) | 
|---|
| 52 | echo 'ifeq ($(CXX),cxx)' >> GNUmakefile | 
|---|
| 53 | echo '  $(CXX) $? $(CPPFLAGS) $(CXXFLAGS)' $hfcxxlibs '-o $(OBJ)xx.x -Hf' >> GNUmakefile | 
|---|
| 54 | echo 'endif ' >> GNUmakefile | 
|---|
| 55 |  | 
|---|
| 56 | rm -f $TMPDIR/exclude.sort | 
|---|
| 57 |  | 
|---|
| 58 | echo " " >> GNUmakefile | 
|---|
| 59 |  | 
|---|
| 60 | set inc = $DPCDEVREP/Include | 
|---|
| 61 | set incxx = $inc/CxxInc | 
|---|
| 62 |  | 
|---|
| 63 | foreach f ( *.cc ) | 
|---|
| 64 | grep -q '^'$f'$' exclude && continue | 
|---|
| 65 | gcc -MM -I$inc -I$incxx $f  \ | 
|---|
| 66 | | sed -e 's/.*\.o/\$(OBJ)&/'  \ | 
|---|
| 67 | | sed -e 's?'$incxx/'?$(CXI)?g' \ | 
|---|
| 68 | | sed -e 's?'$inc/'?$(INC)?g' >> GNUmakefile | 
|---|
| 69 | end | 
|---|
| 70 |  | 
|---|
| 71 | foreach f ( *.c ) | 
|---|
| 72 | grep -q '^'$f'$' exclude && continue | 
|---|
| 73 | gcc -MM -I$inc -I$incxx $f  \ | 
|---|
| 74 | | sed -e 's/.*\.o/\$(OBJ)&/'  \ | 
|---|
| 75 | | sed -e 's?'$incxx/'?$(CXI)?g' \ | 
|---|
| 76 | | sed -e 's?'$inc/'?$(INC)?g' >> GNUmakefile | 
|---|
| 77 | end | 
|---|
| 78 |  | 
|---|
| 79 |  | 
|---|
| 80 |  | 
|---|
| 81 |  | 
|---|