diff options
author | Chris Dickens <christopher.a.dickens@gmail.com> | 2020-03-25 00:09:26 -0700 |
---|---|---|
committer | Chris Dickens <christopher.a.dickens@gmail.com> | 2020-03-25 00:09:26 -0700 |
commit | 4a5540a925e47923ed20b4ea68aabe550dac976d (patch) | |
tree | f95d0db794b626a025aea4af5b91d8f3e367ef28 /Makefile.am | |
parent | 07d6d3a2a5c415fa0b819ee0bdb48565f444a58a (diff) | |
download | libusb-4a5540a925e47923ed20b4ea68aabe550dac976d.tar.gz |
autotools: Fix a number of issues
Change the name of the project to be what it actually is called
everywhere: libusb-1.0. This allows the public libusb.h header file to
be tracked by automake through pkginclude_HEADERS.
Decouple the doc directory from automake. There aren't any targets that
automake understands, so the build uselessly recurses into the directory.
Update the makefile targets with the correct dependencies so that the
docs aren't regenerated unnecessarily. Update the doxygen config file to
include the version, exclude irrelevant source files and create the
output into 'api-1.0' instead of 'html'. Also fix a deprecation tag for
the libusb_get_port_path() function and add Solaris to the list of
supported platforms.
Fix the 'dist' target. Clean up the README file to remote the GitHub
Markdown and remove the .gitattributes file from the msvc directory.
Add doc/libusb.png to EXTRA_DIST.
Enhance the {dist,doc}-upload targets to look at the SF_USER environment
variable to get the SourceForge username. This allows maintainers (like
me!) to have a local username that is different from their SourceForge
username. Switch the docs-upload recipe to use rsync with --delete to
clean up obsolete files.
Fix the Windows shared library (DLL) targets. The dependencies for the
RC file were incorrect, leading to cases of missed recompilation. The
'all' rule should not be overridden, so define an 'all-local' rule when
necessary. Fix the rule for running dlltool on the just generated DLL so
that it only fires when the correct dependencies change and do not
bother to run the rule when not building a DLL.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/Makefile.am b/Makefile.am index 0155625..047be99 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,10 +1,8 @@ AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip ACLOCAL_AMFLAGS = -I m4 -DISTCLEANFILES = libusb-1.0.pc -EXTRA_DIST = TODO PORTING msvc libusb/libusb-1.0.def libusb/version_nano.h \ - examples/getopt/getopt.c examples/getopt/getopt1.c examples/getopt/getopt.h \ - android Xcode -SUBDIRS = libusb doc +EXTRA_DIST = INSTALL_WIN.txt PORTING doc/libusb.png \ + android msvc Xcode +SUBDIRS = libusb if BUILD_EXAMPLES SUBDIRS += examples @@ -14,15 +12,39 @@ if BUILD_TESTS SUBDIRS += tests endif -pkgconfigdir=$(libdir)/pkgconfig -pkgconfig_DATA=libusb-1.0.pc +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libusb-1.0.pc -.PHONY: dist-up +# The package name is libusb-1.0, but we want the distribution +# to be created as libusb-x.y.z instead of libusb-1.0-x.y.z +distdir = libusb-$(VERSION) -reldir = .release/$(distdir) -dist-up: dist +# Ensure any generated docs are cleaned out +# We need this here because make does not recurse into doc/ +clean-local: + rm -rf doc/$(DOXYGEN_HTMLDIR) + +# Use dist-hook to accomplish the following things for the dist recipe: +# 1) Remove the GitHub Markdown from the README file +# 2) Remove the .gitattributes file from the msvc directory +dist-hook: + chmod u+w $(distdir)/README $(distdir)/msvc + $(SED) -i.orig -e '/Build Status/d' $(distdir)/README + $(SED) -i.orig -e '/^$$/N;/^\n$$/D' $(distdir)/README + $(SED) -i.orig -e 's/\[\([A-Z]*\)\](\1)/\1/' $(distdir)/README + rm -f $(distdir)/README.orig + rm -f $(distdir)/msvc/.gitattributes + +.PHONY: dist-upload +dist-upload: reldir = .release/$(distdir) +dist-upload: sfurl = frs.sourceforge.net:/home/frs/project/libusb/libusb-1.0 +dist-upload: dist rm -rf $(reldir) mkdir -p $(reldir) cp $(distdir).tar.bz2 $(reldir) - rsync -rv $(reldir) frs.sourceforge.net:/home/frs/project/l/li/libusb/libusb-1.0/ + if [ -z "$$SF_USER" ]; then \ + rsync -rv $(reldir) $(sfurl); \ + else \ + rsync -rv $(reldir) $$SF_USER@$(sfurl); \ + fi rm -rf $(reldir) |