aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile16
-rw-r--r--makedeps (renamed from makedeps.pl)6
2 files changed, 14 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index df0a190..8a50d02 100644
--- a/Makefile
+++ b/Makefile
@@ -1,26 +1,26 @@
-C = c/main.cpp
-PL = pl/cfg.pl pl/episode_data.pl pl/local_episodes.pl pl/track_episodes.pl
+EXE = EpisodeBrowser.exe
OBJ = b/common.obj b/datalistview.obj b/episodelistview.obj b/listview.obj b/pl.obj b/resource.obj
+PL = pl/cfg.pl pl/episode_data.pl pl/local_episodes.pl pl/track_episodes.pl
CC = swipl-ld
CFLAGS += -Wall -Wpedantic -O -cc-options,-std=c++17 -ld-options,-mwindows
CFLAGS += -DUNICODE -D_UNICODE
LDFLAGS += -lcomctl32 -luxtheme
-all: b/EpisodeBrowser.exe
+all: b/$(EXE)
cp $< "C:\Users\John\Desktop\Delat"
clean:
- rm -fr b/EpisodeBrowser.exe b/*.obj
+ rm -fr b/$(EXE) b/*.obj
TAGS: c/*.cpp c/*.h pl/*.pl
etags c/*.cpp c/*.h -lprolog pl/*.pl
deps.mk: c/*.cpp
- perl makedeps.pl
+ perl makedeps
-b/EpisodeBrowser.exe: Makefile deps.mk $(C) $(OBJ) $(PL) c/*.h
- $(CC) -v $(CFLAGS) $(LDFLAGS) -goal true -o $@ $(C) $(OBJ) $(PL)
+b/$(EXE): Makefile deps.mk c/main.cpp $(OBJ) $(PL)
+ $(CC) -v $(CFLAGS) $(LDFLAGS) -goal true -o $@ c/main.cpp $(OBJ) $(PL)
b/resource.obj: c/resource.h c/resource.rc c/application.manifest
windres -i c/resource.rc -o b/resource.obj
@@ -28,4 +28,6 @@ b/resource.obj: c/resource.h c/resource.rc c/application.manifest
b/%.obj: c/%.cpp
$(CC) -c $(CFLAGS) -o $@ $<
+# deps.mk includes additional, dynamically generated dependencies for
+# b/*.obj and b/EpisodeBrowser.exe.
-include deps.mk
diff --git a/makedeps.pl b/makedeps
index 8956e81..4cfa1ac 100644
--- a/makedeps.pl
+++ b/makedeps
@@ -9,7 +9,11 @@ while (my $f = glob("c/*.cpp")) {
open my $gh, "<", $f;
$f =~ s,^c/,,;
$f =~ s/\.cpp$//;
- print $fh "b/$f.obj: c/$f.cpp";
+ if ($f eq "main") {
+ print $fh "b/\$(EXE):";
+ } else {
+ print $fh "b/$f.obj:";
+ }
while ($_ = <$gh>) {
next if /^$/;
goto n if not /#/;