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