aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build.bat4
-rw-r--r--Makefile23
-rw-r--r--Run.bat9
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