makedep: Generate rules for bitmap fonts based on pragmas in the .sfd file.

This commit is contained in:
Alexandre Julliard 2014-02-05 12:15:07 +01:00
parent 00aeadc6b6
commit 1cccb5594a
9 changed files with 109 additions and 240 deletions

View File

@ -12,58 +12,6 @@ FONT_SRCS = \
tahomabd.sfd \ tahomabd.sfd \
wingding.sfd wingding.sfd
BITMAP_FONTS = \
coue1255.fon \
coue1256.fon \
coue1257.fon \
coure.fon \
couree.fon \
coureg.fon \
courer.fon \
couret.fon \
cvgasys.fon \
hvgasys.fon \
jsmalle.fon \
jvgafix.fon \
jvgasys.fon \
smalle.fon \
smallee.fon \
smalleg.fon \
smaller.fon \
smallet.fon \
smae1255.fon \
smae1256.fon \
smae1257.fon \
sserife.fon \
sserifee.fon \
sserifeg.fon \
sserifer.fon \
sserifet.fon \
sseriff.fon \
sseriffe.fon \
sseriffg.fon \
sseriffr.fon \
sserifft.fon \
ssee1255.fon \
ssee1256.fon \
ssee1257.fon \
ssee874.fon \
ssef1255.fon \
ssef1256.fon \
ssef1257.fon \
ssef874.fon \
svgasys.fon \
vgafix.fon \
vgasys.fon \
vgasyse.fon \
vgasysg.fon \
vgasysr.fon \
vgasyst.fon \
vgas1255.fon \
vgas1256.fon \
vgas1257.fon \
vgas874.fon
TRUETYPE_FONTS = \ TRUETYPE_FONTS = \
marlett.ttf \ marlett.ttf \
symbol.ttf \ symbol.ttf \
@ -71,168 +19,12 @@ TRUETYPE_FONTS = \
tahomabd.ttf \ tahomabd.ttf \
wingding.ttf wingding.ttf
EXTRA_TARGETS = $(BITMAP_FONTS) # Make sure that make_makefiles sees the generated rules
clean::
all: $(BITMAP_FONTS) install install-lib::
coure.fon: $(srcdir)/courier.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/courier.ttf 13,1252,8
couree.fon: $(srcdir)/courier.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/courier.ttf 13,1250,8
courer.fon: $(srcdir)/courier.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/courier.ttf 13,1251,8
coureg.fon: $(srcdir)/courier.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/courier.ttf 13,1253,8
couret.fon: $(srcdir)/courier.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/courier.ttf 13,1254,8
coue1255.fon: $(srcdir)/courier.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/courier.ttf 13,1255,8
coue1256.fon: $(srcdir)/courier.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/courier.ttf 13,1256,8
coue1257.fon: $(srcdir)/courier.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/courier.ttf 13,1257,8
vgafix.fon: $(srcdir)/fixedsys.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/fixedsys.ttf 15,1252,8
jvgafix.fon: $(srcdir)/fixedsys_jp.ttf
$(SFNT2FNT) -o $@ -d 160 $(srcdir)/fixedsys_jp.ttf 18,932,8
sserife.fon: $(srcdir)/ms_sans_serif.ttf
$(SFNT2FNT) -o $@ -d 129 $(srcdir)/ms_sans_serif.ttf 13,1252,5 16,1252,7 20,1252,8
sseriff.fon: $(srcdir)/ms_sans_serif.ttf
$(SFNT2FNT) -o $@ -r 120 -d 129 $(srcdir)/ms_sans_serif.ttf 16,1252,7 20,1252,8
sserifee.fon: $(srcdir)/ms_sans_serif.ttf
$(SFNT2FNT) -o $@ -d 129 $(srcdir)/ms_sans_serif.ttf 13,1250,5 16,1250,7
sseriffe.fon: $(srcdir)/ms_sans_serif.ttf
$(SFNT2FNT) -o $@ -r 120 -d 129 $(srcdir)/ms_sans_serif.ttf 16,1250,7
sserifer.fon: $(srcdir)/ms_sans_serif.ttf
$(SFNT2FNT) -o $@ -d 129 $(srcdir)/ms_sans_serif.ttf 13,1251,5 16,1251,7 20,1251,8
sseriffr.fon: $(srcdir)/ms_sans_serif.ttf
$(SFNT2FNT) -o $@ -r 120 -d 129 $(srcdir)/ms_sans_serif.ttf 16,1251,7 20,1251,8
sserifeg.fon: $(srcdir)/ms_sans_serif.ttf
$(SFNT2FNT) -o $@ -d 129 $(srcdir)/ms_sans_serif.ttf 13,1253,5 16,1253,7 20,1253,8
sseriffg.fon: $(srcdir)/ms_sans_serif.ttf
$(SFNT2FNT) -o $@ -r 120 -d 129 $(srcdir)/ms_sans_serif.ttf 16,1253,7 20,1253,8
sserifet.fon: $(srcdir)/ms_sans_serif.ttf
$(SFNT2FNT) -o $@ -d 129 $(srcdir)/ms_sans_serif.ttf 13,1254,5 16,1254,7 20,1254,8
sserifft.fon: $(srcdir)/ms_sans_serif.ttf
$(SFNT2FNT) -o $@ -r 120 -d 129 $(srcdir)/ms_sans_serif.ttf 16,1254,7 20,1254,8
ssee1255.fon: $(srcdir)/ms_sans_serif.ttf
$(SFNT2FNT) -o $@ -d 129 $(srcdir)/ms_sans_serif.ttf 13,1255,5 16,1255,7 20,1255,8
ssef1255.fon: $(srcdir)/ms_sans_serif.ttf
$(SFNT2FNT) -o $@ -r 120 -d 129 $(srcdir)/ms_sans_serif.ttf 16,1255,7 20,1255,8
ssee1256.fon: $(srcdir)/ms_sans_serif.ttf
$(SFNT2FNT) -o $@ -d 129 $(srcdir)/ms_sans_serif.ttf 13,1256,5 16,1256,7 20,1256,8
ssef1256.fon: $(srcdir)/ms_sans_serif.ttf
$(SFNT2FNT) -o $@ -r 120 -d 129 $(srcdir)/ms_sans_serif.ttf 16,1256,7 20,1256,8
ssee1257.fon: $(srcdir)/ms_sans_serif.ttf
$(SFNT2FNT) -o $@ -d 129 $(srcdir)/ms_sans_serif.ttf 13,1257,5 16,1257,7 20,1257,8
ssef1257.fon: $(srcdir)/ms_sans_serif.ttf
$(SFNT2FNT) -o $@ -r 120 -d 129 $(srcdir)/ms_sans_serif.ttf 16,1257,7 20,1257,8
ssee874.fon: $(srcdir)/ms_sans_serif.ttf
$(SFNT2FNT) -o $@ -d 129 $(srcdir)/ms_sans_serif.ttf 13,874,5 16,874,7 20,874,8
ssef874.fon: $(srcdir)/ms_sans_serif.ttf
$(SFNT2FNT) -o $@ -r 120 -d 129 $(srcdir)/ms_sans_serif.ttf 16,874,7 20,874,8
smalle.fon: $(srcdir)/small_fonts.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/small_fonts.ttf 11,1252,5
smallee.fon: $(srcdir)/small_fonts.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/small_fonts.ttf 11,1250,5
smaller.fon: $(srcdir)/small_fonts.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/small_fonts.ttf 11,1251,5
smalleg.fon: $(srcdir)/small_fonts.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/small_fonts.ttf 11,1253,5
smallet.fon: $(srcdir)/small_fonts.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/small_fonts.ttf 11,1254,5
smae1255.fon: $(srcdir)/small_fonts.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/small_fonts.ttf 11,1255,5
smae1256.fon: $(srcdir)/small_fonts.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/small_fonts.ttf 11,1256,5
smae1257.fon: $(srcdir)/small_fonts.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/small_fonts.ttf 11,1257,5
jsmalle.fon: $(srcdir)/small_fonts_jp.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/small_fonts_jp.ttf 11,932,7
vgasys.fon: $(srcdir)/system.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/system.ttf 16,1252,7
vgasyse.fon: $(srcdir)/system.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/system.ttf 16,1250,7
vgasysr.fon: $(srcdir)/system.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/system.ttf 16,1251,7
vgasysg.fon: $(srcdir)/system.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/system.ttf 16,1253,7
vgasyst.fon: $(srcdir)/system.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/system.ttf 16,1254,7
vgas1255.fon: $(srcdir)/system.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/system.ttf 16,1255,7
vgas1256.fon: $(srcdir)/system.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/system.ttf 16,1256,7
vgas1257.fon: $(srcdir)/system.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/system.ttf 16,1257,7
vgas874.fon: $(srcdir)/system.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/system.ttf 16,874,7
jvgasys.fon: $(srcdir)/system.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/system.ttf 18,932,8
svgasys.fon: $(srcdir)/system.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/system.ttf 16,936,7 16,1252,7
hvgasys.fon: $(srcdir)/system.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/system.ttf 16,949,7
cvgasys.fon: $(srcdir)/system.ttf
$(SFNT2FNT) -o $@ -d 128 $(srcdir)/system.ttf 16,950,7 16,1252,7
$(BITMAP_FONTS): $(SFNT2FNT)
.PHONY: install install-lib uninstall
install install-lib:: $(BITMAP_FONTS)
for i in $(BITMAP_FONTS); do $(INSTALL_DATA) $$i $(DESTDIR)$(fontdir)/$$i || exit 1; done
for i in $(TRUETYPE_FONTS); do $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(fontdir)/$$i || exit 1; done for i in $(TRUETYPE_FONTS); do $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(fontdir)/$$i || exit 1; done
uninstall:: uninstall::
-cd $(DESTDIR)$(fontdir) && $(RM) $(BITMAP_FONTS) $(TRUETYPE_FONTS) -cd $(DESTDIR)$(fontdir) && $(RM) $(TRUETYPE_FONTS)
-rmdir $(DESTDIR)$(fontdir) -rmdir $(DESTDIR)$(fontdir)

