Skip to content

Commit 5f3fcfd

Browse files
committed
Allow incremental builds using inference rules
1 parent a846575 commit 5f3fcfd

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

MacOS/makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ $(APP_BUNDLE): $(APP_EXE) $(SDL_LIB) resources/Kiwi8.icns src/Info.plist
6363
# Update directory timestamp so Make knows bundle is up-to-date
6464
@touch $(APP_BUNDLE)
6565

66-
# Pattern rules for different source file types
66+
# Pattern rules for incremental compilation
6767
%.o: ../Core/%.cc
6868
$(CC) $(CFLAGS) $(INCS) -c $< -o $@
6969

Windows/makefile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,15 @@ $(SDL_LIB):
5353
$(SDL_DLL): $(SDL_LIB)
5454
@REM DLL is created by same script that creates LIB
5555

56-
$(OBJS): $(CORE_SRCS) $(IMGUI_SRCS) $(WINDOWS_SRCS)
57-
$(CC) $(CFLAGS) /c $(INCS) $(CORE_SRCS) $(IMGUI_SRCS) $(WINDOWS_SRCS)
56+
# Inference rules for incremental compilation
57+
{..\Core}.cc{}.obj:
58+
$(CC) $(CFLAGS) /c $(INCS) $<
59+
60+
{..\frameworks\imgui}.cpp{}.obj:
61+
$(CC) $(CFLAGS) /c $(INCS) $<
62+
63+
{src}.cc{}.obj:
64+
$(CC) $(CFLAGS) /c $(INCS) $<
5865

5966
$(RESOURCE): src\Kiwi8.rc resources\Kiwi8.ico
6067
RC src\Kiwi8.rc
@@ -72,10 +79,10 @@ $(APP_RELEASE): $(SDL_LIB) $(SDL_DLL) $(OBJS) $(RESOURCE)
7279
COPY $(SDL_DLL) release\SDL2.dll
7380
MOVE $(APP_NAME).exe $@
7481

75-
test_debug:
82+
test-debug:
7683
debug\$(APP_NAME).exe
7784

78-
test_release:
85+
test-release:
7986
release\$(APP_NAME).exe
8087

8188
# Clean any leftover build files (keeps SDL)

0 commit comments

Comments
 (0)