From 481316f44fed66f2b3a425396bad4f931a8fc413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Fri, 1 Apr 2022 01:03:42 +0200 Subject: Rework build system. The Makefile was originally written for Eclipse, but I no longer use Eclipse. --- Makefile | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 85873c0..2b16b1f 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ -R = ../../ +B = build/default/ -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 +C = c/main.c +PL = pl/track_episodes.pl pl/local_episodes.pl pl/episode_data.pl +OBJ = $(B)common.obj $(B)datalistview.obj $(B)episodelistview.obj $(B)listview.obj $(B)resource.obj CC = swipl-ld CFLAGS += -DUNICODE -D_UNICODE @@ -14,16 +14,19 @@ else CFLAGS += -O -ld-options,-mwindows endif -all: EpisodeBrowser.exe +all: $(B)EpisodeBrowser.exe -EpisodeBrowser.exe: $(C) $(OBJ) $(PL) $(R)c/defs.h $(R)Makefile +$(B)EpisodeBrowser.exe: $(C) $(OBJ) $(PL) c/defs.h Makefile $(CC) -v $(CFLAGS) $(LDFLAGS) -goal true -o $@ $(C) $(OBJ) $(PL) -resource.obj: $(R)c/resource.h $(R)c/resource.rc - windres -i $(R)c/resource.rc -o resource.obj +$(B)resource.obj: c/resource.h c/resource.rc + windres -i c/resource.rc -o $(B)resource.obj -%.obj: $(R)c/%.c $(R)c/defs.h +$(B)%.obj: c/%.c c/defs.h $(CC) -c $(CFLAGS) -o $@ $< +TAGS: c/*.c c/*.h + etags $^ + clean: - rm -fr EpisodeBrowser.exe *.obj + rm -fr $(B)EpisodeBrowser.exe $(B)*.obj -- cgit v1.2.3