Move the sources to trunk
[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 = cxcore cv cvaux ml otherlibs utils interfaces $(APPS_DIR) tests samples data docs
13
14 # All the rest of the distributed files
15 #EXTRA_DIST = THANKS COPYING INSTALL README NEWS ChangeLog \
16 EXTRA_DIST = THANKS TODO \
17              opencv.spec opencv.spec.in opencv.pc.in opencv.pc \
18              _make apps filters make_frameworks.sh
19
20 pkgconfigdir = $(libdir)/pkgconfig
21 pkgconfig_DATA = opencv.pc
22
23 # The directory where the include files will be installed
24 libcvincludedir = $(includedir)/opencv
25
26 # Which header files to install
27 libcvinclude_HEADERS =
28
29 # Rule to build tar-gzipped distribution package
30 $(PACKAGE)-$(VERSION).tar.gz: dist
31
32 dist-hook:
33         rm -rf `find $(distdir) -name CVS`
34         chmod u+x $(srcdir)/utils/unix2dos.py
35         find $(distdir) -name *.dsw -exec $(srcdir)/utils/unix2dos.py {} \;
36         find $(distdir) -name *.dsp -exec $(srcdir)/utils/unix2dos.py {} \;
37
38 # Rule to build RPM distribution package
39 rpm: $(PACKAGE)-$(VERSION).tar.gz
40         rpm -ta $(PACKAGE)-$(VERSION).tar.gz
41
42 # Rule to force automake to rebuild the library
43 changed:
44         @echo "This build target is no longer necessary"
45
46 # Rule to install the libraries only - prevent rebuilding apps
47 install-lib:
48         cd src && $(MAKE) install-libLTLIBRARIES
49
50 # Run ldconfig after installing the library:
51 install-exec-hook:
52         -ldconfig
53
54 # rule that gets added to the clean target by Automake
55 clean-local: clean-framework
56
57
58 # FRAMEWORK ###################################################################
59 #
60 # The following section is dedicated to Darwin / Mac OS X framework builds.
61 # It currently creates a private framework (see Apple documentation) that
62 # cannot be placed to the /Library/Framework locations but is intended to get
63 # copied into application bundles.
64
65 # You should usually not invoke this target directly but use the shell script
66 # 'make_frameworks.sh' instead that will create the most sensible
67 # default installation (universal build).
68
69 # See: http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/
70
71
72 FRAMEWORK_NAME = OpenCV
73 FRAMEWORK_VERSION = A
74 FRAMEWORK_CURRENT_VERSION = 1
75 FRAMEWORK_COMPAT_VERSION = 1
76
77 # install path to be set in calling script
78 # FRAMEWORK_INSTALL_PATH = executable_path/../Frameworks
79
80 # architecture to be set in calling script
81 # FRAMEWORK_ARCH = i386
82
83 FRAMEWORK_INSTALL_NAME = $(FRAMEWORK_INSTALL_PATH)/$(FRAMEWORK_NAME).framework/Versions/$(FRAMEWORK_VERSION)/$(FRAMEWORK_NAME)
84
85 FRAMEWORK_XHEADERS = \
86   $(top_srcdir)/autotools/darwin/OpenCV.h     \
87   $(top_srcdir)/cxcore/include/cxcore.h       \
88   $(top_srcdir)/cxcore/include/cxerror.h      \
89   $(top_srcdir)/cxcore/include/cxtypes.h      \
90   $(top_srcdir)/cxcore/include/cxmisc.h       \
91   $(top_srcdir)/cxcore/include/cxcore.hpp     \
92   $(top_srcdir)/cxcore/include/cvver.h        \
93   $(top_srcdir)/cv/include/cv.h               \
94   $(top_srcdir)/cv/include/cvcompat.h         \
95   $(top_srcdir)/cv/include/cvtypes.h          \
96   $(top_srcdir)/cv/include/cv.hpp             \
97   $(top_srcdir)/cvaux/include/cvaux.h         \
98   $(top_srcdir)/cvaux/include/cvmat.hpp       \
99   $(top_srcdir)/cvaux/include/cvaux.hpp       \
100   $(top_srcdir)/cvaux/include/cvvidsurv.hpp   \
101   $(top_srcdir)/ml/include/ml.h               \
102   $(top_srcdir)/otherlibs/highgui/highgui.h
103
104 FRAMEWORK_OFILES = \
105   $(top_builddir)/cxcore/src/.libs/lib_cxcore.a  \
106   $(top_builddir)/cv/src/.libs/lib_cv.a          \
107   $(top_builddir)/cvaux/src/.libs/lib_cvaux.a    \
108   $(top_builddir)/ml/src/.libs/lib_ml.a          \
109   $(top_builddir)/otherlibs/highgui/.libs/lib_highgui.a
110
111 FRAMEWORK_XLIBRARIES = -framework Carbon -framework QuickTime -framework QuartzCore
112
113 FRAMEWORK_DOCUMENTATION = \
114   $(top_srcdir)/docs/license.txt \
115   $(top_srcdir)/docs/index.htm   \
116   $(top_srcdir)/docs/faq.htm     \
117   $(top_srcdir)/docs/ref
118
119 FMWK_CC = g++ -dynamiclib -all_load -Wl,-single_module -Wl,-Y,100
120
121 framework: all clean-framework
122         @echo "Setting up framework directories..."
123         mkdir -p $(FRAMEWORK_NAME).framework
124         mkdir -p $(FRAMEWORK_NAME).framework/Versions
125         mkdir -p $(FRAMEWORK_NAME).framework/Versions/$(FRAMEWORK_VERSION)
126         mkdir -p $(FRAMEWORK_NAME).framework/Versions/$(FRAMEWORK_VERSION)/Resources
127         mkdir -p $(FRAMEWORK_NAME).framework/Versions/$(FRAMEWORK_VERSION)/Headers
128         mkdir -p $(FRAMEWORK_NAME).framework/Versions/$(FRAMEWORK_VERSION)/Documentation
129         @echo "Creating framework symlinks..."
130         ln -s $(FRAMEWORK_VERSION)               $(FRAMEWORK_NAME).framework/Versions/Current
131         ln -s Versions/Current/Headers           $(FRAMEWORK_NAME).framework/Headers
132         ln -s Versions/Current/Resources         $(FRAMEWORK_NAME).framework/Resources
133         ln -s Versions/Current/Documentation     $(FRAMEWORK_NAME).framework/Documentation
134         ln -s Versions/Current/$(FRAMEWORK_NAME) $(FRAMEWORK_NAME).framework/$(FRAMEWORK_NAME)
135         @echo "Building framework data..."
136         $(FMWK_CC) \
137                 -arch $(FRAMEWORK_ARCH) \
138                 -compatibility_version $(FRAMEWORK_COMPAT_VERSION) \
139                 -current_version $(FRAMEWORK_CURRENT_VERSION) \
140                 -install_name $(FRAMEWORK_INSTALL_NAME) \
141                 -o $(FRAMEWORK_NAME).framework/Versions/Current/$(FRAMEWORK_NAME) \
142                 $(FRAMEWORK_OFILES) $(FRAMEWORK_XLIBRARIES)
143         strip -x $(FRAMEWORK_NAME).framework/Versions/Current/$(FRAMEWORK_NAME)
144         cp $(FRAMEWORK_XHEADERS) $(FRAMEWORK_NAME).framework/Headers/
145         cp -r $(FRAMEWORK_DOCUMENTATION) $(FRAMEWORK_NAME).framework/Documentation/
146         cp $(top_srcdir)/autotools/darwin/Info.plist $(FRAMEWORK_NAME).framework/Resources/
147
148 clean-framework:
149         rm -rf $(FRAMEWORK_NAME).framework