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

Last change on this file since 3871 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: 2.5 KB
Line 
1#!/bin/csh
2# $Id: mkmflib,v 1.12 2003-09-17 12:19:26 cmv Exp $
3
4cd ../$1
5
6if ( ! -f exclude ) touch exclude
7if ( ! -f flags_compil ) touch flags_compil
8if ( ! -f extlib_list ) touch extlib_list
9if ( ! -f extslb_list ) touch extslb_list
10
11if ( ! $?TMPDIR ) set TMPDIR = /tmp
12sort exclude >! $TMPDIR/exclude.sort
13
14##############################################
15########### fichier de la liste des .o #######
16##############################################
17
18set liblist = $1.o.list
19rm -f $liblist
20touch $liblist
21ls -1 *.{c,cc} | comm -3 -1 $TMPDIR/exclude.sort - | sed -e 's/\.cc/.o/' | sed -e 's/\.c/.o/' >> $liblist
22unset liblist
23
24##############################################
25########### Creation de GNUmakefile ##########
26##############################################
27
28set libf='$(LIB)lib'$1'.a'
29
30set hfcxxlibs = '-L$(LIB)'
31set i = 1
32while ($i <= $#argv)
33 set hfcxxlibs = "$hfcxxlibs -l$argv[$i]"
34 @ i++
35end
36
37set extlib_list = `cat extlib_list`
38set hfcxxlibs = ($hfcxxlibs '-L$(EXTLIBPATH)' $extlib_list)
39
40rm -f GNUmakefile
41touch GNUmakefile
42
43cat flags_compil >> GNUmakefile
44echo 'include ../Mgr/Makefile.h' >> GNUmakefile
45
46echo " " >> GNUmakefile
47echo 'all:' $libf >> GNUmakefile
48
49echo 'clean:' >> GNUmakefile
50set toto='rm -f'
51foreach f (*.cc *.c)
52 set toto= ( $toto '$(OBJ)'$f:r.o )
53end
54echo ' '$toto >> GNUmakefile
55echo ' rm -f '$libf >> GNUmakefile
56
57echo $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
59echo ' $(ARCXX) $(ARCXXFLAGS) $@ $($(ARARGS))' >> GNUmakefile
60# Pour faire compiler les instantiations automatique de cxx (DEC)
61echo 'ifeq ($(CXX),cxx)' >> GNUmakefile
62#echo ' $(CXX) $? $(CPPFLAGS) $(CXXFLAGS)' $hfcxxlibs '-o $(OBJ)xx.x -Hf' >> GNUmakefile
63echo ' $(CXX) $? $(CPPFLAGS) $(CXXFLAGS) -o $(OBJ)xx.x -Hf' >> GNUmakefile
64echo 'endif ' >> GNUmakefile
65
66rm -f $TMPDIR/exclude.sort
67
68echo " " >> GNUmakefile
69
70set inc = $SOPHYADEVREP/Include
71# set incxx = $inc/CxxInc
72set incext = $EXTLIBDIR/Include
73set nomsys = `uname`
74
75foreach 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
81end
82
83foreach 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
89end
90
91
92
93
Note: See TracBrowser for help on using the repository browser.