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