# $Id$ # # rules for compiling windres resources. # # this file is automatically included if WINDRES is set. # # Variables: # # srcdir ... source directory. # WINDRES ... windows resource compiler. # ARTIFACT ... The name of the build artifact # VERSION ... The version of the build artifact, determined by common-compile.mk # ABI_VERSION ... Version of the ABI for shared libraries. # # # Include windows resources preprocessed with # __VERSION__ __COMMA_VERSION__ and __ABI_VERSION__ # OBJS:=$(OBJS) $(ARTIFACT)_res.o COMMA_VERSION=$(shell echo $(VERSION) | sed 's/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)[\.-]\([0-9][0-9]*\)\([a-z~][a-z]*[0-9][0-9]*\)\?/\1,\2,\3,\4/') ifeq ($(EXTPKGS),) EXT_WINDRESFLAGS= else EXT_WINDRESFLAGS=$(shell $(PKGCONFIG) --cflags-only-I $(EXTPKGS)) endif %_res.o: $(srcdir)/%.rc sed -e 's%__srcdir__%$(srcdir)%g' -e 's%__ARTIFACT__%$(ARTIFACT)%g' -e 's%__COMMA_VERSION__%$(COMMA_VERSION)%g' -e 's%__VERSION__%$(VERSION)%g' -e 's%__ABI_VERSION__%$(ABI_VERSION)%g' < $< > $*_res.rc $(WINDRES) $(INCLUDES) $(EXT_WINDRESFLAGS) $*_res.rc $*_res.o clean:: rm -rf $(ARTIFACT)_res.o $(ARTIFACT)_res.rc