source: Sophya/trunk/SophyaLib/Mgr/mkmflib_save@ 3818

Last change on this file since 3818 was 2437, checked in by cmv, 22 years ago

chgt DPC...REP en SOPHYA...REP et EROSCXX en SOPHYACXX cmv 17/09/2003

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/bin/csh
2# $Id: mkmflib_save,v 1.3 2003-09-17 12:19:26 cmv Exp $
3
4cd ../$1
5set libf='$(LIB)lib'$1'.a'
6
7set hfcxxlibs = '-L$(LIB)'
8set i = 1
9while ($i <= $#argv)
10 set hfcxxlibs = "$hfcxxlibs -l$argv[$i]"
11 @ i++
12end
13
14
15rm -f GNUmakefile
16
17echo 'include ../Mgr/Makefile.h' >> GNUmakefile
18
19echo " " >> GNUmakefile
20echo 'all:' $libf >> GNUmakefile
21
22echo 'clean:' >> GNUmakefile
23set toto='rm -f'
24foreach f (*.cc *.c)
25 set toto= ( $toto '$(OBJ)'$f:r.o )
26end
27echo ' '$toto >> GNUmakefile
28echo ' rm -f '$libf >> GNUmakefile
29
30if ( ! -f exclude ) touch exclude
31if ( ! $?TMPDIR ) set TMPDIR = /tmp
32sort exclude >! $TMPDIR/exclude.sort
33
34echo $libf ':' \
35 `ls *.{c,cc} | comm -3 -1 $TMPDIR/exclude.sort - | sed -e 's/\.cc/.o/' | sed -e 's/\.c/.o/' | sed -e 's/^/$(OBJ)/'` >> GNUmakefile
36echo ' $(AR) $(ARFLAGS) $@ $?' >> GNUmakefile
37# Pour faire compiler les instantiations automatique de cxx (DEC)
38echo 'ifeq ($(CXX),cxx)' >> GNUmakefile
39echo ' $(CXX) $? $(CPPFLAGS) $(CXXFLAGS)' $hfcxxlibs '-o $(OBJ)xx.x -Hf' >> GNUmakefile
40echo 'endif ' >> GNUmakefile
41
42rm -f $TMPDIR/exclude.sort
43
44echo " " >> GNUmakefile
45
46set inc = $SOPHYADEVREP/Include
47set incxx = $inc/CxxInc
48
49foreach f ( *.cc )
50 grep -q '^'$f'$' exclude && continue
51 gcc -MM -I$inc -I$incxx $f \
52 | sed -e 's/.*\.o/\$(OBJ)&/' \
53 | sed -e 's?'$incxx/'?$(CXI)?g' \
54 | sed -e 's?'$inc/'?$(INC)?g' >> GNUmakefile
55end
56
57foreach f ( *.c )
58 grep -q '^'$f'$' exclude && continue
59 gcc -MM -I$inc -I$incxx $f \
60 | sed -e 's/.*\.o/\$(OBJ)&/' \
61 | sed -e 's?'$incxx/'?$(CXI)?g' \
62 | sed -e 's?'$inc/'?$(INC)?g' >> GNUmakefile
63end
64
65
66
67
Note: See TracBrowser for help on using the repository browser.