aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-02-18 19:22:32 +0100
committerJohn Ankarström <john@ankarstrom.se>2022-02-18 19:22:32 +0100
commit4ab717d868d2b8742999da846623b35cd7e201e0 (patch)
tree76c2ef749e9ac98def781480ab24570c5448be32 /Makefile
parent6c50f818e8a9f42921aa171e1d34265bb1f35985 (diff)
downloadEpisodeBrowser-4ab717d868d2b8742999da846623b35cd7e201e0.tar.gz
Enable building without Eclipse.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 9 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index ff7123d..6155f90 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,8 @@
-ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
+R = ../../
-C = $(ROOT)c/main.c
-OBJ != cd $(ROOT)c && ls *.c | grep -v main.c | sed 's/c$$/obj/'
-OBJ += resource.obj
-PL = $(ROOT)pl/track_episodes.pl
-PL += $(ROOT)pl/local_episodes.pl
-PL += $(ROOT)pl/episode_data.pl
+C = $(R)c/main.c
+PL = $(R)pl/track_episodes.pl $(R)pl/local_episodes.pl $(R)pl/episode_data.pl
+OBJ = common.obj datalistview.obj episodelistview.obj listview.obj resource.obj
CC = swipl-ld
CFLAGS += -DUNICODE -D_UNICODE
@@ -13,21 +10,19 @@ LDFLAGS += -lcomctl32 -luxtheme
ifeq ($(BUILD_MODE),debug)
CFLAGS += -g
-else ifeq ($(BUILD_MODE),run)
- CFLAGS += -O2 -ld-options,-mwindows
else
- $(error Build mode $(BUILD_MODE) not supported by this Makefile)
+ CFLAGS += -O2 -ld-options,-mwindows
endif
all: episode_browser.exe
-episode_browser.exe: $(C) $(OBJ) $(PL) $(ROOT)c/defs.h $(ROOT)Makefile
+episode_browser.exe: $(C) $(OBJ) $(PL) $(R)c/defs.h $(R)Makefile
$(CC) -v $(CFLAGS) $(LDFLAGS) -goal true -o $@ $(C) $(OBJ) $(PL)
-resource.obj: $(ROOT)c/resource.h $(ROOT)c/resource.rc
- windres -i $(ROOT)c/resource.rc -o resource.obj
+resource.obj: $(R)c/resource.h $(R)c/resource.rc
+ windres -i $(R)c/resource.rc -o resource.obj
-%.obj: $(ROOT)c/%.c $(ROOT)c/defs.h
+%.obj: $(R)c/%.c $(R)c/defs.h
$(CC) -c $(CFLAGS) -o $@ $<
clean: