Daniel Drake | f46716f | 2009-08-27 21:14:54 +0545 | [diff] [blame] | 1 | AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip |
Daniel Drake | 8be2560 | 2009-06-13 17:19:07 +0100 | [diff] [blame] | 2 | ACLOCAL_AMFLAGS = -I m4 |
Chris Dickens | 4a5540a | 2020-03-25 00:09:26 -0700 | [diff] [blame] | 3 | EXTRA_DIST = INSTALL_WIN.txt PORTING doc/libusb.png \ |
| 4 | android msvc Xcode |
| 5 | SUBDIRS = libusb |
Daniel Drake | 852bba4 | 2007-11-28 13:48:45 +0000 | [diff] [blame] | 6 | |
| 7 | if BUILD_EXAMPLES |
| 8 | SUBDIRS += examples |
| 9 | endif |
| 10 | |
Toby Gray | 21cf6e4 | 2012-11-21 14:00:31 +0000 | [diff] [blame] | 11 | if BUILD_TESTS |
| 12 | SUBDIRS += tests |
| 13 | endif |
| 14 | |
Chris Dickens | 4a5540a | 2020-03-25 00:09:26 -0700 | [diff] [blame] | 15 | pkgconfigdir = $(libdir)/pkgconfig |
| 16 | pkgconfig_DATA = libusb-1.0.pc |
Daniel Drake | 852bba4 | 2007-11-28 13:48:45 +0000 | [diff] [blame] | 17 | |
Chris Dickens | 4a5540a | 2020-03-25 00:09:26 -0700 | [diff] [blame] | 18 | # The package name is libusb-1.0, but we want the distribution |
| 19 | # to be created as libusb-x.y.z instead of libusb-1.0-x.y.z |
| 20 | distdir = libusb-$(VERSION) |
Daniel Drake | 852bba4 | 2007-11-28 13:48:45 +0000 | [diff] [blame] | 21 | |
Chris Dickens | 4a5540a | 2020-03-25 00:09:26 -0700 | [diff] [blame] | 22 | # Ensure any generated docs are cleaned out |
| 23 | # We need this here because make does not recurse into doc/ |
| 24 | clean-local: |
| 25 | rm -rf doc/$(DOXYGEN_HTMLDIR) |
| 26 | |
| 27 | # Use dist-hook to accomplish the following things for the dist recipe: |
| 28 | # 1) Remove the GitHub Markdown from the README file |
| 29 | # 2) Remove the .gitattributes file from the msvc directory |
| 30 | dist-hook: |
| 31 | chmod u+w $(distdir)/README $(distdir)/msvc |
| 32 | $(SED) -i.orig -e '/Build Status/d' $(distdir)/README |
| 33 | $(SED) -i.orig -e '/^$$/N;/^\n$$/D' $(distdir)/README |
| 34 | $(SED) -i.orig -e 's/\[\([A-Z]*\)\](\1)/\1/' $(distdir)/README |
| 35 | rm -f $(distdir)/README.orig |
| 36 | rm -f $(distdir)/msvc/.gitattributes |
| 37 | |
Chris Dickens | 60c8395 | 2020-04-09 12:30:57 -0700 | [diff] [blame] | 38 | reldir = .release/$(distdir) |
| 39 | sfurl = frs.sourceforge.net:/home/frs/project/libusb/libusb-1.0 |
Chris Dickens | 4a5540a | 2020-03-25 00:09:26 -0700 | [diff] [blame] | 40 | .PHONY: dist-upload |
Chris Dickens | 4a5540a | 2020-03-25 00:09:26 -0700 | [diff] [blame] | 41 | dist-upload: dist |
Daniel Drake | f46716f | 2009-08-27 21:14:54 +0545 | [diff] [blame] | 42 | rm -rf $(reldir) |
| 43 | mkdir -p $(reldir) |
| 44 | cp $(distdir).tar.bz2 $(reldir) |
Chris Dickens | 4a5540a | 2020-03-25 00:09:26 -0700 | [diff] [blame] | 45 | if [ -z "$$SF_USER" ]; then \ |
| 46 | rsync -rv $(reldir) $(sfurl); \ |
| 47 | else \ |
| 48 | rsync -rv $(reldir) $$SF_USER@$(sfurl); \ |
| 49 | fi |
Daniel Drake | f46716f | 2009-08-27 21:14:54 +0545 | [diff] [blame] | 50 | rm -rf $(reldir) |