Makefile 10.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2011
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
22

23 24
include ../config.inc

25 26 27 28
############################
# LIMA - CORE
############################

ahoms's avatar
ahoms committed
29 30
CORE_LDFLAGS	:= -L../third-party/Processlib/build
CORE_LDLIBS	:= -lprocesslib
31

seb's avatar
seb committed
32 33 34 35 36
ifneq ($(COMPILE_CBF_SAVING),0)
CORE_LDFLAGS += -L../third-party/CBFLib/lib
CORE_LDLIBS += -lcbf
endif

37 38
ifneq ($(COMPILE_CORE),0)

ahoms's avatar
ahoms committed
39 40 41
name		:= core
core-objs	:= ../common/src/Common.o \
		   ../hardware/src/Hw.o \
ahoms's avatar
ahoms committed
42
		   ../control/src/Ct.o
ahoms's avatar
ahoms committed
43 44 45
version-file	:= ../common/VERSION
core-flags	:= $(CORE_LDFLAGS)
core-deps	:= $(CORE_LDLIBS)
46

ahoms's avatar
ahoms committed
47 48
full-version	:= $(shell cat $(version-file))
maj-version	:= $(shell echo $(full-version) | cut -f1 -d.)
49

ahoms's avatar
ahoms committed
50 51 52 53 54 55 56 57 58 59 60
core-base	:= liblima$(name).so
core-full	:= $(core-base).$(full-version)
core-maj	:= $(core-base).$(maj-version)
core-flags	+= -fPIC -Wl,-soname,$(core-maj)

$(core-full):		$(core-objs)
	$(CXX) -shared -o $@ $(core-flags) $+ $(core-deps)
	rm -f $(core-maj);  ln -s $(core-full) $(core-maj)
	rm -f $(core-base); ln -s $(core-maj)  $(core-base)

build_targets := $(core-full)
61 62 63

endif

ahoms's avatar
ahoms committed
64 65
LDFLAGS		:= $(CORE_LDFLAGS) -L.
LDLIBS		:= $(CORE_LDLIBS) -llimacore
66 67 68 69 70 71 72 73


############################
# LIMA - SIMULATOR
############################

ifneq ($(COMPILE_SIMULATOR),0)

ahoms's avatar
ahoms committed
74 75 76 77 78 79 80 81
name		:= simulator
simu-objs	:= ../camera/simulator/src/Simu.o
version-file	:= ../camera/simulator/VERSION
simu-flags	:= $(LDFLAGS)
simu-deps	:= $(LDLIBS)

full-version	:= $(shell cat $(version-file))
maj-version	:= $(shell echo $(full-version) | cut -f1 -d.)
82

ahoms's avatar
ahoms committed
83 84 85 86
simu-base	:= liblima$(name).so
simu-full	:= $(simu-base).$(full-version)
simu-maj	:= $(simu-base).$(maj-version)
simu-flags	+= -fPIC -Wl,-soname,$(simu-maj)
87

ahoms's avatar
ahoms committed
88 89 90 91 92 93
$(simu-full):		$(simu-objs)
	$(CXX) -shared -o $@ $(simu-flags) $+ $(simu-deps)
	rm -f $(simu-maj);  ln -s $(simu-full) $(simu-maj)
	rm -f $(simu-base); ln -s $(simu-maj)  $(simu-base)

build_targets += $(simu-full)
94 95

endif
ahoms's avatar
ahoms committed
96

97 98 99 100 101

############################
# LIMA - ESPIA
############################

102 103 104

ifneq ($(COMPILE_ESPIA),0)

105
include ../camera/common/espia/include/espia.inc
ahoms's avatar
ahoms committed
106 107
ESPIA_LDFLAGS	:= $(LDFLAGS) -L$(ESPIA_DRV_LIB)
ESPIA_LDLIBS	:= $(LDLIBS) -lespia
108

