Makefile 7.39 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

261
src:		$(build_targets)
262 263 264 265

test:
	@true

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