automake: Add extra Makefile to handle unknown automake targets
Automake does not know how to compile Windows Resource files, so we have
manually told automake how to do this. One particular short-coming is
that dependencies are not automatically generated and tracked as they
are with other known automake targets. Address this by creating an extra
makefile that contains the automake rules needed for building source for
Windows targets. This also includes outputting more accurate tags during
compilation instead of using the generic "GEN" tag.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
diff --git a/libusb/Makefile.am b/libusb/Makefile.am
index 8b89ee6..9432c62 100644
--- a/libusb/Makefile.am
+++ b/libusb/Makefile.am
@@ -75,16 +75,16 @@
if OS_WINDOWS
OS_SRC = $(OS_WINDOWS_SRC)
-.rc.lo:
- $(AM_V_GEN)$(LIBTOOL) $(AM_V_lt) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) $(RCFLAGS) -i $< -o $@
+include Makefile.am.extra
-libusb-1.0.lo: libusb-1.0.rc version.h version_nano.h
+# Dependencies for compiling libusb-1.0.lo from libusb-1.0.rc
+-include ./$(DEPDIR)/libusb-1.0.Plo
if CREATE_IMPORT_LIB
all-local: .libs/libusb-1.0.dll.a
# Rebuild the import lib from the .def so that MS and MinGW DLLs can be interchanged
.libs/libusb-1.0.dll.a: libusb-1.0.def libusb-1.0.la
- $(AM_V_GEN)$(DLLTOOL) $(DLLTOOLFLAGS) --kill-at --input-def $< --dllname libusb-1.0.dll --output-lib $@
+ $(AM_V_DLLTOOL)$(DLLTOOL) $(DLLTOOLFLAGS) --kill-at --input-def $< --dllname libusb-1.0.dll --output-lib $@
endif
endif
diff --git a/libusb/Makefile.am.extra b/libusb/Makefile.am.extra
new file mode 100644
index 0000000..a5c1490
--- /dev/null
+++ b/libusb/Makefile.am.extra
@@ -0,0 +1,26 @@
+AM_V_DLLTOOL = $(am__v_DLLTOOL_$(V))
+am__v_DLLTOOL_ = $(am__v_DLLTOOL_$(AM_DEFAULT_VERBOSITY))
+am__v_DLLTOOL_0 = @echo " DLLTOOL " $@;
+am__v_DLLTOOL_1 =
+
+AM_V_RC = $(am__v_RC_$(V))
+am__v_RC_ = $(am__v_RC_$(AM_DEFAULT_VERBOSITY))
+am__v_RC_0 = @echo " RC " $@;
+am__v_RC_1 =
+
+LTRC = $(LIBTOOL) $(AM_V_lt) --tag=RC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(RC) $(AM_RCFLAGS) \
+ $(RCFLAGS)
+
+RCPPARGS = \
+ --preprocessor-arg -MT \
+ --preprocessor-arg $@ \
+ --preprocessor-arg -MD \
+ --preprocessor-arg -MP \
+ --preprocessor-arg -MF \
+ --preprocessor-arg $$depbase.Tpo
+
+.rc.lo:
+ $(AM_V_RC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+ $(LTRC) $(RCPPARGS) -i $< -o $@ &&\
+ $(am__mv) $$depbase.Tpo $$depbase.Plo
diff --git a/libusb/strerror.c b/libusb/strerror.c
old mode 100755
new mode 100644
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 36ce541..6281b80 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 11485
+#define LIBUSB_NANO 11486