ahoms's avatar
ahoms committed
109 110 111 112 113 114 115 116
name		:= espia
espia-objs	:= ../camera/common/espia/src/Espia.o
version-file	:= ../camera/common/espia/VERSION
espia-flags	:= $(ESPIA_LDFLAGS)
espia-deps	:= $(ESPIA_LDLIBS)

full-version	:= $(shell cat $(version-file))
maj-version	:= $(shell echo $(full-version) | cut -f1 -d.)
117

ahoms's avatar
ahoms committed
118 119 120 121
espia-base	:= liblima$(name).so
espia-full	:= $(espia-base).$(full-version)
espia-maj	:= $(espia-base).$(maj-version)
espia-flags	+= -fPIC -Wl,-soname,$(espia-maj)
122

ahoms's avatar
ahoms committed
123 124 125 126 127 128
$(espia-full):		$(espia-objs)
	$(CXX) -shared -o $@ $(espia-flags) $+ $(espia-deps)
	rm -f $(espia-maj);  ln -s $(espia-full) $(espia-maj)
	rm -f $(espia-base); ln -s $(espia-maj)  $(espia-base)

build_targets += $(espia-full)
129

130 131
endif

132 133 134 135 136

############################
# LIMA - FRELON
############################

137
ifneq ($(COMPILE_FRELON),0)
138

ahoms's avatar
ahoms committed
139 140 141 142 143 144 145 146 147 148 149
FRELON_LDFLAGS	:= $(ESPIA_LDFLAGS) -L.
FRELON_LDLIBS	:= $(ESPIA_LDLIBS) -llimaespia

name		:= frelon
frelon-objs	:= ../camera/frelon/src/Frelon.o
version-file	:= ../camera/frelon/VERSION
frelon-flags	:= $(FRELON_LDFLAGS)
frelon-deps	:= $(FRELON_LDLIBS)

full-version	:= $(shell cat $(version-file))
maj-version	:= $(shell echo $(full-version) | cut -f1 -d.)
150

ahoms's avatar
ahoms committed
151 152 153 154
frelon-base	:= liblima$(name).so
frelon-full	:= $(frelon-base).$(full-version)
frelon-maj	:= $(frelon-base).$(maj-version)
frelon-flags	+= -fPIC -Wl,-soname,$(frelon-maj)
155

ahoms's avatar
ahoms committed
156 157 158 159
$(frelon-full):		$(frelon-objs)
	$(CXX) -shared -o $@ $(frelon-flags) $+ $(frelon-deps)
	rm -f $(frelon-maj);  ln -s $(frelon-full) $(frelon-maj)
	rm -f $(frelon-base); ln -s $(frelon-maj)  $(frelon-base)
160

ahoms's avatar
ahoms committed
161
build_targets += $(frelon-full)
162

163 164
endif

165 166 167 168 169

############################
# LIMA - MAXIPIX
############################

170
ifneq ($(COMPILE_MAXIPIX),0)
171

ahoms's avatar
ahoms committed
172 173 174 175 176 177 178 179 180 181 182
MAXIPIX_LDFLAGS	:= $(ESPIA_LDFLAGS) -L.
MAXIPIX_LDLIBS	:= $(ESPIA_LDLIBS) -llimaespia

name		:= maxipix
maxipix-objs	:= ../camera/maxipix/src/Maxipix.o
version-file	:= ../camera/maxipix/VERSION
maxipix-flags	:= $(MAXIPIX_LDFLAGS)
maxipix-deps	:= $(MAXIPIX_LDLIBS)

full-version	:= $(shell cat $(version-file))
maj-version	:= $(shell echo $(full-version) | cut -f1 -d.)
183

ahoms's avatar
ahoms committed
184 185 186 187
maxipix-base	:= liblima$(name).so
maxipix-full	:= $(maxipix-base).$(full-version)
maxipix-maj	:= $(maxipix-base).$(maj-version)
maxipix-flags	+= -fPIC -Wl,-soname,$(maxipix-maj)
188

