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

Last change on this file since 1036 was 911, checked in by ansari, 25 years ago

Nouveaux flags (SOPHYA_DEBUG,_SGI64) et correction mkmfxxx - Reza 13/4/2000

  • Property svn:executable set to *
File size: 2.4 KB
Line 
1#!/bin/csh
2# $Id: mkmflib,v 1.8 2000-04-13 15:56:03 ansari 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
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
36set extlib_list = `cat extlib_list`
37set hfcxxlibs = ($hfcxxlibs '-L$(EXTLIBPATH)' $extlib_list)
38
39rm -f GNUmakefile
40
41cat flags_compil >> GNUmakefile
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
53echo ' rm -f '$libf >> GNUmakefile
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
57echo ' $(ARCXX) $(ARCXXFLAGS) $@ $?' >> GNUmakefile
58# Pour faire compiler les instantiations automatique de cxx (DEC)
59echo 'ifeq ($(CXX),cxx)' >> GNUmakefile
60#echo ' $(CXX) $? $(CPPFLAGS) $(CXXFLAGS)' $hfcxxlibs '-o $(OBJ)xx.x -Hf' >> GNUmakefile
61echo ' $(CXX) $? $(CPPFLAGS) $(CXXFLAGS) -o $(OBJ)xx.x -Hf' >> GNUmakefile
62echo 'endif ' >> GNUmakefile
63
64rm -f $TMPDIR/exclude.sort
65
66echo " " >> GNUmakefile
67
68set inc = $DPCDEVREP/Include
69# set incxx = $inc/CxxInc
70set incext = $EXTLIBDIR/Include
71set nomsys = `uname`
72
73foreach f ( *.cc )
74 grep -q '^'$f'$' exclude && continue
75 gcc -MM -D$nomsys -I$inc -I$incext $f \
76 | sed -e 's/.*\.o/\$(OBJ)&/' \
77 | sed -e 's?'$inc/'?$(INC)?g' \
78 | sed -e 's?'$incext/'?$(EXTINCPATH)?g' >> GNUmakefile
79end
80
81foreach f ( *.c )
82 grep -q '^'$f'$' exclude && continue
83 gcc -MM -D$nomsys -I$inc -I$incext $f \
84 | sed -e 's/.*\.o/\$(OBJ)&/' \
85 | sed -e 's?'$inc/'?$(INC)?g' \
86 | sed -e 's?'$incext/'?$(EXTINCPATH)?g' >> GNUmakefile
87end
88
89
90
91
Note: See TracBrowser for help on using the repository browser.