Makefile 14.5 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
ifneq ($(COMPILE_FITS_SAVING),0)
38
CORE_LDFLAGS += -L../third-party/cfitsio/lib -L../third-party/CCfits/.libs
39 40 41
CORE_LDLIBS += -lCCfits -lcfitsio
endif

42 43
ifneq ($(COMPILE_CORE),0)

ahoms's avatar
ahoms committed
44 45 46
name		:= core
core-objs	:= ../common/src/Common.o \
		   ../hardware/src/Hw.o \
ahoms's avatar
ahoms committed
47
		   ../control/src/Ct.o
ahoms's avatar
ahoms committed
48 49 50
version-file	:= ../common/VERSION
core-flags	:= $(CORE_LDFLAGS)
core-deps	:= $(CORE_LDLIBS)
51

ahoms's avatar
ahoms committed
52 53
full-version	:= $(shell cat $(version-file))
maj-version	:= $(shell echo $(full-version) | cut -f1 -d.)
54 55 56 57 58
ifneq ($(LINK_STRICT_VERSION),0)
link-version	:= $(full-version)
else
link-version	:= $(maj-version)
endif
59

ahoms's avatar
ahoms committed
60 61
core-base	:= liblima$(name).so
core-full	:= $(core-base).$(full-version)
62 63
core-link	:= $(core-base).$(link-version)
core-flags	+= -fPIC -Wl,-soname,$(core-link)
ahoms's avatar
ahoms committed
64 65 66

$(core-full):		$(core-objs)
	$(CXX) -shared -o $@ $(core-flags) $+ $(core-deps)
67 68 69 70
ifeq ($(LINK_STRICT_VERSION),0)
	rm -f $(core-link); ln -s $(core-full) $(core-link)
endif
	rm -f $(core-base); ln -s $(core-link) $(core-base)
ahoms's avatar
ahoms committed
71 72

build_targets := $(core-full)
73 74 75

endif

ahoms's avatar
ahoms committed
76 77
LDFLAGS		:= $(CORE_LDFLAGS) -L.
LDLIBS		:= $(CORE_LDLIBS) -llimacore
78 79 80 81 82 83 84 85


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

ifneq ($(COMPILE_SIMULATOR),0)

ahoms's avatar
ahoms committed
86 87 88 89 90 91 92 93
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.)
94 95 96 97 98
ifneq ($(LINK_STRICT_VERSION),0)
link-version	:= $(full-version)
else
link-version	:= $(maj-version)
endif
99

ahoms's avatar
ahoms committed
100 101
simu-base	:= liblima$(name).so
simu-full	:= $(simu-base).$(full-version)
102 103
simu-link	:= $(simu-base).$(link-version)
simu-flags	+= -fPIC -Wl,-soname,$(simu-link)
104

ahoms's avatar
ahoms committed
105 106
$(simu-full):		$(simu-objs)
	$(CXX) -shared -o $@ $(simu-flags) $+ $(simu-deps)
107 108 109 110
ifeq ($(LINK_STRICT_VERSION),0)
	rm -f $(simu-link); ln -s $(simu-full) $(simu-link)
endif
	rm -f $(simu-base); ln -s $(simu-link) $(simu-base)
ahoms's avatar
ahoms committed
111 112

build_targets += $(simu-full)
113 114

endif
ahoms's avatar
ahoms committed
115

116 117 118 119 120

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

121 122 123

ifneq ($(COMPILE_ESPIA),0)

124
include ../camera/common/espia/include/espia.inc
ahoms's avatar
ahoms committed
125 126
ESPIA_LDFLAGS	:= $(LDFLAGS) -L$(ESPIA_DRV_LIB)
ESPIA_LDLIBS	:= $(LDLIBS) -lespia
127

ahoms's avatar
ahoms committed
128 129 130 131 132 133 134 135
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.)
136 137 138 139 140
ifneq ($(LINK_STRICT_VERSION),0)
link-version	:= $(full-version)
else
link-version	:= $(maj-version)
endif
141

ahoms's avatar
ahoms committed
142 143
espia-base	:= liblima$(name).so
espia-full	:= $(espia-base).$(full-version)
144 145
espia-link	:= $(espia-base).$(link-version)
espia-flags	+= -fPIC -Wl,-soname,$(espia-link)
146

ahoms's avatar
ahoms committed
147 148
$(espia-full):		$(espia-objs)
	$(CXX) -shared -o $@ $(espia-flags) $+ $(espia-deps)
149 150 151 152
ifeq ($(LINK_STRICT_VERSION),0)
	rm -f $(espia-link); ln -s $(espia-full) $(espia-link)
