From 56572787ae2d7e113e36d5347b3d7263b35bdf98 Mon Sep 17 00:00:00 2001 From: James Almer Date: Thu, 5 Dec 2013 17:50:14 -0300 Subject: Add Windows resource file support for shared libraries Originally written by James Almer With the following contributions by Timothy Gu * Use descriptions of libraries from the pkg-config file generation function * Use "FFmpeg Project" as CompanyName (suggested by Alexander Strasser) * Use "FFmpeg" for ProductName as MSDN says "name of the product with which the file is distributed" [1]. * Use FFmpeg's version (N-xxxxx-gxxxxxxx) for ProductVersion per MSDN [1]. * Only build the .rc files when --enable-small is not enabled. [1] http://msdn.microsoft.com/en-us/library/windows/desktop/aa381058.aspx Signed-off-by: James Almer Signed-off-by: Michael Niedermayer --- common.mak | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'common.mak') diff --git a/common.mak b/common.mak index 2a59826a67..3a59953147 100644 --- a/common.mak +++ b/common.mak @@ -10,7 +10,7 @@ ifndef SUBDIR ifndef V Q = @ ECHO = printf "$(1)\t%s\n" $(2) -BRIEF = CC CXX HOSTCC HOSTLD AS YASM AR LD STRIP CP +BRIEF = CC CXX HOSTCC HOSTLD AS YASM AR LD STRIP CP WINDRES SILENT = DEPCC DEPHOSTCC DEPAS DEPYASM RANLIB RM MSG = $@ @@ -60,6 +60,9 @@ COMPILE_HOSTC = $(call COMPILE,HOSTCC) %_host.o: %.c $(COMPILE_HOSTC) +%.o: %.rc + $(WINDRES) $(IFLAGS) -o $@ $< + %.i: %.c $(CC) $(CCFLAGS) $(CC_E) $< @@ -86,6 +89,7 @@ endif include $(SRC_PATH)/arch.mak OBJS += $(OBJS-yes) +SLIBOBJS += $(SLIBOBJS-yes) FFLIBS := $(FFLIBS-yes) $(FFLIBS) TESTPROGS += $(TESTPROGS-yes) @@ -94,6 +98,7 @@ FFEXTRALIBS := $(LDLIBS:%=$(LD_LIB)) $(EXTRALIBS) EXAMPLES := $(EXAMPLES:%=$(SUBDIR)%-example$(EXESUF)) OBJS := $(sort $(OBJS:%=$(SUBDIR)%)) +SLIBOBJS := $(sort $(SLIBOBJS:%=$(SUBDIR)%)) TESTOBJS := $(TESTOBJS:%=$(SUBDIR)%) $(TESTPROGS:%=$(SUBDIR)%-test.o) TESTPROGS := $(TESTPROGS:%=$(SUBDIR)%-test$(EXESUF)) HOSTOBJS := $(HOSTPROGS:%=$(SUBDIR)%.o) @@ -125,10 +130,11 @@ $(HOSTPROGS): %$(HOSTEXESUF): %.o $(OBJS): | $(sort $(dir $(OBJS))) $(HOBJS): | $(sort $(dir $(HOBJS))) $(HOSTOBJS): | $(sort $(dir $(HOSTOBJS))) +$(SLIBOBJS): | $(sort $(dir $(SLIBOBJS))) $(TESTOBJS): | $(sort $(dir $(TESTOBJS))) $(TOOLOBJS): | tools -OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(TESTOBJS)) +OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SLIBOBJS) $(TESTOBJS)) CLEANSUFFIXES = *.d *.o *~ *.h.c *.map *.ver *.ho *.gcno *.gcda DISTCLEANSUFFIXES = *.pc -- cgit v1.2.3