aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-02-13 13:25:39 +0100
committerJohn Ankarström <john@ankarstrom.se>2022-02-13 13:25:39 +0100
commit92f7852b6979239214848b7ebb4046d52e4aba06 (patch)
treedf49eb01bc34c2acebdc3ad42f505cdb64afdae9 /Makefile
downloadEpisodeBrowser-92f7852b6979239214848b7ebb4046d52e4aba06.tar.gz
Begin Win32 re-implementation.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 31 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..bf04586
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,31 @@
+PROJECT_ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
+
+INPUTS = $(PROJECT_ROOT)win.c
+INPUTS += $(PROJECT_ROOT)track_episodes.pl
+INPUTS += $(PROJECT_ROOT)local_episodes.pl
+INPUTS += $(PROJECT_ROOT)episode_data.pl
+
+ifeq ($(BUILD_MODE),debug)
+ CFLAGS += -g
+else ifeq ($(BUILD_MODE),run)
+ CFLAGS += -O2
+else ifeq ($(BUILD_MODE),linuxtools)
+ CFLAGS += -g -pg -fprofile-arcs -ftest-coverage
+ LDFLAGS += -pg -fprofile-arcs -ftest-coverage
+ EXTRA_CLEAN += episode_browser.gcda episode_browser.gcno $(PROJECT_ROOT)gmon.out
+ EXTRA_CMDS = rm -rf episode_browser.gcda
+else
+ $(error Build mode $(BUILD_MODE) not supported by this Makefile)
+endif
+
+all: episode_browser.exe
+
+episode_browser.exe: $(INPUTS)
+ swipl-ld -v $(CFLAGS) $(LDFLAGS) -goal true -o $@ $(INPUTS)
+ $(EXTRA_CMDS)
+
+#%.o: $(PROJECT_ROOT)%.c
+# $(CC) -c $(CFLAGS) -o $@ $<
+
+clean:
+ rm -fr episode_browser.exe $(EXTRA_CLEAN)