endif
	rm -f $(espia-base); ln -s $(espia-link) $(espia-base)
ahoms's avatar
ahoms committed
153 154

build_targets += $(espia-full)
155

156 157
endif

158 159 160 161 162

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

163
ifneq ($(COMPILE_FRELON),0)
164

ahoms's avatar
ahoms committed
165 166 167 168 169 170 171 172 173 174 175
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.)
176 177 178 179 180
ifneq ($(LINK_STRICT_VERSION),0)
link-version	:= $(full-version)
else
link-version	:= $(maj-version)
endif
181

ahoms's avatar
ahoms committed
182 183
frelon-base	:= liblima$(name).so
frelon-full	:= $(frelon-base).$(full-version)
184 185
frelon-link	:= $(frelon-base).$(link-version)
frelon-flags	+= -fPIC -Wl,-soname,$(frelon-link)
186

ahoms's avatar
ahoms committed
187 188
$(frelon-full):		$(frelon-objs)
	$(CXX) -shared -o $@ $(frelon-flags) $+ $(frelon-deps)
189 190 191 192
ifeq ($(LINK_STRICT_VERSION),0)
	rm -f $(frelon-link); ln -s $(frelon-full) $(frelon-link)
endif
	rm -f $(frelon-base); ln -s $(frelon-link) $(frelon-base)
193

ahoms's avatar
ahoms committed
194
build_targets += $(frelon-full)
195

196 197
endif

198 199 200 201 202

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

203
ifneq ($(COMPILE_MAXIPIX),0)
204

ahoms's avatar
ahoms committed
205 206 207 208 209 210 211 212 213 214 215
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.)
216 217 218 219 220
ifneq ($(LINK_STRICT_VERSION),0)
link-version	:= $(full-version)
else
link-version	:= $(maj-version)
endif
221

ahoms's avatar
ahoms committed
222 223
maxipix-base	:= liblima$(name).so
maxipix-full	:= $(maxipix-base).$(full-version)
224 225
maxipix-link	:= $(maxipix-base).$(link-version)
maxipix-flags	+= -fPIC -Wl,-soname,$(maxipix-link)
226

ahoms's avatar
ahoms committed
227 228
$(maxipix-full):		$(maxipix-objs)
	$(CXX) -shared -o $@ $(maxipix-flags) $+ $(maxipix-deps)
229 230 231 232
ifeq ($(LINK_STRICT_VERSION),0)
	rm -f $(maxipix-link); ln -s $(maxipix-full) $(maxipix-link)
endif
	rm -f $(maxipix-base); ln -s $(maxipix-link) $(maxipix-base)
233

ahoms's avatar
ahoms committed
234
build_targets += $(maxipix-full)
235 236 237

endif

238 239 240 241 242 243
############################
# LIMA - BASLER
############################

ifneq ($(COMPILE_BASLER),0)

Florent Langlois's avatar
Florent Langlois committed
244 245
BASLER_LDFLAGS	:= -L. -L/opt/pylon/lib -L/opt/pylon/lib64
BASLER_LDLIBS	:= -lpylongigesupp
246 247 248 249 250 251

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
252
basler-base	:= liblima$(name).so
253 254
full-version	:= $(shell cat $(version-file))
maj-version	:= $(shell echo $(full-version) | cut -f1 -d.)
255 256 257 258 259
ifneq ($(LINK_STRICT_VERSION),0)
link-version	:= $(full-version)
else
link-version	:= $(maj-version)
endif
260
basler-full	:= $(basler-base).$(full-version)
261 262
basler-link	:= $(basler-base).$(link-version)
basler-flags	+= -fPIC -Wl,-soname,$(basler-link)
263 264 265

$(basler-full):		$(basler-objs)
	$(CXX) -shared -o $@ $(basler-flags) $+ $(basler-deps)
266 267 268 269
ifeq ($(LINK_STRICT_VERSION),0)
	rm -f $(basler-link); ln -s $(basler-full) $(basler-link)
endif
	rm -f $(basler-base); ln -s $(basler-link) $(basler-base)
270 271

build_targets += $(basler-full)
Florent Langlois's avatar
Florent Langlois committed
272 273
endif

Sebastien Petitdemange's avatar
Sebastien Petitdemange committed
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
############################
# LIMA - UEYE
############################

ifneq ($(COMPILE_UEYE),0)

UEYE_LDFLAGS	:=
UEYE_LDLIBS	:= -lueye_api