View File

@ -4,6 +4,7 @@ FullName: Courier
FamilyName: Courier FamilyName: Courier
Weight: Medium Weight: Medium
Copyright: Copyright (C) 2004 Huw D M Davies, Dmitry Timoshkov Copyright: Copyright (C) 2004 Huw D M Davies, Dmitry Timoshkov
UComments: "#pragma makedep font coue1255.fon -d 128 13,1255,8+AAoA#pragma makedep font coue1256.fon -d 128 13,1256,8+AAoA#pragma makedep font coue1257.fon -d 128 13,1257,8+AAoA#pragma makedep font coure.fon -d 128 13,1252,8+AAoA#pragma makedep font couree.fon -d 128 13,1250,8+AAoA#pragma makedep font coureg.fon -d 128 13,1253,8+AAoA#pragma makedep font courer.fon -d 128 13,1251,8+AAoA#pragma makedep font couret.fon -d 128 13,1254,8"
Version: 001.000 Version: 001.000
ItalicAngle: 0 ItalicAngle: 0
UnderlinePosition: -100 UnderlinePosition: -100

View File

@ -4,6 +4,7 @@ FullName: Fixedsys
FamilyName: Fixedsys FamilyName: Fixedsys
Weight: Medium Weight: Medium
Copyright: Copyright (C) 2013 Huw D M Davies, Dmitry Timoshkov, et al. Copyright: Copyright (C) 2013 Huw D M Davies, Dmitry Timoshkov, et al.
UComments: "#pragma makedep font vgafix.fon -d 128 15,1252,8"
Version: 001.000 Version: 001.000
ItalicAngle: 0 ItalicAngle: 0
UnderlinePosition: -100 UnderlinePosition: -100

