Update to 2.0.0 tree from current Fremantle build
[opencv] / Makefile.am
1 # The top-level input Makefile for OpenCV
2
3 # tell make where aclocal finds its files in Maintainer Mode
4 ACLOCAL_AMFLAGS = -I autotools/aclocal
5
6 ## Any directories that you want built and installed should go here.
7 if BUILD_APPS
8   APPS_DIR = apps
9 else
10   APPS_DIR =
11 endif
12 SUBDIRS = 3rdparty src include utils interfaces $(APPS_DIR) tests samples data
13
14 # All the rest of the distributed files
15 EXTRA_DIST = \
16   THANKS \
17   TODO \
18   opencv.spec \
19   opencv.spec.in \
20   opencv.pc \
21   opencv.pc.in \
22   \
23   make_frameworks.sh \
24   autotools/darwin/Info.plist \
25   autotools/darwin/OpenCV.h \
26   \
27   CMakeLists.txt \
28   opencv.pc.cmake.in \
29   Package.cmake.in \
30   cmake_uninstall.cmake.in \
31   OpenCVConfig.cmake.in \
32   OpenCVFindPkgConfig.cmake \
33   OpenCVPCHSupport.cmake \
34   cvconfig.h.cmake \
35   \
36   doc
37
38 pkgconfigdir = $(libdir)/pkgconfig
39 pkgconfig_DATA = opencv.pc
40
41 # Rule to build tar-gzipped distribution package
42 $(PACKAGE)-$(VERSION).tar.gz: dist
43
44 dist-hook:
45         rm -rf `find $(distdir) -name .svn`
46
47 # Rule to build RPM distribution package
48 rpm: $(PACKAGE)-$(VERSION).tar.gz
49         rpm -ta $(PACKAGE)-$(VERSION).tar.gz
50
51 # Rule to install the libraries only - prevent rebuilding apps
52 install-lib:
53         cd src && $(MAKE) install-libLTLIBRARIES
54
55 # Run ldconfig after installing the library:
56 install-exec-hook:
57         -ldconfig
58
59 # rule that gets added to the clean target by Automake
60 clean-local: clean-framework
61
62
63 # FRAMEWORK ###################################################################
64 #
65 # The following section is dedicated to Darwin / Mac OS X framework builds.
66 # It currently creates a private framework (see Apple documentation) that
67 # cannot be placed to the /Library/Framework locations but is intended to get
68 # copied into application bundles.
69 #
70 # You should usually not invoke this target directly but use the shell script
71 # 'make_frameworks.sh' instead that will create the most sensible
72 # default installation (universal build).
73 #
74 # See: http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/
75 #
76
77 FRAMEWORK_NAME = OpenCV
78 FRAMEWORK_VERSION = B
79 FRAMEWORK_CURRENT_VERSION = 0
80 FRAMEWORK_COMPAT_VERSION = 0
81
82 # install path to be set in calling script
83 # FRAMEWORK_INSTALL_PATH = executable_path/../Frameworks
84
85 # architecture to be set in calling script
86 # FRAMEWORK_ARCH = i386
87
88 FRAMEWORK_INSTALL_NAME = $(FRAMEWORK_INSTALL_PATH)/$(FRAMEWORK_NAME).framework/Versions/$(FRAMEWORK_VERSION)/$(FRAMEWORK_NAME)
89
90 FRAMEWORK_XHEADERS = \
91   $(top_srcdir)/autotools/darwin/OpenCV.h     \
92   $(top_srcdir)/include/opencv/cv.h           \
93   $(top_srcdir)/include/opencv/cv.hpp         \
94   $(top_srcdir)/include/opencv/cvaux.h        \
95   $(top_srcdir)/include/opencv/cvaux.hpp      \
96   $(top_srcdir)/include/opencv/cvcompat.h     \
97   $(top_srcdir)/include/opencv/cvstreams.h    \
98   $(top_srcdir)/include/opencv/cvtypes.h      \
99   $(top_srcdir)/include/opencv/cvver.h        \
100   $(top_srcdir)/include/opencv/cvvidsurv.hpp  \
101   $(top_srcdir)/include/opencv/cvwimage.h     \
102   $(top_srcdir)/include/opencv/cxcore.h       \
103   $(top_srcdir)/include/opencv/cxcore.hpp     \
104   $(top_srcdir)/include/opencv/cxerror.h      \
105   $(top_srcdir)/include/opencv/cxflann.h      \
106   $(top_srcdir)/include/opencv/cxmat.hpp      \
107   $(top_srcdir)/include/opencv/cxmisc.h       \
108   $(top_srcdir)/include/opencv/cxoperations.hpp \
109   $(top_srcdir)/include/opencv/cxtypes.h      \
110   $(top_srcdir)/include/opencv/highgui.h      \
111   $(top_srcdir)/include/opencv/highgui.hpp    \
112   $(top_srcdir)/include/opencv/ml.h
113
114
115 FRAMEWORK_OFILES = \
116   $(top_builddir)/3rdparty/.libs/lib_clapack.a  \
117   $(top_builddir)/3rdparty/.libs/lib_flann.a    \
118   $(top_builddir)/src/.libs/lib_cxcore.a        \
119   $(top_builddir)/src/.libs/lib_cv.a            \
120   $(top_builddir)/src/.libs/lib_cvaux.a         \
121   $(top_builddir)/src/.libs/lib_ml.a            \
122   $(top_builddir)/src/.libs/lib_highgui.a
123
124 FRAMEWORK_XLIBRARIES = -lz -framework Carbon -framework QuickTime -framework QuartzCore
125
126 FRAMEWORK_DOCUMENTATION = 
127 #\
128 #  $(top_srcdir)/doc/license.txt \
129 #  $(top_srcdir)/doc/index.htm   \
130 #  $(top_srcdir)/doc/faq.htm     \
131 #  $(top_srcdir)/doc/ref
132
133 FMWK_CC = g++-4.2 -fopenmp -dynamiclib -all_load -Wl,-single_module -Wl,-Y,100
134
135 framework: all clean-framework
136         @echo "Setting up framework directories..."
137         mkdir -p $(FRAMEWORK_NAME).framework
138         mkdir -p $(FRAMEWORK_NAME).framework/Versions
139         mkdir -p $(FRAMEWORK_NAME).framework/Versions/$(FRAMEWORK_VERSION)
140         mkdir -p $(FRAMEWORK_NAME).framework/Versions/$(FRAMEWORK_VERSION)/Resources
141         mkdir -p $(FRAMEWORK_NAME).framework/Versions/$(FRAMEWORK_VERSION)/Headers
142         mkdir -p $(FRAMEWORK_NAME).framework/Versions/$(FRAMEWORK_VERSION)/Documentation
143         @echo "Creating framework symlinks..."
144         ln -s $(FRAMEWORK_VERSION)               $(FRAMEWORK_NAME).framework/Versions/Current
145         ln -s Versions/Current/Headers           $(FRAMEWORK_NAME).framework/Headers
146         ln -s Versions/Current/Resources         $(FRAMEWORK_NAME).framework/Resources
147         ln -s Versions/Current/Documentation     $(FRAMEWORK_NAME).framework/Documentation
148         ln -s Versions/Current/$(FRAMEWORK_NAME) $(FRAMEWORK_NAME).framework/$(FRAMEWORK_NAME)
149         @echo "Building framework data..."
150         $(FMWK_CC) \
151                 -arch $(FRAMEWORK_ARCH) \
152                 -compatibility_version $(FRAMEWORK_COMPAT_VERSION) \
153                 -current_version $(FRAMEWORK_CURRENT_VERSION) \
154                 -install_name $(FRAMEWORK_INSTALL_NAME) \
155                 -o $(FRAMEWORK_NAME).framework/Versions/Current/$(FRAMEWORK_NAME) \
156                 $(FRAMEWORK_OFILES) $(FRAMEWORK_XLIBRARIES)
157         strip -x $(FRAMEWORK_NAME).framework/Versions/Current/$(FRAMEWORK_NAME)
158         cp $(FRAMEWORK_XHEADERS) $(FRAMEWORK_NAME).framework/Headers/
159         cp $(top_srcdir)/autotools/darwin/Info.plist $(FRAMEWORK_NAME).framework/Resources/
160
161 #       cp -r $(FRAMEWORK_DOCUMENTATION) $(FRAMEWORK_NAME).framework/Documentation/
162
163 clean-framework:
164         rm -rf $(FRAMEWORK_NAME).framework build_i386 build_ppc build_x86_64 build_ppc64