| 1 | srcdir = @srcdir@
 | 
|---|
| 2 | #VPATH = @srcdir@
 | 
|---|
| 3 | INSTALL = @INSTALL@
 | 
|---|
| 4 | prefix = @prefix@
 | 
|---|
| 5 | exec_prefix = @exec_prefix@
 | 
|---|
| 6 | bindir = @bindir@
 | 
|---|
| 7 | libdir = @libdir@
 | 
|---|
| 8 | CXX=@CXX@
 | 
|---|
| 9 | AR=@AR@
 | 
|---|
| 10 | ARFLAGS=@ARFLAGS@
 | 
|---|
| 11 | LIBS=@LIBS@
 | 
|---|
| 12 | CXXFLAGS=-O -g
 | 
|---|
| 13 | CFLAGS=-O -g
 | 
|---|
| 14 | 
 | 
|---|
| 15 | USE_SOPHYA=@use_sophya@
 | 
|---|
| 16 | 
 | 
|---|
| 17 | MACHEROS := $(shell echo `uname`)
 | 
|---|
| 18 | MACHDIR := $(MACHEROS)-$(CXX)
 | 
|---|
| 19 | 
 | 
|---|
| 20 | 
 | 
|---|
| 21 | ifeq ($(USE_SOPHYA),1) 
 | 
|---|
| 22 |  include $(DPCBASEREP)/Include/MakefileUser.h
 | 
|---|
| 23 | 
 | 
|---|
| 24 |  ifdef NOSHLIB
 | 
|---|
| 25 |   LIBF =  $(LIB)libSysTools.a $(LIB)libNTools.a $(LIB)libBlitz.a $(LIB)libFitsIOServer.a
 | 
|---|
| 26 |   LIBS :=  -L$(LIB)  -lSysTools -lNTools -lBlitz  $(LIBS)
 | 
|---|
| 27 |   ifeq ($(CXX),cxx)
 | 
|---|
| 28 |    # librairie des instances de templates cxx
 | 
|---|
| 29 |    LIBS := $(LIBS) -lrt
 | 
|---|
| 30 |   endif
 | 
|---|
| 31 |  else
 | 
|---|
| 32 |   LIBF =  $(SLB)libsophya.so 
 | 
|---|
| 33 |   LIBS := -L$(SLB)  -lextsophya -lsophya $(LIBS)
 | 
|---|
| 34 |   ifeq ($(MACHEROS),OSF1)
 | 
|---|
| 35 |    LIBS := $(LIBS) -lfor
 | 
|---|
| 36 |   endif
 | 
|---|
| 37 |  endif
 | 
|---|
| 38 |  
 | 
|---|
| 39 |  CPPFLAGS := -DWITH_SOPHYA $(CPPFLAGS)
 | 
|---|
| 40 | else
 | 
|---|
| 41 |  ifeq ($(CXX), cxx)
 | 
|---|
| 42 |   CXXFLAGS := -O -g -D__USE_STD_IOSTREAM
 | 
|---|
| 43 |  endif
 | 
|---|
| 44 | endif
 | 
|---|
| 45 | 
 | 
|---|
| 46 | 
 | 
|---|
| 47 | CPPFLAGS    :=  $(CPPFLAGS) @cfitsincdir@ -I. -DANSI 
 | 
|---|
| 48 | 
 | 
|---|
| 49 | LDLIBS=@cfitslibdir@ -lcfitsio $(LIBS)
 | 
|---|
| 50 | 
 | 
|---|
| 51 | ifeq ($(MACHEROS),IRIX64)
 | 
|---|
| 52 |  ifeq ($(CXX), g++)
 | 
|---|
| 53 |    LDLIBS=@cfitslibdir@ -lcfitsio -L /usr/lib32/
 | 
|---|
| 54 |  endif
 | 
|---|
| 55 |  ifeq ($(CXX), CC)
 | 
|---|
| 56 |     CXXFLAGS = -O -prelink  -64
 | 
|---|
| 57 | #    CXXFLAGS = -O -prelink -ptused -64
 | 
|---|
| 58 |     CFLAGS   = -O -64
 | 
|---|
| 59 | #   CXXFLAGS = -LANG:std -woff 1171,1174,1552 -O -OPT:Olimit=0
 | 
|---|
| 60 | #   CFLAGS  =  -O -OPT:Olimit=0
 | 
|---|
| 61 |  endif
 | 
|---|
| 62 | endif
 | 
|---|
| 63 | 
 | 