name		:= ueye
ueye-objs	:= ../camera/ueye/src/Ueye.o
version-file	:= ../camera/ueye/VERSION
ueye-flags	:= $(UEYE_LDFLAGS)
ueye-deps	:= $(UEYE_LDLIBS)
ueye-base	:= liblima$(name).so
full-version	:= $(shell cat $(version-file))
maj-version	:= $(shell echo $(full-version) | cut -f1 -d.)
291 292 293 294 295
ifneq ($(LINK_STRICT_VERSION),0)
link-version	:= $(full-version)
else
link-version	:= $(maj-version)
endif
Sebastien Petitdemange's avatar
Sebastien Petitdemange committed
296
ueye-full	:= $(ueye-base).$(full-version)
297 298
ueye-link	:= $(ueye-base).$(link-version)
ueye-flags	+= -fPIC -Wl,-soname,$(ueye-link)
Sebastien Petitdemange's avatar
Sebastien Petitdemange committed
299 300 301

$(ueye-full):		$(ueye-objs)
	$(CXX) -shared -o $@ $(ueye-flags) $+ $(ueye-deps)
302 303 304 305
ifeq ($(LINK_STRICT_VERSION),0)
	rm -f $(ueye-link); ln -s $(ueye-full) $(ueye-link)
endif
	rm -f $(ueye-base); ln -s $(ueye-link) $(ueye-base)
Sebastien Petitdemange's avatar
Sebastien Petitdemange committed
306 307 308 309

build_targets += $(ueye-full)
endif

Florent Langlois's avatar
Florent Langlois committed
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330
############################
# 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.)
331 332 333 334 335
ifneq ($(LINK_STRICT_VERSION),0)
link-version	:= $(full-version)
else
link-version	:= $(maj-version)
endif
Florent Langlois's avatar
Florent Langlois committed
336 337
prosilica-base	:= liblima$(name).so
prosilica-full	:= $(prosilica-base).$(full-version)
338 339
prosilica-link	:= $(prosilica-base).$(link-version)
prosilica-flags	+= -fPIC -Wl,-soname,$(prosilica-link)
Florent Langlois's avatar
Florent Langlois committed
340 341 342

$(prosilica-full):		$(prosilica-objs)
	$(CXX) -shared -o $@ $(prosilica-flags) $+ $(prosilica-deps)
343 344 345 346
ifeq ($(LINK_STRICT_VERSION),0)
	rm -f $(prosilica-link); ln -s $(prosilica-full) $(prosilica-link)
endif
	rm -f $(prosilica-base); ln -s $(prosilica-link) $(prosilica-base)
347

Florent Langlois's avatar
Florent Langlois committed
348
build_targets += $(prosilica-full)
349 350
endif

teresa's avatar
teresa committed
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366

############################
# 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.)
367 368 369 370 371
ifneq ($(LINK_STRICT_VERSION),0)
link-version	:= $(full-version)
else
link-version	:= $(maj-version)
endif
teresa's avatar
teresa committed
372 373 374

roperscientific-base	:= liblima$(name).so
roperscientific-full	:= $(roperscientific-base).$(full-version)
375 376
roperscientific-link	:= $(roperscientific-base).$(link-version)
roperscientific-flags	+= -fPIC -Wl,-soname,$(roperscientific-link)
teresa's avatar
teresa committed
377 378 379

$(roperscientific-full):		$(roperscientific-objs)
	$(CXX) -shared -o $@ $(roperscientific-flags) $+ $(roperscientific-deps)
380 381 382 383
ifeq ($(LINK_STRICT_VERSION),0)
	rm -f $(roperscientific-link); ln -s $(roperscientific-full) $(roperscientific-link)
endif
	rm -f $(roperscientific-base); ln -s $(roperscientific-link) $(roperscientific-base)
teresa's avatar
teresa committed
384 385 386 387 388

build_targets += $(roperscientific-full)

endif

389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404
############################
# 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.)
405 406 407 408 409
ifneq ($(LINK_STRICT_VERSION),0)
link-version	:= $(full-version)
else
link-version	:= $(maj-version)
endif
410 411 412

adsc-base	:= liblima$(name).so
adsc-full	:= $(adsc-base).$(full-version)
413 414
adsc-link	:= $(adsc-base).$(link-version)
adsc-flags	+= -fPIC -Wl,-soname,$(adsc-link)
415 416 417

$(adsc-full):		$(adsc-objs)
	$(CXX) -shared -o $@ $(adsc-flags) $+ $(adsc-deps)
418 419 420 421
ifeq ($(LINK_STRICT_VERSION),0)
	rm -f $(adsc-link); ln -s $(adsc-full) $(adsc-link)
