From 09e70524f4d7ff0c4adc0b4c2d282201a2e28992 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 5 Feb 2014 13:44:51 +0100 Subject: [PATCH] makedep: Generate install rules for TrueType fonts based on pragmas in the .sfd file. --- Makefile.in | 2 +- fonts/Makefile.in | 15 +-------------- fonts/marlett.sfd | 1 + fonts/symbol.sfd | 1 + fonts/tahoma.sfd | 1 + fonts/tahomabd.sfd | 1 + fonts/wingding.sfd | 1 + tools/makedep.c | 38 ++++++++++++++++++++++++-------------- 8 files changed, 31 insertions(+), 29 deletions(-) diff --git a/Makefile.in b/Makefile.in index 2355df9e0b8..8d4dec4a39b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -43,7 +43,7 @@ distclean:: clean .PHONY: install install-lib install-dev uninstall __uninstall__ uninstall:: __uninstall__ - -rmdir $(DESTDIR)$(datadir)/wine $(DESTDIR)$(fakedlldir) $(DESTDIR)$(dlldir) $(DESTDIR)$(includedir) + -rmdir $(DESTDIR)$(fontdir) $(DESTDIR)$(datadir)/wine $(DESTDIR)$(fakedlldir) $(DESTDIR)$(dlldir) $(DESTDIR)$(includedir) # Dependencies between directories diff --git a/fonts/Makefile.in b/fonts/Makefile.in index 9a10bbfef65..9d4ea9f9f87 100644 --- a/fonts/Makefile.in +++ b/fonts/Makefile.in @@ -12,19 +12,6 @@ FONT_SRCS = \ tahomabd.sfd \ wingding.sfd -TRUETYPE_FONTS = \ - marlett.ttf \ - symbol.ttf \ - tahoma.ttf \ - tahomabd.ttf \ - wingding.ttf - # Make sure that make_makefiles sees the generated rules -clean:: - install install-lib:: - for i in $(TRUETYPE_FONTS); do $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(fontdir)/$$i || exit 1; done - -uninstall:: - -cd $(DESTDIR)$(fontdir) && $(RM) $(TRUETYPE_FONTS) - -rmdir $(DESTDIR)$(fontdir) +clean:: diff --git a/fonts/marlett.sfd b/fonts/marlett.sfd index 0b2449f833e..eba4731bcd0 100644 --- a/fonts/marlett.sfd +++ b/fonts/marlett.sfd @@ -4,6 +4,7 @@ FullName: Marlett FamilyName: Marlett Weight: Regular Copyright: Copyright (C) TransGaming Technologies. All rights reserved. +UComments: "#pragma makedep install" Version: 0.2 ItalicAngle: 0 UnderlinePosition: 0 diff --git a/fonts/symbol.sfd b/fonts/symbol.sfd index a19937e7980..f77a64b14f7 100644 --- a/fonts/symbol.sfd +++ b/fonts/symbol.sfd @@ -4,6 +4,7 @@ FullName: Symbol FamilyName: Symbol Weight: Book Copyright: WineSymbol © (Jon Parshall for CodeWeavers). 2009. +UComments: "#pragma makedep install" Version: 1.1 February 3, 2009, initial release ItalicAngle: 0 UnderlinePosition: -173 diff --git a/fonts/tahoma.sfd b/fonts/tahoma.sfd index c3bd3d809b7..47a0651f17c 100644 --- a/fonts/tahoma.sfd +++ b/fonts/tahoma.sfd @@ -4,6 +4,7 @@ FullName: Tahoma FamilyName: Tahoma Weight: Regular Copyright: Copyright (c) 2004 Larry Snyder, Based on Bitstream Vera Sans Copyright (c) 2003 by Bitstream, Inc. Font renamed in accordance with former's license. Please do not contact Bitstream Inc. for any reason regarding this font. +UComments: "#pragma makedep install" Version: 000.001 FONDName: WineTahoma DefaultBaseFilename: tahoma diff --git a/fonts/tahomabd.sfd b/fonts/tahomabd.sfd index f264481f3cd..71f372d6605 100644 --- a/fonts/tahomabd.sfd +++ b/fonts/tahomabd.sfd @@ -4,6 +4,7 @@ FullName: Tahoma Bold FamilyName: Tahoma Weight: Bold Copyright: Copyright (c) 2004 Larry Snyder, Based on Bitstream Vera Sans Copyright (c) 2003 by Bitstream, Inc. Font renamed in accordance with former's license. Please do not contact Bitstream Inc. for any reason regarding this font. +UComments: "#pragma makedep install" Version: 000.001 FONDName: WineTahomaBold DefaultBaseFilename: tahomabd diff --git a/fonts/wingding.sfd b/fonts/wingding.sfd index ed3400e0dd8..f30ffec2f97 100644 --- a/fonts/wingding.sfd +++ b/fonts/wingding.sfd @@ -4,6 +4,7 @@ FullName: Wingdings FamilyName: Wingdings Weight: Regular Copyright: Copyright (C) 2013 Dmitry Timoshkov +UComments: "#pragma makedep install" Version: 001.000 ItalicAngle: 0 UnderlinePosition: -170 diff --git a/tools/makedep.c b/tools/makedep.c index 0e6d6b6fab1..8ce9da08b5c 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -51,18 +51,19 @@ struct incl_file struct incl_file **files; }; -#define FLAG_SYSTEM 0x0001 /* is it a system include (#include ) */ -#define FLAG_GENERATED 0x0002 /* generated file */ -#define FLAG_IDL_PROXY 0x0004 /* generates a proxy (_p.c) file */ -#define FLAG_IDL_CLIENT 0x0008 /* generates a client (_c.c) file */ -#define FLAG_IDL_SERVER 0x0010 /* generates a server (_s.c) file */ -#define FLAG_IDL_IDENT 0x0020 /* generates an ident (_i.c) file */ -#define FLAG_IDL_REGISTER 0x0040 /* generates a registration (_r.res) file */ -#define FLAG_IDL_TYPELIB 0x0080 /* generates a typelib (.tlb) file */ -#define FLAG_IDL_REGTYPELIB 0x0100 /* generates a registered typelib (_t.res) file */ -#define FLAG_IDL_HEADER 0x0200 /* generates a header (.h) file */ -#define FLAG_RC_PO 0x0400 /* rc file contains translations */ -#define FLAG_C_IMPLIB 0x0800 /* file is part of an import library */ +#define FLAG_SYSTEM 0x000001 /* is it a system include (#include ) */ +#define FLAG_GENERATED 0x000002 /* generated file */ +#define FLAG_INSTALL 0x000004 /* file to install */ +#define FLAG_IDL_PROXY 0x000100 /* generates a proxy (_p.c) file */ +#define FLAG_IDL_CLIENT 0x000200 /* generates a client (_c.c) file */ +#define FLAG_IDL_SERVER 0x000400 /* generates a server (_s.c) file */ +#define FLAG_IDL_IDENT 0x000800 /* generates an ident (_i.c) file */ +#define FLAG_IDL_REGISTER 0x001000 /* generates a registration (_r.res) file */ +#define FLAG_IDL_TYPELIB 0x002000 /* generates a typelib (.tlb) file */ +#define FLAG_IDL_REGTYPELIB 0x004000 /* generates a registered typelib (_t.res) file */ +#define FLAG_IDL_HEADER 0x008000 /* generates a header (.h) file */ +#define FLAG_RC_PO 0x010000 /* rc file contains translations */ +#define FLAG_C_IMPLIB 0x020000 /* file is part of an import library */ static const struct { @@ -875,6 +876,8 @@ static void parse_pragma_directive( struct incl_file *source, char *str ) while ((p = strtok( NULL, " \t" ))) add_include( source, p, 0 ); return; } + else if (!strcmp( flag, "install" )) source->flags |= FLAG_INSTALL; + if (strendswith( source->name, ".idl" )) { if (!strcmp( flag, "header" )) source->flags |= FLAG_IDL_HEADER; @@ -1632,14 +1635,21 @@ static struct strarray output_sources(void) } else if (!strcmp( ext, "sfd" )) /* font file */ { + char *ttf_file = src_dir_path( strmake( "%s.ttf", obj )); char *fontforge = get_expanded_make_variable( "FONTFORGE" ); if (fontforge && !src_dir) { - output( "%s.ttf: %s\n", obj, source->filename ); + output( "%s: %s\n", ttf_file, source->filename ); output( "\t%s -script %s %s $@\n", fontforge, top_dir_path( "fonts/genttf.ff" ), source->filename ); } - free( fontforge ); + if (source->flags & FLAG_INSTALL) + { + output( "install install-lib::\n" ); + output( "\t$(INSTALL_DATA) %s $(DESTDIR)$(fontdir)/%s.ttf\n", ttf_file, obj ); + output( "uninstall::\n" ); + output( "\t$(RM) $(DESTDIR)$(fontdir)/%s.ttf\n", obj ); + } continue; /* no dependencies */ } else if (!strcmp( ext, "fon" )) /* bitmap font file */