diff options
author | John Ankarström <john@ankarstrom.se> | 2022-07-15 13:42:31 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-07-15 13:42:31 +0200 |
commit | 6034fe23fdcf607ecf53bb97223d84864b3af461 (patch) | |
tree | 924ed6ba0759b6240574da143c3e6d100dbfa80f /makedeps.pl | |
parent | f1f9743e14e2da5345824380d8eeb1d5b4e7c810 (diff) | |
download | EpisodeBrowser-6034fe23fdcf607ecf53bb97223d84864b3af461.tar.gz |
Add makedeps.pl.
Diffstat (limited to 'makedeps.pl')
-rw-r--r-- | makedeps.pl | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/makedeps.pl b/makedeps.pl new file mode 100644 index 0000000..8956e81 --- /dev/null +++ b/makedeps.pl @@ -0,0 +1,20 @@ +#!/usr/bin/env perl + +use strict; +use warnings; + +open my $fh, ">", "deps.mk"; +print $fh "# This file is generated by makedeps.pl.\n"; +while (my $f = glob("c/*.cpp")) { + open my $gh, "<", $f; + $f =~ s,^c/,,; + $f =~ s/\.cpp$//; + print $fh "b/$f.obj: c/$f.cpp"; + while ($_ = <$gh>) { + next if /^$/; + goto n if not /#/; + print $fh " c/$1" if /^#include\s+"([^"]+)"/; + } + n: + print $fh "\n"; +} |