aboutsummaryrefslogtreecommitdiff
path: root/makedeps
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-07-15 16:57:15 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-07-15 16:57:15 +0200
commitd00f8b35b4838ba7c6bf00b7b211f463810f4ae5 (patch)
treeee9d04eb06d2871d75b72cd7b7705ef061eaaede /makedeps
parentf61e83d936ebab185b09682f922aa58734153761 (diff)
downloadEpisodeBrowser-d00f8b35b4838ba7c6bf00b7b211f463810f4ae5.tar.gz
Improve makedeps script.
Diffstat (limited to 'makedeps')
-rw-r--r--makedeps24
1 files changed, 24 insertions, 0 deletions
diff --git a/makedeps b/makedeps
new file mode 100644
index 0000000..4cfa1ac
--- /dev/null
+++ b/makedeps
@@ -0,0 +1,24 @@
+#!/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$//;
+ if ($f eq "main") {
+ print $fh "b/\$(EXE):";
+ } else {
+ print $fh "b/$f.obj:";
+ }
+ while ($_ = <$gh>) {
+ next if /^$/;
+ goto n if not /#/;
+ print $fh " c/$1" if /^#include\s+"([^"]+)"/;
+ }
+ n:
+ print $fh "\n";
+}