source: Sophya/trunk/SophyaLib/Mgr/mkmflib@ 599

Last change on this file since 599 was 511, checked in by ansari, 26 years ago

rm -f ....a sinon makefile plante si ....a n'est pas la cmv 25/10/99

  • Property svn:executable set to *
File size: 2.0 KB
Line 
1#!/bin/csh
2# $Id: mkmflib,v 1.3 1999-10-25 16:24:49 ansari Exp $
3
4cd ../$1
5
6if ( ! -f exclude ) touch exclude
7if ( ! $?TMPDIR ) set TMPDIR = /tmp
8sort exclude >! $TMPDIR/exclude.sort
9
10##############################################
11########### fichier de la liste des .o #######
12##############################################
13
14set liblist = $1.o.list
15rm -f $liblist
16ls *.{c,cc} | comm -3 -1 $TMPDIR/exclude.sort - | sed -e 's/\.cc/.o/' | sed -e 's/\.c/.o/' >> $liblist
17unset liblist
18
19##############################################
20########### Creation de GNUmakefile ##########
21##############################################
22
23set libf='$(LIB)lib'$1'.a'
24
25set hfcxxlibs = '-L$(LIB)'
26set i = 1
27while ($i <= $#argv)
28 set hfcxxlibs = "$hfcxxlibs -l$argv[$i]"
29 @ i++
30end
31
32
33rm -f GNUmakefile
34
35echo 'include ../Mgr/Makefile.h' >> GNUmakefile
36
37echo " " >> GNUmakefile
38echo 'all:' $libf >> GNUmakefile
39
40echo 'clean:' >> GNUmakefile
41set toto='rm -f'
42foreach f (*.cc *.c)
43 set toto= ( $toto '$(OBJ)'$f:r.o )
44end
45echo ' '$toto >> GNUmakefile
46echo ' rm -f '$libf >> GNUmakefile
47
48echo $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
50echo ' $(ARCXX) $(ARCXXFLAGS) $@ $?' >> GNUmakefile
51# Pour faire compiler les instantiations automatique de cxx (DEC)
52echo 'ifeq ($(CXX),cxx)' >> GNUmakefile
53echo ' $(CXX) $? $(CPPFLAGS) $(CXXFLAGS)' $hfcxxlibs '-o $(OBJ)xx.x -Hf' >> GNUmakefile
54echo 'endif ' >> GNUmakefile
55
56rm -f $TMPDIR/exclude.sort
57
58echo " " >> GNUmakefile
59
60set inc = $DPCDEVREP/Include
61set incxx = $inc/CxxInc
62
63foreach 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
69end
70
71foreach 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
77end
78
79
80
81
Note: See TracBrowser for help on using the repository browser.