ahoms's avatar
ahoms committed
189 190 191 192
$(maxipix-full):		$(maxipix-objs)
	$(CXX) -shared -o $@ $(maxipix-flags) $+ $(maxipix-deps)
	rm -f $(maxipix-maj);  ln -s $(maxipix-full) $(maxipix-maj)
	rm -f $(maxipix-base); ln -s $(maxipix-maj)  $(maxipix-base)
193

ahoms's avatar
ahoms committed
194
build_targets += $(maxipix-full)
195 196 197

endif

198 199 200 201 202 203
############################
# LIMA - BASLER
############################

ifneq ($(COMPILE_BASLER),0)

Florent Langlois's avatar
Florent Langlois committed
204 205
BASLER_LDFLAGS	:= -L. -L/opt/pylon/lib -L/opt/pylon/lib64
BASLER_LDLIBS	:= -lpylongigesupp
206 207 208 209 210 211

name		:= basler
basler-objs	:= ../camera/basler/src/Basler.o
version-file	:= ../camera/basler/VERSION
basler-flags	:= $(BASLER_LDFLAGS)
basler-deps	:= $(BASLER_LDLIBS)
Florent Langlois's avatar
Florent Langlois committed
212
basler-base	:= liblima$(name).so
213 214 215 216 217 218 219 220 221 222 223 224
full-version	:= $(shell cat $(version-file))
maj-version	:= $(shell echo $(full-version) | cut -f1 -d.)
basler-full	:= $(basler-base).$(full-version)
basler-maj	:= $(basler-base).$(maj-version)
basler-flags	+= -fPIC -Wl,-soname,$(basler-maj)

$(basler-full):		$(basler-objs)
	$(CXX) -shared -o $@ $(basler-flags) $+ $(basler-deps)
	rm -f $(basler-maj);  ln -s $(basler-full) $(basler-maj)
	rm -f $(basler-base); ln -s $(basler-maj)  $(basler-base)

build_targets += $(basler-full)
Florent Langlois's avatar
Florent Langlois committed
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
endif

############################
# LIMA - PROSILICA
############################

ifneq ($(COMPILE_PROSILICA),0)

PROCESSOR_TYPE := $(shell uname -i)
ifeq ($(PROCESSOR_TYPE),i386)
PROSILICA_LDFLAGS	:= -L. -L../camera/prosilica/sdk/bin/x86
else
PROSILICA_LDFLAGS	:= -L. -L../camera/prosilica/sdk/bin/x64 -L../camera/prosilica/sdk/bin/x86
endif
PROSILICA_LDLIBS	:= -lPvAPI

name		:= prosilica
prosilica-objs	:= ../camera/prosilica/src/Prosilica.o
version-file	:= ../camera/prosilica/VERSION
prosilica-flags	:= $(PROSILICA_LDFLAGS)
prosilica-deps	:= $(PROSILICA_LDLIBS)
full-version	:= $(shell cat $(version-file))
maj-version	:= $(shell echo $(full-version) | cut -f1 -d.)
prosilica-base	:= liblima$(name).so
prosilica-full	:= $(prosilica-base).$(full-version)
prosilica-maj	:= $(prosilica-base).$(maj-version)
prosilica-flags	+= -fPIC -Wl,-soname,$(prosilica-maj)

$(prosilica-full):		$(prosilica-objs)
	$(CXX) -shared -o $@ $(prosilica-flags) $+ $(prosilica-deps)
	rm -f $(prosilica-maj);  ln -s $(prosilica-full) $(prosilica-maj)
	rm -f $(prosilica-base); ln -s $(prosilica-maj)  $(prosilica-base)
257

Florent Langlois's avatar
Florent Langlois committed
258
build_targets += $(prosilica-full)
259 260
endif

teresa's avatar
teresa committed
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291

############################
# LIMA - ROPERSCIENTIFIC
############################

ifneq ($(COMPILE_ROPERSCIENTIFIC),0)

