aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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: