| [218] | 1 | #!/bin/csh
 | 
|---|
| [740] | 2 | # $Id: mkmflib,v 1.4 2000-02-25 18:34:49 ansari 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
 | 
|---|
 | 20 | ls *.{c,cc} | comm -3 -1 $TMPDIR/exclude.sort - | sed -e 's/\.cc/.o/' | sed -e 's/\.c/.o/' >> $liblist
 | 
|---|
 | 21 | unset liblist
 | 
|---|
 | 22 | 
 | 
|---|
 | 23 | ##############################################
 | 
|---|
 | 24 | ########### Creation de GNUmakefile ##########
 | 
|---|
 | 25 | ##############################################
 | 
|---|
 | 26 | 
 | 
|---|
 | 27 | set libf='$(LIB)lib'$1'.a'
 | 
|---|
 | 28 | 
 | 
|---|
 | 29 | set hfcxxlibs = '-L$(LIB)' 
 | 
|---|
 | 30 | set i = 1
 | 
|---|
 | 31 | while ($i <= $#argv)
 | 
|---|
 | 32 |   set hfcxxlibs = "$hfcxxlibs -l$argv[$i]"
 | 
|---|
 | 33 |   @ i++
 | 
|---|
 | 34 | end
 | 
|---|
 | 35 | 
 | 
|---|
| [740] | 36 | set extlib_list = `cat extlib_list`
 | 
|---|
 | 37 | set hfcxxlibs = ($hfcxxlibs '-L$(EXTLIBPATH)' $extlib_list)
 | 
|---|
| [218] | 38 | 
 | 
|---|
 | 39 | rm -f GNUmakefile
 | 
|---|
 | 40 | 
 | 
|---|
| [740] | 41 | cat flags_compil >> GNUmakefile 
 | 
|---|
| [218] | 42 | echo 'include ../Mgr/Makefile.h' >> GNUmakefile 
 | 
|---|
 | 43 | 
 | 
|---|
 | 44 | echo " " >> GNUmakefile
 | 
|---|
 | 45 | echo 'all:' $libf  >> GNUmakefile 
 | 
|---|
 | 46 | 
 | 
|---|
 | 47 | echo 'clean:' >> GNUmakefile
 | 
|---|
 | 48 | set toto='rm -f'
 | 
|---|
 | 49 | foreach f (*.cc *.c) 
 | 
|---|
 | 50 |   set toto= ( $toto '$(OBJ)'$f:r.o )
 | 
|---|
 | 51 | end
 | 
|---|
 | 52 | echo '  '$toto >> GNUmakefile
 | 
|---|
| [511] | 53 | echo '  rm -f '$libf >> GNUmakefile
 | 
|---|
| [218] | 54 | 
 | 
|---|
 | 55 | echo $libf ':' \
 | 
|---|
 | 56 |  `ls *.{c,cc} | comm -3 -1 $TMPDIR/exclude.sort - | sed -e 's/\.cc/.o/' | sed -e 's/\.c/.o/' | sed -e 's/^/$(OBJ)/'` >> GNUmakefile
 | 
|---|
| [480] | 57 | echo '  $(ARCXX) $(ARCXXFLAGS) $@ $?' >> GNUmakefile
 | 
|---|
| [218] | 58 | #  Pour faire compiler les instantiations automatique de cxx (DEC)
 | 
|---|
 | 59 | echo 'ifeq ($(CXX),cxx)' >> GNUmakefile
 | 
|---|
 | 60 | echo '  $(CXX) $? $(CPPFLAGS) $(CXXFLAGS)' $hfcxxlibs '-o $(OBJ)xx.x -Hf' >> GNUmakefile
 | 
|---|
 | 61 | echo 'endif ' >> GNUmakefile
 | 
|---|
 | 62 | 
 | 
|---|
 | 63 | rm -f $TMPDIR/exclude.sort
 | 
|---|
 | 64 | 
 | 
|---|
 | 65 | echo " " >> GNUmakefile
 | 
|---|
 | 66 | 
 | 
|---|
 | 67 | set inc = $DPCDEVREP/Include
 | 
|---|
 | 68 | set incxx = $inc/CxxInc
 | 
|---|
 | 69 | 
 | 
|---|
 | 70 | foreach f ( *.cc )
 | 
|---|
 | 71 |   grep -q '^'$f'$' exclude && continue
 | 
|---|
 | 72 |   gcc -MM -I$inc -I$incxx $f  \
 | 
|---|
 | 73 |        | sed -e 's/.*\.o/\$(OBJ)&/'  \
 | 
|---|
 | 74 |        | sed -e 's?'$incxx/'?$(CXI)?g' \
 | 
|---|
 | 75 |        | sed -e 's?'$inc/'?$(INC)?g' >> GNUmakefile
 | 
|---|
 | 76 | end
 | 
|---|
 | 77 | 
 | 
|---|
 | 78 | foreach f ( *.c )
 | 
|---|
 | 79 |   grep -q '^'$f'$' exclude && continue
 | 
|---|
 | 80 |   gcc -MM -I$inc -I$incxx $f  \
 | 
|---|
 | 81 |        | sed -e 's/.*\.o/\$(OBJ)&/'  \
 | 
|---|
 | 82 |        | sed -e 's?'$incxx/'?$(CXI)?g' \
 | 
|---|
 | 83 |        | sed -e 's?'$inc/'?$(INC)?g' >> GNUmakefile
 | 
|---|
 | 84 | end 
 | 
|---|
 | 85 | 
 | 
|---|
 | 86 | 
 | 
|---|
 | 87 | 
 | 
|---|
 | 88 | 
 | 
|---|