View File

@ -4,6 +4,7 @@ FullName: FixedSys
FamilyName: FixedSys FamilyName: FixedSys
Weight: Medium Weight: Medium
Copyright: Copyright (C) 2013 Huw D M Davies, Dmitry Timoshkov, et al. Copyright: Copyright (C) 2013 Huw D M Davies, Dmitry Timoshkov, et al.
UComments: "#pragma makedep font jvgafix.fon -d 160 18,932,8"
Version: 001.000 Version: 001.000
ItalicAngle: 0 ItalicAngle: 0
UnderlinePosition: -1 UnderlinePosition: -1

View File

@ -4,6 +4,7 @@ FullName: MS Sans Serif
FamilyName: MS Sans Serif FamilyName: MS Sans Serif
Weight: Medium Weight: Medium
Copyright: Copyright (C) 2004 Huw D M Davies, Dmitry Timoshkov Copyright: Copyright (C) 2004 Huw D M Davies, Dmitry Timoshkov
UComments: "#pragma makedep font ssee1255.fon -d 129 13,1255,5 16,1255,7 20,1255,8+AAoA#pragma makedep font ssee1256.fon -d 129 13,1256,5 16,1256,7 20,1256,8+AAoA#pragma makedep font ssee1257.fon -d 129 13,1257,5 16,1257,7 20,1257,8+AAoA#pragma makedep font ssee874.fon -d 129 13,874,5 16,874,7 20,874,8+AAoA#pragma makedep font ssef1255.fon -d 129 -r 120 16,1255,7 20,1255,8+AAoA#pragma makedep font ssef1256.fon -d 129 -r 120 16,1256,7 20,1256,8+AAoA#pragma makedep font ssef1257.fon -d 129 -r 120 16,1257,7 20,1257,8+AAoA#pragma makedep font ssef874.fon -d 129 -r 120 16,874,7 20,874,8+AAoA#pragma makedep font sserife.fon -d 129 13,1252,5 16,1252,7 20,1252,8+AAoA#pragma makedep font sserifee.fon -d 129 13,1250,5 16,1250,7+AAoA#pragma makedep font sserifeg.fon -d 129 13,1253,5 16,1253,7 20,1253,8 +AAoA#pragma makedep font sserifer.fon -d 129 13,1251,5 16,1251,7 20,1251,8+AAoA#pragma makedep font sserifet.fon -d 129 13,1254,5 16,1254,7 20,1254,8+AAoA#pragma makedep font sseriff.fon -d 129 -r 120 16,1252,7 20,1252,8+AAoA#pragma makedep font sseriffe.fon -d 129 -r 120 16,1250,7+AAoA#pragma makedep font sseriffg.fon -d 129 -r 120 16,1253,7 20,1253,8 +AAoA#pragma makedep font sseriffr.fon -d 129 -r 120 16,1251,7 20,1251,8+AAoA#pragma makedep font sserifft.fon -d 129 -r 120 16,1254,7 20,1254,8"
Version: 001.000 Version: 001.000
ItalicAngle: 0 ItalicAngle: 0
UnderlinePosition: -100 UnderlinePosition: -100

