diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-26 09:10:38 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-26 09:11:35 +0200 |
commit | 3e3d8d6c13e6b4207a97aee117236b8ca70b9fbe (patch) | |
tree | 2c89e0f343d40280d0b1f715b10d4591e21725fc /makedeps | |
parent | eb7709d8617bec27349eebb43e8941b3aaaf453e (diff) | |
download | EpisodeBrowser-3e3d8d6c13e6b4207a97aee117236b8ca70b9fbe.tar.gz |
Use CMake.
I don't love it, but it makes it possible to support Visual Studio in
addition to MinGW GCC.
Diffstat (limited to 'makedeps')
-rw-r--r-- | makedeps | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/makedeps b/makedeps deleted file mode 100644 index 70589ca..0000000 --- a/makedeps +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env perl - -use v5.12; -use warnings; -use subs qw/for_includes/; - -open my $fh, ">", "deps.mk"; -print $fh "# This file is generated by makedeps.\n"; - -while (my $f = glob("c/*.cpp")) { - $f =~ s,^c/,,; - $f =~ s/\.cpp$//; - - if ($f eq "main") { print $fh "b/\$(EXE):"; } - else { print $fh "b/$f.obj:"; } - - # Print dependencies in source file. - my @deps; - for_includes "c/$f.cpp", sub { - my $f = shift; - return if grep { $_ eq $f } @deps; - push @deps, $f; - print $fh " c/$f"; - - # Print dependencies in dependency. - for_includes "c/$f", sub { - my $f = shift; - return if grep { $_ eq $f } @deps; - push @deps, $f; - print $fh " c/$f"; - } - }; - - print $fh "\n"; -} - -sub for_includes ($&) { - my $f = shift; - my $c = shift; - state %cache; - - # Retrieve dependencies from cache. - if (exists $cache{$f}) { - $c->($_) for @{$cache{$f}}; - } - - # Find dependencies in file. - else { - open my $gh, "<", $f or die "($f) $!"; - while ($_ = <$gh>) { - next if /^$/; - last if not /#/; - next if not /^#include\s*"([^"]+)"/; - push @{$cache{$f}}, $1; - $c->($1); - } - } -} |