[218] | 1 | #!/bin/csh
|
---|
[226] | 2 | # $Id: mkmf,v 1.2 1999-04-13 15:11:11 ansari Exp $
|
---|
[218] | 3 |
|
---|
| 4 | # creation de MakefileUser.h a partir de Makefile.h
|
---|
| 5 | echo 'mkmf: Creation de MakefileUser.h'
|
---|
| 6 | cat Makefile.h | awk -f makefileuser.awk >! MakefileUser.h
|
---|
| 7 |
|
---|
| 8 | # creation des liens pour les includes
|
---|
| 9 | echo 'mkmf: Creation des liens (appel mkmflien)'
|
---|
| 10 | ./mkmflien
|
---|
| 11 |
|
---|
| 12 | echo 'mkmf: Creation makefile global :'
|
---|
| 13 | rm -f GNUmakefile
|
---|
| 14 |
|
---|
| 15 | echo 'include Mgr/Makefile.h' >> GNUmakefile
|
---|
| 16 |
|
---|
| 17 | echo 'LIBF = ' `sed -e 's/.*/$(LIB)lib&.a/' libdirs` >> GNUmakefile
|
---|
| 18 | echo 'LIBS = -L$(LIB)' `sed -e 's/.*/-l&/' libdirs` '-lm' >> GNUmakefile
|
---|
| 19 | echo 'LIBG = -L$(GLB) -lstdc++' >> GNUmakefile
|
---|
| 20 |
|
---|
| 21 | cat >> GNUmakefile <<EOF
|
---|
| 22 |
|
---|
| 23 | defaut: libs
|
---|
| 24 |
|
---|
| 25 | all: libs PI
|
---|
| 26 |
|
---|
| 27 |
|
---|
| 28 | libs: cxxlibs
|
---|
| 29 | # Dans cet ordre pour les templates de cxx, a cause des dependances
|
---|
| 30 | # pour instantiation automatique/manuels
|
---|
| 31 |
|
---|
[226] | 32 | cxxlibs: Blitz SysTools NTools Samba
|
---|
[218] | 33 |
|
---|
| 34 | EOF
|
---|
| 35 |
|
---|
| 36 |
|
---|
| 37 | # Attention, ne pas changer l'ordre de libnames dependances cxx
|
---|
[226] | 38 | set libnames = (Blitz SysTools NTools Samba)
|
---|
[218] | 39 | set i = 1
|
---|
| 40 | set j = $#libnames ; @ j--
|
---|
| 41 | while ($i <= $#libnames)
|
---|
| 42 | set f = $libnames[$i]
|
---|
| 43 | set k = $i ; @ k++
|
---|
| 44 | if ( -d ../$f ) then
|
---|
| 45 | set cmd = "./mkmflib $f $libnames[$k-$j]"
|
---|
| 46 | echo "mkmf: Creation makefile lib $f"
|
---|
| 47 | echo " execution $cmd"
|
---|
| 48 | $cmd
|
---|
| 49 | endif
|
---|
| 50 | echo '.PHONY: ' $f >> GNUmakefile
|
---|
| 51 | echo $f':' >> GNUmakefile
|
---|
| 52 | echo ' if [ -d '$f' ] ; then cd ' $f '; $(MAKE) ; fi' >> GNUmakefile
|
---|
| 53 | echo ' ' >> GNUmakefile
|
---|
| 54 | @ i++
|
---|
| 55 | end
|
---|
| 56 |
|
---|
| 57 |
|
---|
| 58 | if ( -d ../PI ) then
|
---|
| 59 | set cmd = './mkmfPI PI SysTools'
|
---|
| 60 | echo "mkmf: Creation makefile lib PI"
|
---|
| 61 | echo " execution $cmd"
|
---|
| 62 | $cmd
|
---|
| 63 | endif
|
---|
| 64 | if ( -d ../PIext ) then
|
---|
| 65 | set cmd = './mkmfPI PIext SysTools NTools PI'
|
---|
| 66 | echo "mkmf: Creation makefile lib PIext"
|
---|
| 67 | echo " execution $cmd"
|
---|
| 68 | $cmd
|
---|
| 69 | endif
|
---|
| 70 | echo '.PHONY: PI' >> GNUmakefile
|
---|
| 71 | echo 'PI:' >> GNUmakefile
|
---|
| 72 | echo ' if [ -d PI ] ; then cd PI ; $(MAKE) ; fi' >> GNUmakefile
|
---|
| 73 | echo ' if [ -d PIext ] ; then cd PIext ; $(MAKE) ; fi' >> GNUmakefile
|
---|
| 74 |
|
---|
| 75 | cat Makefile.slb >> GNUmakefile
|
---|
| 76 |
|
---|
| 77 | cat >> GNUmakefile << __END__
|
---|
| 78 |
|
---|
| 79 | clean:
|
---|
| 80 | if [ -d \$(LIB) ] ; then cd \$(LIB)/. ; rm -f *.a ; fi
|
---|
| 81 | if [ -d \$(SLB) ] ; then cd \$(SLB)/. ; rm -f *.so ; fi
|
---|
| 82 | if [ -d \$(OBJ) ] ; then cd \$(OBJ)/. ; rm -f *.o ; fi
|
---|
| 83 | if [ -d \$(OBJ)/cxxrep ] ; then cd \$(OBJ)/cxxrep/. ; rm -f *.o ; fi
|
---|
| 84 | if [ -d PI ] ; then cd PI/. ; \$(MAKE) clean ; fi
|
---|
| 85 |
|
---|
| 86 | __END__
|
---|
| 87 |
|
---|
| 88 | mv GNUmakefile ../GNUmakefile
|
---|
| 89 |
|
---|
| 90 | echo '*** mkmf done ***'
|
---|
| 91 |
|
---|