source: Sophya/trunk/SophyaLib/Mgr/mkmf@ 599

Last change on this file since 599 was 554, checked in by ansari, 26 years ago

gestion des inc et lib cfitsio cmv 9/11/99

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