3 # Update the dependencies in the programs main Makefile.in.
4 # Must be run in the programs/ directory of the Wine tree.
6 # Copyright 2003 Alexandre Julliard
8 # This library is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU Lesser General Public
10 # License as published by the Free Software Foundation; either
11 # version 2.1 of the License, or (at your option) any later version.
13 # This library is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # Lesser General Public License for more details.
18 # You should have received a copy of the GNU Lesser General Public
19 # License along with this library; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 # Programs that we want to install in the bin directory too
48 # Programs that we don't want to install at all
59 if (!system "cmp $file $file.new >/dev/null")
62 print "$file is unchanged\n";
66 rename "$file.new", "$file";
67 print "$file updated\n";
71 # if we are inside the programs dir, go up one level
72 if (! -f
"configure.ac" && -f
"../configure.ac") { chdir(".."); }
75 if (!@args) { @args = split /\s/, `find programs -name Makefile.in -print`; }
87 # hack to disable this program... the MKPROG_SKIP comment must appear
88 # at the very top of the Makefile.in
89 last if (/^\#\s*MKPROG_SKIP/);
91 if (/^MODULE\s*=\s*([a-zA-Z0-9_.]+)/)
94 next if ($module eq "none");
95 ($directories{$module} = $i) =~ s/^programs\/(.*)\/[^\
/]+$/$1/;
96 die "invalid module $module in dir $directories{$module}\n" if "$directories{$module}.exe" ne $module;
99 if (/^PROGRAMS\s*=((\s*[a-zA-Z0-9_.]+)+)/)
101 my @programs = split / /, $1;
102 foreach my $prog (@programs)
104 next unless $prog =~ /\.exe$/;
105 ($directories{$prog} = $i) =~ s/^\.\/(.*)\/[^\
/]+$/$1/;
113 open NEWMAKE
,">programs/Makefile.in.new" or die "cannot create programs/Makefile.in.new";
115 ################################################################
119 # Automatically generated by make_progs; DO NOT EDIT!!
121 TOPSRCDIR = \@top_srcdir\@
128 ################################################################
129 # output the subdirs list
131 # get rid of duplicates
133 foreach my $dir (sort values %directories) { $alldirs{$dir} = 1; }
135 print NEWMAKE
"SUBDIRS =";
136 foreach my $dir (sort keys %alldirs)
138 printf NEWMAKE
" \\\n\t%s", $dir;
141 print NEWMAKE
"\n\n# Sub-directories to run make install into\nINSTALLSUBDIRS =";
142 foreach my $dir (sort keys %alldirs)
144 next if $dont_install{$dir};
145 printf NEWMAKE
" \\\n\t%s", $dir;
148 print NEWMAKE
"\n\n# Programs to install in bin directory\nINSTALLPROGS =";
149 foreach my $dir (sort keys %alldirs)
151 printf NEWMAKE
" \\\n\t%s", $dir if $bin_install{$dir};
154 ################################################################
155 # output the build and install targets
160 INSTALLDIRS = \$(DESTDIR)\$(bindir)
164 all: wineapploader winelauncher \$(SUBDIRS)
166 wineapploader: wineapploader.in
167 sed -e 's,\@bindir\\\@,\$(bindir),g' \$(SRCDIR)/wineapploader.in >\$\@ || (\$(RM) \$\@ && false)
169 winelauncher: winelauncher.in
170 sed -e 's,\@bindir\\\@,\$(bindir),g' -e 's,\@libdir\\\@,\$(libdir),g' -e 's,\@dlldir\\\@,\$(dlldir),g' \$(SRCDIR)/winelauncher.in >\$\@ || (\$(RM) \$\@ && false)
172 # Rules for installation
174 .PHONY: install-apploader install-progs install-progs.so \$(INSTALLPROGS:%=%/__installprog__)
176 install-apploader: wineapploader \$(INSTALLDIRS) dummy
177 \$(INSTALL_SCRIPT) wineapploader \$(DESTDIR)\$(bindir)/wineapploader
179 \$(INSTALLPROGS:%=%/__installprog__): install-apploader
180 \$(RM) \$(DESTDIR)\$(bindir)/`dirname \$\@` && \$(LN) \$(DESTDIR)\$(bindir)/wineapploader \$(DESTDIR)\$(bindir)/`dirname \$\@`
182 install-progs.so: \$(INSTALLPROGS:%=%/__installprog__)
183 \$(RM) \$(DESTDIR)\$(bindir)/wineapploader
185 install-progs: # nothing to do here
187 install:: winelauncher install-progs\$(DLLEXT) \$(INSTALLDIRS)
188 \$(INSTALL_SCRIPT) winelauncher \$(DESTDIR)\$(bindir)/winelauncher
191 -cd \$(DESTDIR)\$(bindir) && \$(RM) wineapploader winelauncher \$(INSTALLPROGS)
192 -rmdir \$(DESTDIR)\$(dlldir)
195 \$(RM) wineapploader winelauncher
199 check test:: \$(SUBDIRS:%=%/__test__)
205 update_file
("programs/Makefile.in");
207 ################################################################
210 open GITIGNORE
, ">programs/.gitignore.new" or die "cannot create programs/.gitignore.new";
211 print GITIGNORE
"# Automatically generated by make_dlls; DO NOT EDIT!!\n";
220 foreach my $dir (sort keys %alldirs)
222 push @ignores, "$dir/$dir";
225 print GITIGNORE
join("\n", sort @ignores) . "\n";
228 update_file
("programs/.gitignore");