Made the dist-hook more generic for adding more files named .dist into the
[platform/upstream/curl.git] / Makefile.am
1 #
2 # $Id$
3 #
4
5 AUTOMAKE_OPTIONS = foreign
6
7 EXTRA_DIST = CHANGES COPYING maketgz reconf Makefile.dist       \
8   curl-config.in build_vms.com curl-style.el sample.emacs testcurl.sh \
9   RELEASE-NOTES
10
11 bin_SCRIPTS = curl-config
12
13 SUBDIRS = lib src
14 DIST_SUBDIRS = $(SUBDIRS) tests include packages docs
15
16 dist-hook:
17         rm -rf $(top_builddir)/tests/log
18         find $(distdir) -name "*.dist" -exec rm {} \;
19         (distit=`find $(srcdir) -name "*.dist"`; \
20         for file in $$distit; do \
21           strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \
22           cp $$file $(distdir)$$strip; \
23         done)
24
25 html:
26         cd docs; make html
27
28 pdf:
29         cd docs; make pdf
30
31 check: test
32
33 test:
34         @(cd tests; $(MAKE) all quiet-test)
35
36 test-full:
37         @(cd tests; $(MAKE) all full-test)
38
39 #
40 # Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros
41 # must contain the following line:
42 # %_topdir /home/loic/local/rpm
43 # and that /home/loic/local/rpm contains the directory SOURCES, BUILD etc.
44 #
45 # cd /home/loic/local/rpm ; mkdir -p SOURCES BUILD RPMS/i386 SPECS SRPMS
46 #
47 # If additional configure flags are needed to build the package, add the
48 # following in ~/.rpmmacros
49 # %configure CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix} ${AM_CONFIGFLAGS}
50 # and run make rpm in the following way:
51 # AM_CONFIGFLAGS='--with-uri=/home/users/loic/local/RedHat-6.2' make rpm
52 #
53
54 rpms:
55         $(MAKE) RPMDIST=curl rpm
56         $(MAKE) RPMDIST=curl-ssl rpm
57
58 rpm:
59         RPM_TOPDIR=`rpm --showrc | $(PERL) -n -e 'print if(s/.*_topdir\s+(.*)/$$1/)'` ; \
60         cp $(srcdir)/packages/Linux/RPM/$(RPMDIST).spec $$RPM_TOPDIR/SPECS ; \
61         cp $(PACKAGE)-$(VERSION).tar.gz $$RPM_TOPDIR/SOURCES ; \
62         rpm -ba --clean --rmsource $$RPM_TOPDIR/SPECS/$(RPMDIST).spec ; \
63         mv $$RPM_TOPDIR/RPMS/i386/$(RPMDIST)-*.rpm . ; \
64         mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm .
65
66 #
67 # Build a Solaris pkkgadd format file
68 # run 'make pkgadd' once you've done './configure' and 'make' to make a Solaris pkgadd format
69 # file (which ends up back in this directory).
70 # The pkgadd file is in 'pkgtrans' format, so to install on Solaris, do
71 # pkgadd -d ./HAXXcurl-*
72 #
73
74 # gak - libtool requires an absoulte directory, hence the pwd below...
75 pkgadd:
76         umask 022 ; \
77         make install DESTDIR=`/bin/pwd`/packages/Solaris/root ; \
78         cat COPYING > $(srcdir)/packages/Solaris/copyright ; \
79         cd $(srcdir)/packages/Solaris && $(MAKE) package
80
81 #
82 # Build a cygwin binary tarball installation file
83 # resulting .tar.bz2 file will end up at packages/Win32/cygwin
84 cygwinbin:
85         $(MAKE) -C packages/Win32/cygwin cygwinbin
86
87 # We extend the standard install with a custom hook:
88 install-data-hook:
89         cd include && $(MAKE) install
90         cd docs && $(MAKE) install
91
92 # We extend the standard uninstall with a custom hook:
93 uninstall-hook:
94         cd include && $(MAKE) uninstall
95         cd docs && $(MAKE) uninstall