Changeset 740 in Sophya for trunk/SophyaLib/Mgr/mkmf
- Timestamp:
- Feb 25, 2000, 7:34:49 PM (26 years ago)
- File:
-
- 1 edited
-
trunk/SophyaLib/Mgr/mkmf (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/Mgr/mkmf
r737 r740 1 1 #!/bin/csh 2 # $Id: mkmf,v 1.7 2000-02-22 16:31:26 ansari Exp $ 3 4 # Librairie cfitsio 2 # $Id: mkmf,v 1.8 2000-02-25 18:34:48 ansari Exp $ 3 4 # Pour debugger 5 set DODBG = 'echo' 6 7 # Librairies externe 5 8 if( ! $?EXTLIBDIR ) then 6 echo 'EXTLIBDIR library: EXTLIBDIR variable need to beset'9 echo 'mkmf- WARNING (External libraries) EXTLIBDIR variable not set' 7 10 endif 8 11 … … 13 16 # creation des liens pour les includes 14 17 echo 'mkmf: Creating links for *.h (call mkmflien)' 15 ./mkmflien 18 $DODBG ./mkmflien 19 20 # Liste des modules a construire 21 # modules : Liste de module SOPHYA, sans dependance exterieure 22 # extmodules : Liste de modules avec dependance exterieures 23 # _pres : Liste des modules presents 24 25 set modules = `cat libdirs` 26 set extmodules = `cat extlibdirs` 27 set modules_pres = '' 28 set extmodules_pres = '' 29 30 set module_libnames = '' 31 set extmodule_libnames = '' 32 set extlib_list = '' 33 set extslb_list = '' 34 # Constitution de la liste de modules present 35 foreach f ($modules) 36 if (-d ../$f ) then 37 set modules_pres = ( $modules_pres $f ) 38 set module_libnames = ( $module_libnames '$(LIB)lib'$f.a ) 39 endif 40 end 41 foreach f ($extmodules) 42 if (-d ../$f ) then 43 set extmodules_pres = ( $extmodules_pres $f ) 44 set extmodule_libnames = ( $extmodule_libnames '$(LIB)lib'$f.a ) 45 set lil = "../$f/extlib_list" 46 if (-f $lil ) set extlib_list = ($extlib_list `sed -e 's/.*/-l&/' $lil`) 47 set lil = "../$f/extslb_list" 48 if (-f $lil ) set extslb_list = ($extslb_list `sed -e 's/.*/-l&/' $lil`) 49 endif 50 end 51 52 echo 'mkmf: List of modules ' 53 echo ' ... modules= ' $modules_pres 54 echo $module_libnames 55 echo ' ... extmodules= ' $extmodules_pres 56 echo $extmodule_libnames 16 57 17 58 echo 'mkmf: Creating makefile global :' 18 59 rm -f GNUmakefile 19 60 61 echo '# include files defining compiler/linker options ' >> GNUmakefile 62 echo 'MODULECXXREPNAME := PI' >> GNUmakefile 20 63 echo 'include Mgr/Makefile.h' >> GNUmakefile 64 echo 'include Mgr/Makefile.slb' >> GNUmakefile 65 echo '' >> GNUmakefile 21 66 22 67 echo 'LIBF = ' `sed -e 's/.*/$(LIB)lib&.a/' libdirs` >> GNUmakefile … … 31 76 defaut: libs 32 77 33 all: libs PI 34 78 all: libs extlibs PI 35 79 36 80 libs: cxxlibs 81 82 extlibs: cxxextlibs 83 84 EOF 85 37 86 # Dans cet ordre pour les templates de cxx, a cause des dependances 38 87 # pour instantiation automatique/manuels 39 88 40 cxxlibs: FitsIOServer SkyT Samba NTools SysTools Blitz 41 42 EOF 89 echo 'cxxlibs: ' $modules_pres >> GNUmakefile 90 echo ' ' >> GNUmakefile 91 echo 'cxxextlibs: ' $extmodules_pres >> GNUmakefile 43 92 44 93 45 94 # Attention, ne pas changer l'ordre de libnames dependances cxx 46 set libnames = ( FitsIOServer SkyT Samba NTools SysTools Blitz)95 set libnames = ($modules_pres $extmodules_pres) 47 96 set i = 1 48 97 set j = $#libnames ; @ j-- … … 54 103 echo "mkmf: Creation makefile lib $f" 55 104 echo " execution $cmd" 56 $ cmd105 $DODBG $cmd 57 106 endif 58 107 echo '.PHONY: ' $f >> GNUmakefile … … 68 117 echo "mkmf: Creation makefile lib PI" 69 118 echo " execution $cmd" 70 $ cmd119 $DODBG $cmd 71 120 endif 72 121 if ( -d ../PIext ) then 73 set cmd = './mkmfPI PIext SysTools NTools Samba SkyT PI'122 set cmd = "./mkmfPI PIext $libnames PI" 74 123 echo "mkmf: Creation makefile lib PIext" 75 124 echo " execution $cmd" 76 $ cmd125 $DODBG $cmd 77 126 endif 78 127 echo '.PHONY: PI' >> GNUmakefile … … 81 130 echo ' if [ -d PIext ] ; then cd PIext ; $(MAKE) ; fi' >> GNUmakefile 82 131 83 cat Makefile.slb >> GNUmakefile 132 133 134 echo '# Shared library creation part of the Makefile' >> GNUmakefile 135 echo ' ' >> GNUmakefile 136 echo '# List of libraries (.a)' >> GNUmakefile 137 echo 'PSLB = ' $module_libnames >> GNUmakefile 138 echo 'EXTPSLB = ' $extmodule_libnames >> GNUmakefile 139 echo 'PIPSLB = $(LIB)libPI.a $(LIB)libPIext.a' >> GNUmakefile 140 echo '# List of external library references' >> GNUmakefile 141 echo 'EXTLIB = -L$(EXTLIBPATH)' $extlib_list >> GNUmakefile 142 echo 'EXTSLB = -L$(EXTSLBPATH)' $extlib_list >> GNUmakefile 143 echo 'XPILIBS = $(LIBXPIPATH) $(LIBXPILIST)' >> GNUmakefile 144 echo '' >> GNUmakefile 145 echo '# main dependence list' >> GNUmakefile 146 echo 'slball : slb slbext slbpi ' >> GNUmakefile 147 echo 'slb : $(SLB)libsophya.so ' >> GNUmakefile 148 echo 'slbext : $(SLB)libextsophya.so ' >> GNUmakefile 149 echo 'slbpi : $(SLB)libPI.so' >> GNUmakefile 150 echo ' ' >> GNUmakefile 151 152 echo '# List of .o files for each module' >> GNUmakefile 153 set objalls = '' 154 foreach f ($modules_pres) 155 echo 'OBJ'$f '= $(shell echo' '`cat' "./$f/$f.o.list" '`)' >> GNUmakefile 156 set objalls = ( $objalls '$(OBJ'$f')' ) 157 end 158 echo 'ALLOBJS =' $objalls >> GNUmakefile 159 echo ' ' >> GNUmakefile 160 161 echo '# List of .o files modules with reference to external libraries' >> GNUmakefile 162 set objalls = '' 163 foreach f ($extmodules_pres) 164 echo 'OBJ'$f '= $(shell echo' '`cat' "./$f/$f.o.list" '`)' >> GNUmakefile 165 set objalls = ( $objalls '$(OBJ'$f')' ) 166 end 167 echo 'ALLEXTOBJS =' $objalls >> GNUmakefile 168 echo ' ' >> GNUmakefile 169 170 echo '# List of .o files for PI modules ' >> GNUmakefile 171 set objalls = '' 172 foreach f (PI PIext) 173 echo 'OBJ'$f '= $(shell echo' '`cat' "./$f/$f.o.list" '`)' >> GNUmakefile 174 set objalls = ( $objalls '$(OBJ'$f')' ) 175 end 176 echo 'ALLPIOBJS =' $objalls >> GNUmakefile 177 echo ' ' >> GNUmakefile 178 179 echo '# Building Sophya shared library' >> GNUmakefile 180 echo '$(SLB)libsophya.so : $(PSLB)' >> GNUmakefile 181 echo ' $(CMDTILSHL) ' >> GNUmakefile 182 echo ' cd $(OBJ); \' >> GNUmakefile 183 echo ' $(CMDSHLCXX) -o $(SLB)libsophya.so \' >> GNUmakefile 184 echo ' $(FGSHLACXX) $(ALLOBJS) $(FGSHLNCXX)\' >> GNUmakefile 185 echo ' -L$(SLB) $(LIBLSHL)' >> GNUmakefile 186 echo ' ' >> GNUmakefile 187 188 echo '# Building ExtSophya shared library' >> GNUmakefile 189 echo '$(SLB)libextsophya.so : $(EXTPSLB)' >> GNUmakefile 190 echo ' $(CMDTILSHL) ' >> GNUmakefile 191 echo ' cd $(OBJ); \' >> GNUmakefile 192 echo ' $(CMDSHLCXX) -o $(SLB)libextsophya.so \' >> GNUmakefile 193 echo ' $(FGSHLACXX) $(ALLEXTOBJS) $(FGSHLNCXX)\' >> GNUmakefile 194 echo ' -L$(SLB) -lsophya $(EXTSLB) $(LIBLSHL)' >> GNUmakefile 195 echo ' ' >> GNUmakefile 196 197 echo '# Building PI shared library' >> GNUmakefile 198 echo '$(SLB)libPI.so : $(PIPSLB)' >> GNUmakefile 199 echo ' $(CMDTILSHL) ' >> GNUmakefile 200 echo ' cd $(OBJ); \' >> GNUmakefile 201 echo ' $(CMDSHLCXX) -o $(SLB)libPI.so \' >> GNUmakefile 202 echo ' $(FGSHLACXX) $(ALLPIOBJS) $(FGSHLNCXX) \' >> GNUmakefile 203 echo ' -L$(SLB) -lsophya -lextsophya $(EXTSLB) $(XPILIBS) $(LIBLSHL)' >> GNUmakefile 204 echo ' ' >> GNUmakefile 205 84 206 85 207 cat >> GNUmakefile << __END__ … … 88 210 if [ -d \$(LIB) ] ; then cd \$(LIB)/. ; rm -f *.a ; fi 89 211 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 212 if [ -d \$(OBJ) ] ; then cd \$(OBJ)/. ; rm -f *.o rm -rf cxxrep* ; fi 213 # if [ -d PI ] ; then cd PI/. ; \$(MAKE) clean ; fi 93 214 94 215 __END__
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/PI/chrome/site/your_project_logo.png)