View File

@ -4,6 +4,7 @@ FullName: Small Fonts
FamilyName: Small Fonts FamilyName: Small Fonts
Weight: Medium Weight: Medium
Copyright: Copyright (C) 2006 Huw D M Davies, Dmitry Timoshkov Copyright: Copyright (C) 2006 Huw D M Davies, Dmitry Timoshkov
UComments: "#pragma makedep font smae1255.fon -d 128 11,1255,5+AAoA#pragma makedep font smae1256.fon -d 128 11,1256,5+AAoA#pragma makedep font smae1257.fon -d 128 11,1257,5+AAoA#pragma makedep font smalle.fon -d 128 11,1252,5+AAoA#pragma makedep font smallee.fon -d 128 11,1250,5+AAoA#pragma makedep font smalleg.fon -d 128 11,1253,5+AAoA#pragma makedep font smaller.fon -d 128 11,1251,5+AAoA#pragma makedep font smallet.fon -d 128 11,1254,5"
Version: 001.000 Version: 001.000
ItalicAngle: 0 ItalicAngle: 0
UnderlinePosition: -100 UnderlinePosition: -100

View File

@ -4,6 +4,7 @@ FullName: Small Fonts
FamilyName: Small Fonts FamilyName: Small Fonts
Weight: Medium Weight: Medium
Copyright: Copyright (C) 2006 Huw D M Davies, Dmitry Timoshkov, Aric Stewart Copyright: Copyright (C) 2006 Huw D M Davies, Dmitry Timoshkov, Aric Stewart
UComments: "#pragma makedep font jsmalle.fon -d 128 11,932,7"
Version: 001.000 Version: 001.000
ItalicAngle: 0 ItalicAngle: 0
UnderlinePosition: -100 UnderlinePosition: -100