endif
	rm -f $(adsc-base); ln -s $(adsc-link) $(adsc-base)
422 423 424 425 426 427

build_targets += $(adsc-full)

endif


teresa's avatar
teresa committed
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442
############################
# 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.)
443 444 445 446 447
ifneq ($(LINK_STRICT_VERSION),0)
link-version	:= $(full-version)
else
link-version	:= $(maj-version)
endif
448

teresa's avatar
teresa committed
449 450
mythen-base	:= liblima$(name).so
mythen-full	:= $(mythen-base).$(full-version)
451 452
mythen-link	:= $(mythen-base).$(link-version)
mythen-flags	+= -fPIC -Wl,-soname,$(mythen-link)
453

teresa's avatar
teresa committed
454 455
$(mythen-full):		$(mythen-objs)
	$(CXX) -shared -o $@ $(mythen-flags) $+ $(mythen-deps)
456 457 458 459
ifeq ($(LINK_STRICT_VERSION),0)
	rm -f $(mythen-link); ln -s $(mythen-full) $(mythen-link)
endif
	rm -f $(mythen-base); ln -s $(mythen-link) $(mythen-base)
teresa's avatar
teresa committed
460

teresa's avatar
teresa committed
461
build_targets += $(mythen-full)
teresa's avatar
teresa committed
462

463 464
endif

465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481
############################
# LIMA - ANDOR
############################

ifneq ($(COMPILE_ANDOR),0)

ANDOR_LDFLAGS	:= -L. -L/usr/local/lib
ANDOR_LDLIBS	:= -landor

name		:= andor
andor-objs	:= ../camera/andor/src/Andor.o
version-file	:= ../camera/andor/VERSION
andor-flags	:= $(ANDOR_LDFLAGS)
andor-deps	:= $(ANDOR_LDLIBS)
andor-base	:= liblima$(name).so
full-version	:= $(shell cat $(version-file))
maj-version	:= $(shell echo $(full-version) | cut -f1 -d.)
482 483 484 485 486
ifneq ($(LINK_STRICT_VERSION),0)
link-version	:= $(full-version)
else
link-version	:= $(maj-version)
endif
487
andor-full	:= $(andor-base).$(full-version)
488 489
andor-link	:= $(andor-base).$(link-version)
andor-flags	+= -fPIC -Wl,-soname,$(andor-link)
490 491 492

$(andor-full):		$(andor-objs)
	$(CXX) -shared -o $@ $(andor-flags) $+ $(andor-deps)
493 494 495 496
ifeq ($(LINK_STRICT_VERSION),0)
	rm -f $(andor-link); ln -s $(andor-full) $(andor-link)
endif
	rm -f $(andor-base); ln -s $(andor-link) $(andor-base)
497 498 499 500

build_targets += $(andor-full)
endif

501 502 503 504 505 506
############################
# LIMA - XPAD
############################

ifneq ($(COMPILE_XPAD),0)

507
XPAD_LDLIBS	:= -L/home/xpix_user/PCI_VALIDATED/trunk/sw/xpci_lib -lxpci_lib -L../third-party/yat/lib/i386/static -lyat
508 509 510 511 512 513 514 515
name		:= xpad
xpad-objs	:= ../camera/xpad/src/Xpad.o
version-file	:= ../camera/xpad/VERSION
xpad-flags	:= $(LDFLAGS)
xpad-deps	:= $(XPAD_LDLIBS)

full-version	:= $(shell cat $(version-file))
maj-version	:= $(shell echo $(full-version) | cut -f1 -d.)
516 517 518 519 520
ifneq ($(LINK_STRICT_VERSION),0)
link-version	:= $(full-version)
else
link-version	:= $(maj-version)
endif
521 522 523

xpad-base	:= liblima$(name).so
xpad-full	:= $(xpad-base).$(full-version)
524 525
xpad-link	:= $(xpad-base).$(link-version)
xpad-flags	+= -fPIC -Wl,-soname,$(xpad-link)
526 527 528

$(xpad-full):		$(xpad-objs)
	$(CXX) -shared -o $@ $(xpad-flags) $+ $(xpad-deps)
529 530 531 532
ifeq ($(LINK_STRICT_VERSION),0)
	rm -f $(xpad-link); ln -s $(xpad-full) $(xpad-link)
endif
	rm -f $(xpad-base); ln -s $(xpad-link) $(xpad-base)
533 534 535 536 537

build_targets += $(xpad-full)

endif

538
src:		$(build_targets)
539 540 541 542

test:
	@true

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