Makefile 4.49 KB
Newer Older
1

2 3
include ../config.inc

4 5 6 7
############################
# LIMA - CORE
############################

ahoms's avatar
ahoms committed
8 9
CORE_LDFLAGS	:= -L../third-party/Processlib/build
CORE_LDLIBS	:= -lprocesslib
10

seb's avatar
seb committed
11 12 13 14 15
ifneq ($(COMPILE_CBF_SAVING),0)
CORE_LDFLAGS += -L../third-party/CBFLib/lib
CORE_LDLIBS += -lcbf
endif

16 17
ifneq ($(COMPILE_CORE),0)

ahoms's avatar
ahoms committed
18 19 20
name		:= core
core-objs	:= ../common/src/Common.o \
		   ../hardware/src/Hw.o \
ahoms's avatar
ahoms committed
21
		   ../control/src/Ct.o
ahoms's avatar
ahoms committed
22 23 24
version-file	:= ../common/VERSION
core-flags	:= $(CORE_LDFLAGS)
core-deps	:= $(CORE_LDLIBS)
25

ahoms's avatar
ahoms committed
26 27
full-version	:= $(shell cat $(version-file))
maj-version	:= $(shell echo $(full-version) | cut -f1 -d.)
28

ahoms's avatar
ahoms committed
29 30 31 32 33 34 35 36 37 38 39
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)
40 41 42

endif

ahoms's avatar
ahoms committed
43 44
LDFLAGS		:= $(CORE_LDFLAGS) -L.
LDLIBS		:= $(CORE_LDLIBS) -llimacore
45 46 47 48 49 50 51 52


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

ifneq ($(COMPILE_SIMULATOR),0)

ahoms's avatar
ahoms committed
53 54 55 56 57 58 59 60
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.)
61

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

ahoms's avatar
ahoms committed
67 68 69 70 71 72
$(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)
73 74

endif
ahoms's avatar
ahoms committed
75

76 77 78 79 80

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

81
include ../camera/common/espia/include/espia.inc
ahoms's avatar
ahoms committed
82 83
ESPIA_LDFLAGS	:= $(LDFLAGS) -L$(ESPIA_DRV_LIB)
ESPIA_LDLIBS	:= $(LDLIBS) -lespia
84 85 86

ifneq ($(COMPILE_ESPIA),0)

ahoms's avatar
ahoms committed
87 88 89 90 91 92 93 94
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.)
95

ahoms's avatar
ahoms committed
96 97 98 99
espia-base	:= liblima$(name).so
espia-full	:= $(espia-base).$(full-version)
espia-maj	:= $(espia-base).$(maj-version)
espia-flags	+= -fPIC -Wl,-soname,$(espia-maj)
100

ahoms's avatar
ahoms committed
101 102 103 104 105 106
$(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)
107

108 109
endif

110 111 112 113 114

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

115
ifneq ($(COMPILE_FRELON),0)
116

ahoms's avatar
ahoms committed
117 118 119 120 121 122 123 124 125 126 127
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.)
128

ahoms's avatar
ahoms committed
129 130 131 132
frelon-base	:= liblima$(name).so
frelon-full	:= $(frelon-base).$(full-version)
frelon-maj	:= $(frelon-base).$(maj-version)
frelon-flags	+= -fPIC -Wl,-soname,$(frelon-maj)
133

ahoms's avatar
ahoms committed
134 135 136 137
$(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)
138

ahoms's avatar
ahoms committed
139
build_targets += $(frelon-full)
140

141 142
endif

143 144 145 146 147

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

148
ifneq ($(COMPILE_MAXIPIX),0)
149

ahoms's avatar
ahoms committed
150 151 152 153 154 155 156 157 158 159 160
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.)
161

ahoms's avatar
ahoms committed
162 163 164 165
maxipix-base	:= liblima$(name).so
maxipix-full	:= $(maxipix-base).$(full-version)
maxipix-maj	:= $(maxipix-base).$(maj-version)
maxipix-flags	+= -fPIC -Wl,-soname,$(maxipix-maj)
166

ahoms's avatar
ahoms committed
167 168 169 170
$(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)
171

ahoms's avatar
ahoms committed
172
build_targets += $(maxipix-full)
173 174 175 176

endif

src:		$(build_targets)
177 178 179 180

test:
	@true

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