makefiles: Add support for .x template files.

This commit is contained in:
Alexandre Julliard 2011-05-05 15:02:25 +02:00
parent e8859699e8
commit 0435b5825e
4 changed files with 33 additions and 5 deletions

View File

@ -27,7 +27,7 @@ IDL_GEN_HEADERS = $(IDL_H_SRCS:.idl=.h) $(IDL_C_SRCS:.idl=.h) $(IDL_I_SRCS:.idl=
CLEAN_FILES = *.o *.a *.so *.ln *.res *.fake *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej *.flc core CLEAN_FILES = *.o *.a *.so *.ln *.res *.fake *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej *.flc core
CLEAN_TARGETS = $(IDL_GEN_C_SRCS) $(IDL_GEN_HEADERS) $(IDL_TLB_SRCS:.idl=.tlb) $(IDL_P_SRCS:%=dlldata.c) \ CLEAN_TARGETS = $(IDL_GEN_C_SRCS) $(IDL_GEN_HEADERS) $(IDL_TLB_SRCS:.idl=.tlb) $(IDL_P_SRCS:%=dlldata.c) \
$(BISON_SRCS:.y=.tab.c) $(BISON_SRCS:.y=.tab.h) $(LEX_SRCS:.l=.yy.c) \ $(BISON_SRCS:.y=.tab.c) $(BISON_SRCS:.y=.tab.h) $(LEX_SRCS:.l=.yy.c) \
$(PO_SRCS:%=rsrc.pot) $(MC_SRCS:%=msg.pot) $(PO_SRCS:%=rsrc.pot) $(MC_SRCS:%=msg.pot) $(XTEMPLATE_SRCS:.x=.h)
OBJS = $(C_SRCS:.c=.o) $(BISON_SRCS:.y=.tab.o) $(LEX_SRCS:.l=.yy.o) $(IDL_GEN_C_SRCS:.c=.o) \ OBJS = $(C_SRCS:.c=.o) $(BISON_SRCS:.y=.tab.o) $(LEX_SRCS:.l=.yy.o) $(IDL_GEN_C_SRCS:.c=.o) \
$(IDL_R_SRCS:.idl=_r.res) $(RC_SRCS:.rc=.res) $(MC_SRCS:.mc=.res) $(EXTRA_OBJS) $(IDL_R_SRCS:.idl=_r.res) $(RC_SRCS:.rc=.res) $(MC_SRCS:.mc=.res) $(EXTRA_OBJS)

View File

@ -110,6 +110,7 @@ IDL_TLB_SRCS = \
SRCDIR_INCLUDES = \ SRCDIR_INCLUDES = \
$(IDL_TLB_SRCS) \ $(IDL_TLB_SRCS) \
$(PUBLIC_IDL_H_SRCS) \ $(PUBLIC_IDL_H_SRCS) \
$(XTEMPLATE_SRCS) \
accctrl.h \ accctrl.h \
access.idl \ access.idl \
aclapi.h \ aclapi.h \
@ -575,9 +576,9 @@ IDL_H_SRCS = $(PUBLIC_IDL_H_SRCS) $(PRIVATE_IDL_H_SRCS)
@MAKE_RULES@ @MAKE_RULES@
OBJDIR_INCLUDES = $(PUBLIC_IDL_H_SRCS:.idl=.h) OBJDIR_INCLUDES = $(PUBLIC_IDL_H_SRCS:.idl=.h) $(XTEMPLATE_SRCS:.x=.h)
all: $(IDL_H_SRCS:.idl=.h) $(IDL_TLB_SRCS:.idl=.tlb) all: $(IDL_H_SRCS:.idl=.h) $(IDL_TLB_SRCS:.idl=.tlb) $(XTEMPLATE_SRCS:.x=.h)
install install-dev:: $(OBJDIR_INCLUDES) $(INSTALLDIRS) install install-dev:: $(OBJDIR_INCLUDES) $(INSTALLDIRS)
for f in $(SRCDIR_INCLUDES); do case $$f in \ for f in $(SRCDIR_INCLUDES); do case $$f in \

View File

@ -122,6 +122,7 @@ my @ignore_srcs = (
[ 'IDL_S_SRCS', '\.idl', '_s.c' ], [ 'IDL_S_SRCS', '\.idl', '_s.c' ],
[ 'PUBLIC_IDL_H_SRCS', '\.idl', '.h' ], [ 'PUBLIC_IDL_H_SRCS', '\.idl', '.h' ],
[ 'PRIVATE_IDL_H_SRCS', '\.idl', '.h' ], [ 'PRIVATE_IDL_H_SRCS', '\.idl', '.h' ],
[ 'XTEMPLATE_SRCS', '\.x', '.h' ],
); );
my %exported_wine_headers = ( my %exported_wine_headers = (
@ -362,6 +363,7 @@ sub assign_sources_to_makefiles(@)
if ($name =~ /stdole2\.idl$/) { push @{${$make}{"=IDL_TLB_SRCS"}}, $name; } if ($name =~ /stdole2\.idl$/) { push @{${$make}{"=IDL_TLB_SRCS"}}, $name; }
elsif ($private_idl_headers{$name}) { push @{${$make}{"=SRCDIR_INCLUDES"}}, $name; } elsif ($private_idl_headers{$name}) { push @{${$make}{"=SRCDIR_INCLUDES"}}, $name; }
elsif ($name =~ /\.h$/) { push @{${$make}{"=SRCDIR_INCLUDES"}}, $name; } elsif ($name =~ /\.h$/) { push @{${$make}{"=SRCDIR_INCLUDES"}}, $name; }
elsif ($name =~ /\.x$/) { push @{${$make}{"=XTEMPLATE_SRCS"}}, $name; }
elsif ($name =~ /\.rh$/) { push @{${$make}{"=SRCDIR_INCLUDES"}}, $name; } elsif ($name =~ /\.rh$/) { push @{${$make}{"=SRCDIR_INCLUDES"}}, $name; }
elsif ($name =~ /\.inl$/) { push @{${$make}{"=SRCDIR_INCLUDES"}}, $name; } elsif ($name =~ /\.inl$/) { push @{${$make}{"=SRCDIR_INCLUDES"}}, $name; }
elsif ($name =~ /\.idl$/) { push @{${$make}{"=PUBLIC_IDL_H_SRCS"}}, $name; } elsif ($name =~ /\.idl$/) { push @{${$make}{"=PUBLIC_IDL_H_SRCS"}}, $name; }
@ -386,6 +388,7 @@ sub assign_sources_to_makefiles(@)
# add extra variables to include source list # add extra variables to include source list
my $make = $makefiles{"include/Makefile"}; my $make = $makefiles{"include/Makefile"};
unshift @{${$make}{"=SRCDIR_INCLUDES"}}, "\$(XTEMPLATE_SRCS)";
unshift @{${$make}{"=SRCDIR_INCLUDES"}}, "\$(PUBLIC_IDL_H_SRCS)"; unshift @{${$make}{"=SRCDIR_INCLUDES"}}, "\$(PUBLIC_IDL_H_SRCS)";
unshift @{${$make}{"=SRCDIR_INCLUDES"}}, "\$(IDL_TLB_SRCS)"; unshift @{${$make}{"=SRCDIR_INCLUDES"}}, "\$(IDL_TLB_SRCS)";
} }
@ -492,6 +495,7 @@ sub update_makefiles(@)
replace_makefile_variable( $file, "PRIVATE_IDL_H_SRCS" ); replace_makefile_variable( $file, "PRIVATE_IDL_H_SRCS" );
replace_makefile_variable( $file, "PUBLIC_IDL_H_SRCS" ); replace_makefile_variable( $file, "PUBLIC_IDL_H_SRCS" );
replace_makefile_variable( $file, "IDL_TLB_SRCS" ); replace_makefile_variable( $file, "IDL_TLB_SRCS" );
replace_makefile_variable( $file, "XTEMPLATE_SRCS" );
replace_makefile_variable( $file, "SRCDIR_INCLUDES" ); replace_makefile_variable( $file, "SRCDIR_INCLUDES" );
replace_makefile_variable( $file, "EXTRASUBDIRS" ); replace_makefile_variable( $file, "EXTRASUBDIRS" );
} }