View File

@ -4,6 +4,7 @@ FullName: System
FamilyName: System FamilyName: System
Weight: Bold Weight: Bold
Copyright: Copyright (C) 2004 Huw D M Davies, Dmitry Timoshkov Copyright: Copyright (C) 2004 Huw D M Davies, Dmitry Timoshkov
UComments: "#pragma makedep font cvgasys.fon -d 128 16,950,7 16,1252,7+AAoA#pragma makedep font hvgasys.fon -d 128 16,949,7+AAoA#pragma makedep font jvgasys.fon -d 128 18,932,8+AAoA#pragma makedep font svgasys.fon -d 128 16,936,7 16,1252,7+AAoA#pragma makedep font vgas1255.fon -d 128 16,1255,7+AAoA#pragma makedep font vgas1256.fon -d 128 16,1256,7+AAoA#pragma makedep font vgas1257.fon -d 128 16,1257,7+AAoA#pragma makedep font vgas874.fon -d 128 16,874,7+AAoA#pragma makedep font vgasys.fon -d 128 16,1252,7+AAoA#pragma makedep font vgasyse.fon -d 128 16,1250,7+AAoA#pragma makedep font vgasysg.fon -d 128 16,1253,7+AAoA#pragma makedep font vgasysr.fon -d 128 16,1251,7+AAoA#pragma makedep font vgasyst.fon -d 128 16,1254,7"
Version: 001.000 Version: 001.000
ItalicAngle: 0 ItalicAngle: 0
UnderlinePosition: -100 UnderlinePosition: -100

View File

