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