Makefile 12.6 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 39 40 41
ifneq ($(COMPILE_FITS_SAVING),0)
CORE_LDFLAGS += -L../usr/local/lib
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

ahoms's avatar
ahoms committed
55 56 57 58 59 60 61 62 63 64 65
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)
66 67 68

endif

ahoms's avatar
ahoms committed
69 70
LDFLAGS		:= $(CORE_LDFLAGS) -L.
LDLIBS		:= $(CORE_LDLIBS) -llimacore
71 72 73 74 75 76 77 78


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

ifneq ($(COMPILE_SIMULATOR),0)

ahoms's avatar
ahoms committed
79 80 81 82 83 84 85 86
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.)
87

ahoms's avatar
ahoms committed
88 89 90 91
simu-base	:= liblima$(name).so
simu-full	:= $(simu-base).$(full-version)
simu-maj	:= $(simu-base).$(maj-version)
simu-flags	+= -fPIC -Wl,-soname,$(simu-maj)
92

ahoms's avatar
ahoms committed
93 94 95 96 97 98
$(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)
99 100

endif
ahoms's avatar
ahoms committed
101

102 103 104 105 106

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

107 108 109

ifneq ($(COMPILE_ESPIA),0)

110
include ../camera/common/espia/include/espia.inc
ahoms's avatar
ahoms committed
111 112
ESPIA_LDFLAGS	:= $(LDFLAGS) -L$(ESPIA_DRV_LIB)
ESPIA_LDLIBS	:= $(LDLIBS) -lespia
113

ahoms's avatar
ahoms committed
114 115 116 117 118 119 120 121
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.)
122

ahoms's avatar
ahoms committed
123 124 125 126
espia-base	:= liblima$(name).so
espia-full	:= $(espia-base).$(full-version)
espia-maj	:= $(espia-base).$(maj-version)
espia-flags	+= -fPIC -Wl,-soname,$(espia-maj)
127

ahoms's avatar
ahoms committed
128 129 130 131 132 133
$(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)
134

135 136
endif

137 138 139 140 141

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

142
ifneq ($(COMPILE_FRELON),0)
143

ahoms's avatar
ahoms committed
144 145 146 147 148 149 150 151 152 153 154
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.)
155

ahoms's avatar
ahoms committed
156 157 158 159
frelon-base	:= liblima$(name).so
frelon-full	:= $(frelon-base).$(full-version)
frelon-maj	:= $(frelon-base).$(maj-version)
frelon-flags	+= -fPIC -Wl,-soname,$(frelon-maj)
160

ahoms's avatar
ahoms committed
161 162 163 164
$(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)
165

ahoms's avatar
ahoms committed
166
build_targets += $(frelon-full)
167

168 169
endif

170 171 172 173 174

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

175
ifneq ($(COMPILE_MAXIPIX),0)
176

ahoms's avatar
ahoms committed
177 178 179 180 181 182 183 184 185 186 187
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.)
188

ahoms's avatar
ahoms committed
189 190 191 192
maxipix-base	:= liblima$(name).so
maxipix-full	:= $(maxipix-base).$(full-version)
maxipix-maj	:= $(maxipix-base).$(maj-version)
maxipix-flags	+= -fPIC -Wl,-soname,$(maxipix-maj)
193

ahoms's avatar
ahoms committed
194 195 196 197
$(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)
198

ahoms's avatar
ahoms committed
199
build_targets += $(maxipix-full)
200 201 202

endif

203 204 205 206 207 208
############################
# LIMA - BASLER
############################

ifneq ($(COMPILE_BASLER),0)

Florent Langlois's avatar
Florent Langlois committed
209 210
BASLER_LDFLAGS	:= -L. -L/opt/pylon/lib -L/opt/pylon/lib64
BASLER_LDLIBS	:= -lpylongigesupp
211 212 213 214 215 216

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
217
basler-base	:= liblima$(name).so
218 219 220 221 222 223 224 225 226 227 228 229
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
230 231
endif

Sebastien Petitdemange's avatar
Sebastien Petitdemange committed
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 257 258 259 260
############################
# 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.)
ueye-full	:= $(ueye-base).$(full-version)
ueye-maj	:= $(ueye-base).$(maj-version)
ueye-flags	+= -fPIC -Wl,-soname,$(ueye-maj)

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

build_targets += $(ueye-full)
endif

Florent Langlois's avatar
Florent Langlois 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
############################
# 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)
291

Florent Langlois's avatar
Florent Langlois committed
292
build_targets += $(prosilica-full)
293 294
endif

teresa's avatar
teresa committed
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 324 325

############################
# 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

326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357
############################
# 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
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372
############################
# 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.)
373

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

teresa's avatar
teresa committed
379 380 381 382
$(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
383

teresa's avatar
teresa committed
384
build_targets += $(mythen-full)
teresa's avatar
teresa committed
385

386 387
endif

388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416
############################
# 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.)
andor-full	:= $(andor-base).$(full-version)
andor-maj	:= $(andor-base).$(maj-version)
andor-flags	+= -fPIC -Wl,-soname,$(andor-maj)

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

build_targets += $(andor-full)
endif

417 418 419 420 421 422
############################
# LIMA - XPAD
############################

ifneq ($(COMPILE_XPAD),0)

423
XPAD_LDLIBS	:= -L/home/xpix_user/PCI_VALIDATED/trunk/sw/xpci_lib -lxpci_lib -L../third-party/yat/lib/i386/static -lyat
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446
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.)

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

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

build_targets += $(xpad-full)

endif

447
src:		$(build_targets)
448 449 450 451

test:
	@true

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