forked from edrosten/libcvd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
335 lines (253 loc) · 8.42 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
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
257
258
259
260
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
291
292
293
294
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
326
327
328
329
330
331
332
333
334
335
# @configure_input@
SHELL = /bin/sh
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
arch= @build_cpu@
datarootdir=@datadir@
CC = @CC@
CXX=@CXX@
LD=@CXX@
RANLIB=@RANLIB@
CPPFLAGS = @CPPFLAGS@
CFLAGS = @CFLAGS@
CXXFLAGS = @CXXFLAGS@
OFLAGS=@OFLAGS@
LDFLAGS = @LDFLAGS@
LOADLIBES = @LIBS@
INSTALL = @INSTALL@
AR=ar
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@
VERSION = @VERSION@
SUBDIRS =
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
DIST_COMMON = README ChangeLog Makefile.am \
Makefile.in aclocal.m4 configure configure.ac install-sh missing \
mkinstalldirs
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
GZIP_ENV = --best
################################################################################
#
# CVD objects
#
CVD_OBJS= \
cvd_src/diskbuffer2.o \
cvd_src/deinterlacebuffer.o \
cvd_src/exceptions.o \
cvd_src/image_io.o \
cvd_src/bayer.o \
cvd_src/morphology.o \
cvd_src/draw.o \
cvd_src/noarch/yuv422.o \
cvd_src/yuv420.o \
cvd_src/image_io/pnm_grok.o \
cvd_src/image_io/bmp.o \
cvd_src/image_io/bmp_read.o \
cvd_src/image_io/bmp_write.o \
cvd_src/image_io/cvdimage.o \
cvd_src/image_io/fits.o \
cvd_src/image_io/fitswrite.o \
cvd_src/image_io/save_postscript.o \
cvd_src/image_io/text_write.o \
cvd_src/image_io/text.o \
cvd_src/fast_corner.o \
cvd_src/convolution.o \
cvd_src/nonmax_suppression.o \
cvd_src/timeddiskbuffer.o \
cvd_src/videosource.o \
cvd_src/connected_components.o \
cvd_src/cvd_timer.o \
cvd_src/globlist.o \
@dep_objects@
################################################################################
#
# Shared objects
#
ifeq (@osx_hacks@,yes)
soname=libcvd.dylib
soname1=libcvd-@[email protected]
soname2=libcvd-@major@.@[email protected]
shared=-dynamiclib
install_so_target=install-libs-so
else
ifeq (@cygwin_hacks@,yes)
dllname=cygcvd.dll
dllimportname=libcvd.dll.a
install_so_target=install-libs-dll
else
soname=libcvd.so
soname1=libcvd.so.@major@
soname2=libcvd.so.@major@.@minor@
set_soname=-Wl,-soname,libcvd.so.@major@
shared=-shared
install_so_target=install-libs-so
endif
endif
OBJS=$(CVD_OBJS)
ifeq (@have_shared@,yes)
install_so=$(install_so_target)
else
install_so=
soname:=
endif
all: libcvd.a $(soname) $(dllname) progs
cyg%.dll lib%.dll.a: lib%.a
$(LD) -shared -o cyg$*.dll -Wl,--out-implib=lib$*.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive lib$*.a -Wl,--no-whole-archive $(LDFLAGS) $(LOADLIBES)
$(soname2): $(OBJS)
rm -f $(soname2)
$(LD) $(shared) -o $(soname2) $(OBJS) $(LDFLAGS) $(LOADLIBES) $(set_soname)
$(soname1): $(soname2)
rm -f $(soname1)
ln -s $(soname2) $(soname1)
$(soname): $(soname1)
rm -f $(soname)
ln -s $(soname1) $(soname)
libcvd.a: $(OBJS)
$(AR) crvs libcvd.a $(OBJS)
$(RANLIB) libcvd.a
# Before we compile the test programs we need to augment the
# search paths with the path to libcvd, and also add libcvd to the
# libraries to use
CPPFLAGS = -I. -I@srcdir@ @CPPFLAGS@
ifneq (@osx_hacks@,yes)
LDFLAGS = -Wl,-R. @LDFLAGS@
endif
LDFLAGS = @LDFLAGS@ -L.
LOADLIBES = @LIBS@
PROGS=@progs@
TESTPROGS=@testprogs@
$(PROGS):$(soname)
$(TESTPROGS):$(soname)
testprogs: $(TESTPROGS)
progs: $(PROGS)
@docs@:
doxygen Doxyfile
test-fast:test/fast_test
test/fast_test test/fast_test_image/noise.pgm
#If the mandir is older than the lib, then remake. A bit of a hack
man: libcvd.a
doxygen Doxyfile
touch man
install: install-progs install-headers install-libs
install-progs:progs
mkdir -p $(DESTDIR)$(bindir)
[ "$(PROGS)" = "" ] || cp $(PROGS) $(DESTDIR)$(bindir)
install-headers:
mkdir -p $(DESTDIR)$(includedir)
cp -r cvd $(DESTDIR)$(includedir)
install-libs-dll:$(dllname) $(dllimportname)
mkdir -p $(DESTDIR)$(bindir)
cp $(dllname) $(DESTDIR)$(bindir)
mkdir -p $(DESTDIR)$(libdir)
cp $(dllimportname) $(DESTDIR)$(libdir)
install-libs-so:$(soname)
mkdir -p $(DESTDIR)$(libdir)
rm -f $(DESTDIR)$(libdir)/$(soname2) $(DESTDIR)$(libdir)/$(soname1) $(DESTDIR)$(libdir)/$(soname)
cp $(soname2) $(DESTDIR)$(libdir)
ln -s $(libdir)/$(soname2) $(DESTDIR)$(libdir)/$(soname1)
ln -s $(libdir)/$(soname1) $(DESTDIR)$(libdir)/$(soname)
install-libs-a:libcvd.a
mkdir -p $(DESTDIR)$(libdir)
cp libcvd.a $(DESTDIR)$(libdir)
install-libs:$(install_so) install-libs-a
distclean: clean
/bin/rm -f Makefile config.h config.status config.cache config.log cvd/config.h .deps config.dep_tmp
.deps:
rm -f .sourcefiles
find . -name "*.cxx" -o -name "*.cc" -o -name "*.cpp" -o -name "*.c" -o -name "*.C" | grep -v python > .sourcefiles
rm -f .deps
bash generate_dependencies.bash "$(CXX)" "$(CPPFLAGS) $(CXXFLAGS)" > .deps
depend: .deps
.PRECIOUS: %.o
#Let's say a header changed to include a new header.
#That change would cause a rebuild of the .cc file
#but not the .d file.
#
# Arguments mean:
# -MMD output #include dependencies, but ignore system headers, while
# the build continues
# -MF output dependencies to a file, so other crud goes to the screen
# -MP make a blank target for dependencies. That way if a dependency is
# deleted, make won't fail to build stuff
%.o: %.cc
mkdir -p $(@D) && $(CXX) $(OFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ -MMD -MP -MF $*.d
%.o: %.cpp
mkdir -p $(@D) && $(CXX) $(OFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ -MMD -MP -MF $*.d
%.o: %.cxx
mkdir -p $(@D) && $(CXX) $(OFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ -MMD -MP -MF $*.d
%.o: %.C
mkdir -p $(@D) && $(CXX) $(OFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ -MMD -MP -MF $*.d
%.o: %.s
mkdir -p $(@D) && as -g -o $@ $<
%: %.o
mkdir -p $(@D) && $(CXX) -o $@ $< $(LDFLAGS) -lcvd $(LOADLIBES)
printlibs:
@echo $(LOADLIBES)
.PHONY: test
REGRESSIONS=distance_transform_test fast_corner_test load_and_save image_ref convolution flips copy $(TESTPROGS)
REGRESSION_OUT=$(patsubst %,tests/%.out, $(REGRESSIONS))
test:$(REGRESSION_OUT)
.PRECIOUS:tests/%.test
tests/%.test: tests/%.cc
mkdir -p $(@D) && $(CXX) $(CPPFLAGS) $(CXXFLAGS) $< -o $@ -O0 -L. -lcvd -MMD -MP -MF tests/$*.d
.PRECIOUS:tests/%.out
tests/videoreader_test.out: tests/videoreader_test.test
LD_LIBRARY_PATH=. ./$< @srcdir@/tests/videoreader_test.mp4 && touch $@
tests/videowriter_test.out: tests/videowriter_test.test
LD_LIBRARY_PATH=. ./$< ./tests/videowriter_test.mp4 && touch $@
tests/%.out: tests/%.test
LD_LIBRARY_PATH=. ./$< && touch $@
.PHONY: examples
EXAMPLES=colourmaps distance_transform tensor_voting
EXAMPLE_PROGS=$(patsubst %,examples/%, $(EXAMPLES))
examples:$(EXAMPLE_PROGS)
$(EXAMPLE_PROGS): % : %.cc
mkdir -p $(@D) && $(CXX) $(CPPFLAGS) $(CXXFLAGS) $< -o $@ -O3 -L. -lcvd
clean:
rm -f tmp libcvd.a *.so* $(dllname) $(ddllname) $(dllimportname) $(ddllimportname)
find . -name '*.o' -o -name '*.d' | xargs rm -f
find progs/ -perm /u+x -type f | xargs rm -f
rm -rf html man
rm -f tests/*.out
rm -f tests/*.test
rm -rf $(EXAMPLE_PROGS)
include $(wildcard cvd_src/*.d)
include $(wildcard cvd_src/*/*.d)
include $(wildcard tests/*.d)