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. --- Build.bat | 4 ++-- Makefile | 23 +++++++++++++---------- Run.bat | 9 +++++---- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Build.bat b/Build.bat index c31e286..9f4f21d 100644 --- a/Build.bat +++ b/Build.bat @@ -1,2 +1,2 @@ -@cd %~dp0\build\default -@make -f ../../Makefile || pause \ No newline at end of file +@cd %~dp0 +@make || pause 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 diff --git a/Run.bat b/Run.bat index 6fce8d8..0ff4974 100644 --- a/Run.bat +++ b/Run.bat @@ -1,4 +1,5 @@ -@cd %~dp0\build\default -@make -f ../../Makefile || pause && exit -@cd %TEMP% -@%~dp0\build\default\EpisodeBrowser.exe \ No newline at end of file +@cd %~dp0 +@make || pause && exit +@pushd %TEMP% +@%~dp0\build\default\EpisodeBrowser.exe +@popd -- cgit v1.2.3