@ -41,6 +41,7 @@ struct incl_file
char *name; char *name;
char *filename; char *filename;
char *sourcename; /* source file name for generated headers */ char *sourcename; /* source file name for generated headers */
char *args; /* custom arguments for makefile rule */
struct incl_file *included_by; /* file that included this one */ struct incl_file *included_by; /* file that included this one */
int included_line; /* line where this file was included */ int included_line; /* line where this file was included */
unsigned int flags; /* flags (see below) */ unsigned int flags; /* flags (see below) */
@ -634,6 +635,26 @@ found:
} }
/*******************************************************************
* add_generated_source
*
* Add a generated source file to the list.
*/
static struct incl_file *add_generated_source( const char *name, const char *filename )
{
struct incl_file *file;
if ((file = find_src_file( name ))) return file; /* we already have it */
file = xmalloc( sizeof(*file) );
memset( file, 0, sizeof(*file) );
file->name = xstrdup( name );
file->filename = xstrdup( filename ? filename : name );
file->flags = FLAG_GENERATED;
list_add_tail( &sources, &file->entry );
return file;
}
/******************************************************************* /*******************************************************************
* open_file * open_file
*/ */
@ -869,6 +890,19 @@ static void parse_pragma_directive( struct incl_file *source, char *str )
{ {
if (!strcmp( flag, "po" )) source->flags |= FLAG_RC_PO; if (!strcmp( flag, "po" )) source->flags |= FLAG_RC_PO;
} }
else if (strendswith( source->name, ".sfd" ))
{
if (!strcmp( flag, "font" ))
{
struct incl_file *file;
char *obj = strtok( NULL, " \t" );
if (!strendswith( obj, ".fon" )) return;
file = add_generated_source( obj, NULL );
file->sourcename = replace_extension( source->name, ".sfd", ".ttf" );
file->args = xstrdup( strtok( NULL, "" ));
return;
}
}
else if (!strcmp( flag, "implib" )) source->flags |= FLAG_C_IMPLIB; else if (!strcmp( flag, "implib" )) source->flags |= FLAG_C_IMPLIB;
} }
} }
@ -1045,7 +1079,45 @@ static void parse_in_file( struct incl_file *source, FILE *file )
if (!(p = strtok( buffer, " \t" ))) continue; /* .TH */ if (!(p = strtok( buffer, " \t" ))) continue; /* .TH */
if (!(p = strtok( NULL, " \t" ))) continue; /* program name */ if (!(p = strtok( NULL, " \t" ))) continue; /* program name */
if (!(p = strtok( NULL, " \t" ))) continue; /* man section */ if (!(p = strtok( NULL, " \t" ))) continue; /* man section */
source->sourcename = xstrdup( p ); /* abuse source name to store section */ source->args = xstrdup( p );
return;
}
}
/*******************************************************************
* parse_sfd_file
*/
static void parse_sfd_file( struct incl_file *source, FILE *file )
{
char *p, *eol, *buffer;
input_line = 0;
while ((buffer = get_line( file )))
{
if (strncmp( buffer, "UComments:", 10 )) continue;
p = buffer + 10;
while (*p == ' ') p++;
if (p[0] == '"' && p[1] && buffer[strlen(buffer) - 1] == '"')
{
p++;
buffer[strlen(buffer) - 1] = 0;
}
while ((eol = strstr( p, "+AAoA" )))
{
*eol = 0;
while (*p && isspace(*p)) p++;
if (*p++ == '#')
{
while (*p && isspace(*p)) p++;
if (!strncmp( p, "pragma", 6 )) parse_pragma_directive( source, p + 6 );
}
p = eol + 5;
}
while (*p && isspace(*p)) p++;
if (*p++ != '#') return;
while (*p && isspace(*p)) p++;
if (!strncmp( p, "pragma", 6 )) parse_pragma_directive( source, p + 6 );
return; return;
} }
} }
@ -1083,6 +1155,8 @@ static void parse_file( struct incl_file *source, int src )
parse_rc_file( source, file ); parse_rc_file( source, file );
else if (strendswith( source->filename, ".in" )) else if (strendswith( source->filename, ".in" ))
parse_in_file( source, file ); parse_in_file( source, file );
else if (strendswith( source->filename, ".sfd" ))
parse_sfd_file( source, file );
fclose(file); fclose(file);
input_file_name = NULL; input_file_name = NULL;
} }
@ -1251,26 +1325,6 @@ static void parse_makefile(void)
} }
/*******************************************************************
* add_generated_source
*
* Add a generated source file to the list.
*/
static struct incl_file *add_generated_source( const char *name, const char *filename )
{
struct incl_file *file;
if ((file = find_src_file( name ))) return file; /* we already have it */
file = xmalloc( sizeof(*file) );
memset( file, 0, sizeof(*file) );
file->name = xstrdup( name );
file->filename = xstrdup( filename ? filename : name );
file->flags = FLAG_GENERATED;
list_add_tail( &sources, &file->entry );
return file;
}
/******************************************************************* /*******************************************************************
* add_generated_sources * add_generated_sources
*/ */
@ -1550,26 +1604,26 @@ static struct strarray output_sources(void)
} }
else if (!strcmp( ext, "in" )) /* .in file or man page */ else if (!strcmp( ext, "in" )) /* .in file or man page */
{ {
if (strendswith( obj, ".man" ) && source->sourcename) if (strendswith( obj, ".man" ) && source->args)
{ {
char *dir, *dest = replace_extension( obj, ".man", "" ); char *dir, *dest = replace_extension( obj, ".man", "" );
char *lang = strchr( dest, '.' ); char *lang = strchr( dest, '.' );
char *section = source->args;
if (lang) if (lang)
{ {
*lang++ = 0; *lang++ = 0;
dir = strmake( "$(DESTDIR)$(mandir)/%s/man%s", lang, source->sourcename ); dir = strmake( "$(DESTDIR)$(mandir)/%s/man%s", lang, section );
} }
else dir = strmake( "$(DESTDIR)$(mandir)/man%s", source->sourcename ); else dir = strmake( "$(DESTDIR)$(mandir)/man%s", section );
output( "install-man-pages:: %s\n", obj ); output( "install-man-pages:: %s\n", obj );
output( "\t$(INSTALL_DATA) %s %s/%s.%s\n", output( "\t$(INSTALL_DATA) %s %s/%s.%s\n", obj, dir, dest, section );
obj, dir, dest, source->sourcename );
output( "uninstall::\n" ); output( "uninstall::\n" );
output( "\t$(RM) %s/%s.%s\n", output( "\t$(RM) %s/%s.%s\n", dir, dest, section );
dir, dest, source->sourcename );
free( dest ); free( dest );
free( dir ); free( dir );
strarray_add( &all_targets, xstrdup(obj) ); strarray_add( &all_targets, xstrdup(obj) );
strarray_add_uniq( &phony_targets, "install-man-pages" ); strarray_add_uniq( &phony_targets, "install-man-pages" );
strarray_add_uniq( &phony_targets, "uninstall" );
} }
else strarray_add( &clean_files, xstrdup(obj) ); else strarray_add( &clean_files, xstrdup(obj) );
output( "%s: %s\n", obj, source->filename ); output( "%s: %s\n", obj, source->filename );
@ -1588,6 +1642,22 @@ static struct strarray output_sources(void)
free( fontforge ); free( fontforge );
continue; /* no dependencies */ continue; /* no dependencies */
} }
else if (!strcmp( ext, "fon" )) /* bitmap font file */
{
strarray_add( &all_targets, source->name );
output( "%s.fon: %s %s\n", obj, tools_dir_path( "sfnt2fnt" ),
src_dir_path( source->sourcename ));
output( "\t%s -o $@ %s %s\n", tools_dir_path( "sfnt2fnt" ),
src_dir_path( source->sourcename ), source->args );
output( "install install-lib:: %s\n", source->name );
output( "\t$(INSTALL_DATA) %s $(DESTDIR)$(fontdir)/%s\n", source->name, source->name );
output( "uninstall::\n" );
output( "\t$(RM) $(DESTDIR)$(fontdir)/%s\n", source->name );
strarray_add_uniq( &phony_targets, "install" );
strarray_add_uniq( &phony_targets, "install-lib" );
strarray_add_uniq( &phony_targets, "uninstall" );
continue; /* no dependencies */
}
else if (!strcmp( ext, "svg" )) /* svg file */ else if (!strcmp( ext, "svg" )) /* svg file */
{ {
char *convert = get_expanded_make_variable( "CONVERT" ); char *convert = get_expanded_make_variable( "CONVERT" );