ROPERSCIENTIFIC_LDLIBS	:= -lpvcam -lraw1394
name		:= roperscientific
roperscientific-objs	:= ../camera/roperscientific/src/RoperScientific.o
version-file	:= ../camera/roperscientific/VERSION
roperscientific-flags	:= $(LDFLAGS)
roperscientific-deps	:= $(ROPERSCIENTIFIC_LDLIBS)

full-version	:= $(shell cat $(version-file))
maj-version	:= $(shell echo $(full-version) | cut -f1 -d.)

roperscientific-base	:= liblima$(name).so
roperscientific-full	:= $(roperscientific-base).$(full-version)
roperscientific-maj	:= $(roperscientific-base).$(maj-version)
roperscientific-flags	+= -fPIC -Wl,-soname,$(roperscientific-maj)

$(roperscientific-full):		$(roperscientific-objs)
	$(CXX) -shared -o $@ $(roperscientific-flags) $+ $(roperscientific-deps)
	rm -f $(roperscientific-maj);  ln -s $(roperscientific-full) $(roperscientific-maj)
	rm -f $(roperscientific-base); ln -s $(roperscientific-maj)  $(roperscientific-base)

build_targets += $(roperscientific-full)

endif

292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323
############################
# LIMA - ADSC
############################

ifneq ($(COMPILE_ADSC),0)

ADSC_LDFLAGS	:= -L. -L../camera/adsc/sdk/adsc_sources/lib/linux
ADSC_LDLIBS	:= -lauxlib -ldetcon_th
name		:= adsc
adsc-objs	:= ../camera/adsc/src/Adsc.o
version-file	:= ../camera/adsc/VERSION
adsc-flags	:= $(ADSC_LDFLAGS)
adsc-deps	:= $(ADSC_LDLIBS)

full-version	:= $(shell cat $(version-file))
maj-version	:= $(shell echo $(full-version) | cut -f1 -d.)

adsc-base	:= liblima$(name).so
adsc-full	:= $(adsc-base).$(full-version)
adsc-maj	:= $(adsc-base).$(maj-version)
adsc-flags	+= -fPIC -Wl,-soname,$(adsc-maj)

$(adsc-full):		$(adsc-objs)
	$(CXX) -shared -o $@ $(adsc-flags) $+ $(adsc-deps)
	rm -f $(adsc-maj);  ln -s $(adsc-full) $(adsc-maj)
	rm -f $(adsc-base); ln -s $(adsc-maj)  $(adsc-base)

build_targets += $(adsc-full)

endif


teresa's avatar
teresa committed
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338
############################
# LIMA - MYTHEN
############################

ifneq ($(COMPILE_MYTHEN),0)

MYTHEN_LDLIBS	:= -lSlsDetector
name		:= mythen
mythen-objs	:= ../camera/mythen/src/Mythen.o
version-file	:= ../camera/mythen/VERSION
mythen-flags	:= $(LDFLAGS)
mythen-deps	:= $(MYTHEN_LDLIBS)

full-version	:= $(shell cat $(version-file))
maj-version	:= $(shell echo $(full-version) | cut -f1 -d.)
339

teresa's avatar
teresa committed
340 341 342 343
mythen-base	:= liblima$(name).so
mythen-full	:= $(mythen-base).$(full-version)
mythen-maj	:= $(mythen-base).$(maj-version)
mythen-flags	+= -fPIC -Wl,-soname,$(mythen-maj)
344

teresa's avatar
teresa committed
345 346 347 348
$(mythen-full):		$(mythen-objs)
	$(CXX) -shared -o $@ $(mythen-flags) $+ $(mythen-deps)
	rm -f $(mythen-maj);  ln -s $(mythen-full) $(mythen-maj)
	rm -f $(mythen-base); ln -s $(mythen-maj)  $(mythen-base)
teresa's avatar
teresa committed
349

teresa's avatar
teresa committed
350
build_targets += $(mythen-full)
teresa's avatar
teresa committed
351

352
src:		$(build_targets)
353 354 355 356

test:
	@true

kirov's avatar
kirov committed
357
clean:
ahoms's avatar
ahoms committed
358
	rm -f *.o liblima*.so*