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

Last change on this file since 830 was 823, checked in by ansari, 25 years ago

MAJ Makefile mkmf, etc ... Reza 06/04/2000

  • Property svn:executable set to *
File size: 2.3 KB
RevLine 
[218]1#!/bin/csh
[823]2# $Id: mkmflib,v 1.5 2000-04-06 09:50:08 ansari Exp $
[218]3
4cd ../$1
5
6if ( ! -f exclude ) touch exclude
[740]7if ( ! -f flags_compil ) touch flags_compil
8if ( ! -f extlib_list ) touch extlib_list
9if ( ! -f extslb_list ) touch extslb_list
10
[218]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
20ls *.{c,cc} | comm -3 -1 $TMPDIR/exclude.sort - | sed -e 's/\.cc/.o/' | sed -e 's/\.c/.o/' >> $liblist
21unset liblist
22
23##############################################
24########### Creation de GNUmakefile ##########
25##############################################
26
27set libf='$(LIB)lib'$1'.a'
28
29set hfcxxlibs = '-L$(LIB)'
30set i = 1
31while ($i <= $#argv)
32 set hfcxxlibs = "$hfcxxlibs -l$argv[$i]"
33 @ i++
34end
35
[740]36set extlib_list = `cat extlib_list`
37set hfcxxlibs = ($hfcxxlibs '-L$(EXTLIBPATH)' $extlib_list)
[218]38
39rm -f GNUmakefile
40
[740]41cat flags_compil >> GNUmakefile
[218]42echo 'include ../Mgr/Makefile.h' >> GNUmakefile
43
44echo " " >> GNUmakefile
45echo 'all:' $libf >> GNUmakefile
46
47echo 'clean:' >> GNUmakefile
48set toto='rm -f'
49foreach f (*.cc *.c)
50 set toto= ( $toto '$(OBJ)'$f:r.o )
51end
52echo ' '$toto >> GNUmakefile
[511]53echo ' rm -f '$libf >> GNUmakefile
[218]54
55echo $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]57echo ' $(ARCXX) $(ARCXXFLAGS) $@ $?' >> GNUmakefile
[218]58# Pour faire compiler les instantiations automatique de cxx (DEC)
59echo 'ifeq ($(CXX),cxx)' >> GNUmakefile
[823]60#echo ' $(CXX) $? $(CPPFLAGS) $(CXXFLAGS)' $hfcxxlibs '-o $(OBJ)xx.x -Hf' >> GNUmakefile
61echo ' $(CXX) $? $(CPPFLAGS) $(CXXFLAGS) -o $(OBJ)xx.x -Hf' >> GNUmakefile
[218]62echo 'endif ' >> GNUmakefile
63
64rm -f $TMPDIR/exclude.sort
65
66echo " " >> GNUmakefile
67
68set inc = $DPCDEVREP/Include
69set incxx = $inc/CxxInc
70
71foreach f ( *.cc )
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
79foreach f ( *.c )
80 grep -q '^'$f'$' exclude && continue
81 gcc -MM -I$inc -I$incxx $f \
82 | sed -e 's/.*\.o/\$(OBJ)&/' \
83 | sed -e 's?'$incxx/'?$(CXI)?g' \
84 | sed -e 's?'$inc/'?$(INC)?g' >> GNUmakefile
85end
86
87
88
89
Note: See TracBrowser for help on using the repository browser.