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