1 | #!/bin/csh
|
---|
2 | # $Id: mkmflib,v 1.11 2002-05-14 15:14:47 ansari Exp $
|
---|
3 |
|
---|
4 | cd ../$1
|
---|
5 |
|
---|
6 | if ( ! -f exclude ) touch exclude
|
---|
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 |
|
---|
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 | touch $liblist
|
---|
21 | ls -1 *.{c,cc} | comm -3 -1 $TMPDIR/exclude.sort - | sed -e 's/\.cc/.o/' | sed -e 's/\.c/.o/' >> $liblist
|
---|
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 |
|
---|
37 | set extlib_list = `cat extlib_list`
|
---|
38 | set hfcxxlibs = ($hfcxxlibs '-L$(EXTLIBPATH)' $extlib_list)
|
---|
39 |
|
---|
40 | rm -f GNUmakefile
|
---|
41 | touch GNUmakefile
|
---|
42 |
|
---|
43 | cat flags_compil >> GNUmakefile
|
---|
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
|
---|
55 | echo ' rm -f '$libf >> GNUmakefile
|
---|
56 |
|
---|
57 | echo $libf ':' \
|
---|
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
|
---|
59 | echo ' $(ARCXX) $(ARCXXFLAGS) $@ $($(ARARGS))' >> GNUmakefile
|
---|
60 | # Pour faire compiler les instantiations automatique de cxx (DEC)
|
---|
61 | echo 'ifeq ($(CXX),cxx)' >> GNUmakefile
|
---|
62 | #echo ' $(CXX) $? $(CPPFLAGS) $(CXXFLAGS)' $hfcxxlibs '-o $(OBJ)xx.x -Hf' >> GNUmakefile
|
---|
63 | echo ' $(CXX) $? $(CPPFLAGS) $(CXXFLAGS) -o $(OBJ)xx.x -Hf' >> GNUmakefile
|
---|
64 | echo 'endif ' >> GNUmakefile
|
---|
65 |
|
---|
66 | rm -f $TMPDIR/exclude.sort
|
---|
67 |
|
---|
68 | echo " " >> GNUmakefile
|
---|
69 |
|
---|
70 | set inc = $DPCDEVREP/Include
|
---|
71 | # set incxx = $inc/CxxInc
|
---|
72 | set incext = $EXTLIBDIR/Include
|
---|
73 | set nomsys = `uname`
|
---|
74 |
|
---|
75 | foreach f ( *.cc )
|
---|
76 | grep -q '^'$f'$' exclude && continue
|
---|
77 | gcc -MM -D$nomsys -I$inc -I$incext $f \
|
---|
78 | | sed -e 's/.*\.o/\$(OBJ)&/' \
|
---|
79 | | sed -e 's?'$inc/'?$(INC)?g' \
|
---|
80 | | sed -e 's?'$incext/'?$(EXTINCPATH)?g' >> GNUmakefile
|
---|
81 | end
|
---|
82 |
|
---|
83 | foreach f ( *.c )
|
---|
84 | grep -q '^'$f'$' exclude && continue
|
---|
85 | gcc -MM -D$nomsys -I$inc -I$incext $f \
|
---|
86 | | sed -e 's/.*\.o/\$(OBJ)&/' \
|
---|
87 | | sed -e 's?'$inc/'?$(INC)?g' \
|
---|
88 | | sed -e 's?'$incext/'?$(EXTINCPATH)?g' >> GNUmakefile
|
---|
89 | end
|
---|
90 |
|
---|
91 |
|
---|
92 |
|
---|
93 |
|
---|