|---|
| 64 | ifeq ($(CXX), g++)
 | 
|---|
| 65 |   CC = gcc
 | 
|---|
| 66 | endif
 | 
|---|
| 67 | 
 | 
|---|
| 68 | default: build_kernel build_processors build_sophya 
 | 
|---|
| 69 |         echo "pipe libs built"
 | 
|---|
| 70 | 
 | 
|---|
| 71 | install:  default
 | 
|---|
| 72 |         mkdir -p $(libdir)
 | 
|---|
| 73 |         mkdir -p $(prefix)/include
 | 
|---|
| 74 |         cp -p Kernel/libatkern.a $(libdir)/
 | 
|---|
| 75 |         cp -p Processors/libatproc.a $(libdir)/
 | 
|---|
| 76 |         for f in $(srcdir)/Kernel/*.h $(srcdir)/Processors/*.h $(srcdir)/*.h conf.h; do \
 | 
|---|
| 77 |           $(INSTALL) $$f $(prefix)/include; \
 | 
|---|
| 78 |         done
 | 
|---|
| 79 |         if [ -f ProcWSophya/libatsop.a ]; then \
 | 
|---|
| 80 |           cp -p ProcWSophya/libatsop.a $(libdir)/; \
 | 
|---|
| 81 |           for f in $(srcdir)/ProcWSophya/*.h; do \
 | 
|---|
| 82 |             $(INSTALL) $$f $(prefix)/include; \
 | 
|---|
| 83 |           done \
 | 
|---|
| 84 |         fi
 | 
|---|
| 85 | 
 | 
|---|
| 86 | clean:
 | 
|---|
| 87 |         rm -f *.o 
 | 
|---|
| 88 |         rm -rf rii_files ii_files cxxrep cxx_repository
 | 
|---|
| 89 |         for d in Kernel Processors ProcWSophya; do \
 | 
|---|
| 90 |           if [ -d $$d ]; then \
 | 
|---|
| 91 |             cd $$d; $(MAKE) clean; \
 | 
|---|
| 92 |             cd ..; \
 | 
|---|
| 93 |           fi  \
 | 
|---|
| 94 |         done
 | 
|---|
| 95 | 
 | 
|---|
| 96 | %: $(srcdir)/TestPipes/%.cc build_kernel build_processors build_sophya
 | 
|---|
| 97 |         cd TestPipes; $(MAKE) $@
 | 
|---|
| 98 | 
 | 
|---|
| 99 | build_kernel:
 | 
|---|
| 100 |         cd Kernel; $(MAKE)
 | 
|---|
| 101 | 
 | 
|---|
| 102 | build_processors:
 | 
|---|
| 103 |         cd Processors; $(MAKE)
 | 
|---|
| 104 | 
 | 
|---|
| 105 | build_sophya:
 | 
|---|
| 106 | ifeq ($(USE_SOPHYA),1)
 | 
|---|
| 107 |         if [ -d ProcWSophya ]; then \
 | 
|---|
| 108 |           cd ProcWSophya; $(MAKE); \
 | 
|---|
| 109 |         fi 
 | 
|---|
| 110 | else
 | 
|---|
| 111 |         echo "no sophya"
 | 
|---|
| 112 | endif
 | 
|---|
| 113 | 
 | 
|---|
| 114 | ### Shared libs, repris de Sophya en attendant une integration
 | 
|---|
| 115 | ### plus propre a configure
 | 
|---|
| 116 | 
 | 
|---|
| 117 | # librairie compilateur GNU (g++)
 | 
|---|
| 118 | LIBGPP := -lstdc++
 | 
|---|
| 119 | ifeq ($(MACHEROS), Darwin)
 | 
|---|
| 120 |   LIBGPP := -L/sw/lib -ldl -L/usr/lib/gcc/darwin/default -lstdc++ -lcc_dynamic
 | 
|---|
| 121 | endif
 | 
|---|
| 122 | 
 | 
|---|
| 123 | #  External libraries
 | 
|---|
| 124 | EXTLIB := 
 | 
|---|
| 125 | EXTSLB := 
 | 
|---|
| 126 | 
 | 
|---|
| 127 | #  Commande de construction de shared-lib 
 | 
|---|
| 128 | CMDSHL := ld -partage
 | 
|---|
| 129 | #  Flag d'inclusion/fin d'inclusion de tous les points  d'entree
 | 
|---|
| 130 | FGSHLA := -tout
 | 
|---|
| 131 | FGSHLN := -rien
 | 
|---|
| 132 | #  Librairies specifiques 
 | 
|---|
| 133 | LIBLSHL := -lpthread -lm -lc
 | 
|---|
| 134 | #  Librairie d'instanciation des templates 
 | 
|---|
| 135 | TILSHL := 
 | 
|---|
| 136 | TILSHLPI := 
 | 
|---|
| 137 | #   Commande de construction de la librairie d'instanciation des templates 
 | 
|---|
| 138 | CMDTILSHL := echo 'No Template instanciation library (.a)'
 | 
|---|
| 139 | CMDTILSHLPI  := echo 'No Template instanciation library (.a)'
 | 
|---|
| 140 | # Utilisation du compilo C++ comme driver pour fabrication des shared-libs
 | 
|---|
| 141 | CMDSHLCXX := $(LINK.cc) 
 | 
|---|
| 142 | FGSHLACXX :=  
 | 
|---|
| 143 | FGSHLNCXX := 
 | 
|---|
| 144 | #  S'il faut utiliser $(CMDSHLCXX) pour fabrication des shared-libs
 | 
|---|
| 145 | USECXX4SO := Y
 | 
|---|
| 146 | # On utilise le compilo g++ pour la fabrication des shared libs
 | 
|---|
| 147 | ifeq ($(EROSCXX), g++)
 | 
|---|
| 148 |   override USECXX4SO := Y
 | 
|---|
| 149 |   override CMDSHLCXX := $(LINK.cc) -shared
 | 
|---|
| 150 |   override LIBLSHL := $(LIBGPP) $(LIBLSHL)
 | 
|---|
| 151 | endif
 | 
|---|
| 152 | 
 | 
|---|
| 153 | # On utilise le compilo KCC pour la fabrication des shared libs
 | 
|---|
| 154 | ifeq ($(EROSCXX), KCC)
 | 
|---|
| 155 |   override USECXX4SO := Y
 | 
|---|
| 156 |   override CMDSHLCXX := $(LINK.cc)
 | 
|---|
| 157 | endif
 | 
|---|
| 158 | 
 | 
|---|
| 159 | # On utilise le compilo aCC (HP) pour la fabrication des shared libs
 | 
|---|
| 160 | ifeq ($(EROSCXX), aCC)
 | 
|---|
| 161 |   override USECXX4SO := Y
 | 
|---|
| 162 |   override CMDSHLCXX := $(LINK.cc) -b
 | 
|---|
| 163 | endif
 | 
|---|
| 164 | 
 | 
|---|
| 165 | 
 | 
|---|
| 166 | # Construction de shared-libs sous OSF1
 | 
|---|
| 167 | ifeq ($(MACHEROS),OSF1)
 | 
|---|
| 168 |   override CMDSHL := ld -shared -update_registry $(SLB)so_locations
 | 
|---|
| 169 |   override FGSHLA := -all
 | 
|---|
| 170 |   override FGSHLN := -none 
 | 
|---|
| 171 | #  override LIBLSHL := -lcxxstd -lcxx -lexc -lm -lc -lrt
 | 
|---|
| 172 |   override LIBLSHL := $(LIBLSHL) -lrt
 | 
|---|
| 173 |   override TILSHL := $(LIB)libertcxx.a
 | 
|---|
| 174 |   override CMDTILSHL := rm -f $(LIB)libsotcxx.a ; cd $(REP); $(AR) $(ARFLAGS) $(LIB)libsotcxx.a *.o
 | 
|---|
| 175 |   override TILSHLPI := $(LIB)libsotcxxpi.a
 | 
|---|
| 176 |   override CMDTILSHLPI := rm -f $(LIB)libsotcxxpi.a ; cd $(REPPI); $(AR) $(ARFLAGS) $(LIB)libsotcxxpi.a *.o
 | 
|---|
| 177 |   ifeq ($(CXX),g++)
 | 
|---|
| 178 |     override TILSHL := 
 | 
|---|
| 179 |     override TILSHLPI := 
 | 
|---|
| 180 |   endif
 | 
|---|
| 181 | #  Attention - Dangereux de mettre -expect_unresolved , enleve  Reza 17/11/99
 | 
|---|
| 182 |   override CMDSHLCXX :=  $(CXX) $(CXXFLAGS) -shared 
 | 
|---|
| 183 |   override FGSHLACXX := 
 | 
|---|
| 184 |   override FGSHLNCXX := 
 | 
|---|
| 185 |   override USECXX4SO := Y
 | 
|---|
| 186 | endif
 | 
|---|
| 187 | 
 | 
|---|
| 188 | # Construction de shared-libs sous Linux
 | 
|---|
| 189 | ifeq ($(MACHEROS),Linux)
 | 
|---|
| 190 |   override CMDSHL := ld -shared 
 | 
|---|
| 191 |   override FGSHLA := --whole-archive
 | 
|---|
| 192 |   override FGSHLN := --no-whole-archiv
 | 
|---|
| 193 |   override CMDSHLCXX := $(LINK.cc) -shared 
 | 
|---|
| 194 |   ifeq ($(EROSCXX), KCC)
 | 
|---|
| 195 |     override CMDSHLCXX := $(LINK.cc)
 | 
|---|
| 196 |   endif
 | 
|---|
| 197 |   override FGSHLACXX := 
 | 
|---|
| 198 |   override FGSHLNCXX := 
 | 
|---|
| 199 |   override LIBLSHL := $(LIBLSHL) -ldl
 | 
|---|
| 200 |   override TILSHL := 
 | 
|---|
| 201 |   override LIBXPIPATH := -L/usr/X11/lib -L/usr/X11R6/lib
 | 
|---|
| 202 |   override LIBXPILIST := -lXm -lXt -lXext -lX11
 | 
|---|
| 203 | endif
 | 
|---|
| 204 | 
 | 
|---|
| 205 | # Construction de shared-libs sous Sun-OS
 | 
|---|
| 206 | ifeq ($(MACHEROS),SunOS)
 | 
|---|
| 207 |   override CMDSHL := ld -G
 | 
|---|
| 208 |   override FGSHLA := -z allextract
 | 
|---|
| 209 |   override FGSHLN := -z weakextract
 | 
|---|
| 210 |   override TILSHL := 
 | 
|---|
| 211 |   override LIBXPIPATH := -L/usr/X11/lib 
 | 
|---|
| 212 |   override USECXX4SO := Y
 | 
|---|
| 213 | endif
 | 
|---|
| 214 | 
 | 
|---|
| 215 | # Construction de shared-libs sous SGI
 | 
|---|
| 216 | ifeq ($(MACHEROS), IRIX64)
 | 
|---|
| 217 |   override CMDSHL := ld -shared
 | 
|---|
| 218 |   override FGSHLA := -all
 | 
|---|
| 219 |   override FGSHLN := -notall
 | 
|---|
| 220 |   override TILSHL := 
 | 
|---|
| 221 |   ifeq ($(EROSCXX), CC)
 | 
|---|
| 222 |     override CMDSHLCXX := CC -shared -64
 | 
|---|
| 223 |   endif
 | 
|---|
| 224 |   override LIBXPIPATH := -L/usr/X11/lib 
 | 
|---|
| 225 |   override USECXX4SO := Y
 | 
|---|
| 226 | endif
 | 
|---|
| 227 | 
 | 
|---|
| 228 | # Construction de shared-libs sous OSX
 | 
|---|
| 229 | ifeq ($(MACHEROS), Darwin)
 | 
|---|
| 230 |   override CMDSHL := libtool -dynamic
 | 
|---|
| 231 |   override FGSHLA :=
 | 
|---|
| 232 |   override FGSHLN :=
 | 
|---|
| 233 |   override TILSHL :=
 | 
|---|
| 234 |   override CMDSHLCXX := libtool -dynamic
 | 
|---|
| 235 | endif
 | 
|---|
| 236 | 
 | 
|---|
| 237 | SLBNAME = libpipe.so
 | 
|---|
| 238 | ifeq ($(MACHEROS),Darwin)
 | 
|---|
| 239 | SLBNAME = libpipe.dylib
 | 
|---|
| 240 | endif
 | 
|---|
| 241 | 
 | 
|---|
| 242 | 
 | 
|---|
| 243 | slb: $(SLBNAME)
 | 
|---|
| 244 | 
 | 
|---|
| 245 | $(SLBNAME) : build_kernel build_processors build_sophya
 | 
|---|
| 246 |         $(CMDSHLCXX) -o $(SLBNAME)  \
 | 
|---|
| 247 |         Kernel/*.o Processors/*.o ProcWSophya/*.o \
 | 
|---|
| 248 |         $(FGSHLNCXX) -L$(SLB) -lsophya -lextsophya $(EXTLIB) $(LIBLSHL)
 | 
|---|
| 249 | 
 | 
|---|
| 250 | 
 | 
|---|