View File

@ -471,6 +471,28 @@ static FILE *open_include_file( INCL_FILE *pFile )
free( filename ); free( filename );
} }
/* check for corresponding .x file in global includes */
if (strendswith( pFile->name, "tmpl.h" ))
{
if (top_src_dir)
filename = strmake( "%s/include/%.*s.x",
top_src_dir, strlen(pFile->name) - 2, pFile->name );
else if (top_obj_dir)
filename = strmake( "%s/include/%.*s.x",
top_obj_dir, strlen(pFile->name) - 2, pFile->name );
else
filename = NULL;
if (filename && (file = fopen( filename, "r" )))
{
pFile->sourcename = filename;
pFile->filename = strmake( "%s/include/%s", top_obj_dir, pFile->name );
return file;
}
free( filename );
}
/* now try in global includes */ /* now try in global includes */
if (top_obj_dir) if (top_obj_dir)
{ {
@ -761,9 +783,10 @@ static void parse_file( INCL_FILE *pFile, int src )
return; return;
} }
/* don't try to open .tlb or .res files */ /* don't try to open certain types of files */
if (strendswith( pFile->name, ".tlb" ) || if (strendswith( pFile->name, ".tlb" ) ||
strendswith( pFile->name, ".res" )) strendswith( pFile->name, ".res" ) ||
strendswith( pFile->name, ".x" ))
{ {
pFile->filename = xstrdup( pFile->name ); pFile->filename = xstrdup( pFile->name );
return; return;