Makefile 4.51 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 16
ifneq ($(COMPILE_CBF_SAVING),0)
ct-objs += CtSaving_Cbf.o
CORE_LDFLAGS += -L../third-party/CBFLib/lib
CORE_LDLIBS += -lcbf
endif

17 18
ifneq ($(COMPILE_CORE),0)

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

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

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

endif

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


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

ifneq ($(COMPILE_SIMULATOR),0)

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

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

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

endif
ahoms's avatar
ahoms committed
76

77 78 79 80 81

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

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

ifneq ($(COMPILE_ESPIA),0)

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

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

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

109 110
endif

111 112 113 114 115

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

116
ifneq ($(COMPILE_FRELON),0)
117

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

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

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

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

142 143
endif

144 145 146 147 148

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

149
ifneq ($(COMPILE_MAXIPIX),0)
150

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

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

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

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

endif

src:		$(build_targets)
178 179 180 181

test:
	@true

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