Skip to content

Commit 1149d78

Browse files
committed
reorder some things
1 parent 6a43846 commit 1149d78

File tree

2 files changed

+22
-30
lines changed

2 files changed

+22
-30
lines changed

MacOS/makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ all: $(APP_BUNDLE)
3636

3737
# Build SDL (force rebuild with: make sdl)
3838
sdl:
39-
@bash ../tools/build_sdl_macos.sh
39+
bash ../tools/build_sdl_macos.sh
4040

4141
# Build SDL if lib doesn't exist (headers come together)
4242
$(SDL_LIB):
43-
@bash ../tools/build_sdl_macos.sh
43+
bash ../tools/build_sdl_macos.sh
4444

4545
# Pattern rules for incremental compilation
4646
%.o: ../Core/%.cc
@@ -54,7 +54,7 @@ $(SDL_LIB):
5454

5555
$(APP_EXE): $(SDL_LIB) $(OBJS)
5656
# Create app bundle directory structure
57-
@mkdir -p $(APP_BUNDLE)/Contents/{MacOS,Resources,Frameworks}
57+
mkdir -p $(APP_BUNDLE)/Contents/{MacOS,Resources,Frameworks}
5858

5959
# Compiling main executable
6060
$(CC) $(CFLAGS) $(LIBS) $(INCS) $(OBJS) -o $@ $(LFLAGS)
@@ -75,7 +75,7 @@ $(APP_BUNDLE): $(APP_EXE) $(SDL_LIB) resources/Kiwi8.icns src/Info.plist
7575
cp src/Info.plist $(APP_BUNDLE)/Contents/Info.plist
7676

7777
# Update directory timestamp so Make knows bundle is up-to-date
78-
@touch $(APP_BUNDLE)
78+
touch $(APP_BUNDLE)
7979

8080
test-debug: $(APP_BUNDLE)
8181
./$(APP_BUNDLE)/Contents/MacOS/$(APP_NAME)
@@ -84,8 +84,8 @@ test-release: $(APP_BUNDLE)
8484
open ./$(APP_BUNDLE)
8585

8686
check-dylibs: $(APP_BUNDLE)
87-
@otool -L $(APP_EXE) | sed -n '1,120p'
88-
@otool -L $(APP_BUNDLE)/Contents/Frameworks/libSDL2-2.0.0.dylib | sed -n '1,120p'
87+
otool -L $(APP_EXE) | sed -n '1,120p'
88+
otool -L $(APP_BUNDLE)/Contents/Frameworks/libSDL2-2.0.0.dylib | sed -n '1,120p'
8989

9090
# Removes just SDL (for forcing recompile)
9191
clean-sdl:

Windows/makefile

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
ARCH = x64
2-
3-
# SDL dependency files
4-
SDL_LIB = frameworks\sdl\lib\SDL2.lib
5-
SDL_DLL = frameworks\sdl\bin\SDL2.dll
6-
7-
DEBUG = /SUBSYSTEM:CONSOLE
8-
RELEASE = /SUBSYSTEM:WINDOWS
9-
101
CC = CL
112
CFLAGS = /MD /nologo /W3 /w44996
123
LFLAGS = /link \
@@ -22,6 +13,10 @@ LIBS = user32.lib \
2213
Comdlg32.lib \
2314
Shell32.lib
2415

16+
# SDL dependency files
17+
SDL_LIB = frameworks\sdl\lib\SDL2.lib
18+
SDL_DLL = frameworks\sdl\bin\SDL2.dll
19+
2520
# Source files
2621
CORE_SRCS = ..\Core\Audio.cc ..\Core\Chip8.cc ..\Core\Display.cc ..\Core\Gui.cc \
2722
..\Core\imgui_impl_sdl.cc ..\Core\Input.cc ..\Core\main.cc \
@@ -35,16 +30,13 @@ OBJS = Audio.obj Chip8.obj Display.obj Gui.obj imgui_impl_sdl.obj Input.obj \
3530
main.obj opcodes.obj open_file_dialog.obj imgui.obj imgui_demo.obj \
3631
imgui_draw.obj file_dialog.obj
3732

38-
RESOURCE = Kiwi8.res
3933

4034
APP_NAME = Kiwi8
41-
APP_EXE = Kiwi8.exe
42-
43-
APP_DEBUG = debug\$(APP_NAME).exe
44-
APP_RELEASE = release\$(APP_NAME).exe
35+
APP_EXE = $(APP_NAME).exe
36+
RESOURCE = $(APP_NAME).res
4537

4638
# Default target
47-
all: $(APP_DEBUG) $(APP_RELEASE)
39+
all: debug\$(APP_EXE) release\$(APP_EXE)
4840

4941
# Build SDL (force rebuild with: nmake sdl)
5042
sdl:
@@ -71,23 +63,23 @@ $(RESOURCE): src\Kiwi8.rc resources\Kiwi8.ico
7163
RC src\Kiwi8.rc
7264
MOVE src\Kiwi8.res $@
7365

74-
$(APP_DEBUG): $(SDL_LIB) $(SDL_DLL) $(OBJS) $(RESOURCE)
75-
$(CC) $(CFLAGS) /Zi /Fe$(APP_NAME) $(INCS) *.obj *.res $(LIBS) $(LFLAGS) $(DEBUG)
66+
debug\$(APP_EXE): $(SDL_LIB) $(SDL_DLL) $(OBJS) $(RESOURCE)
67+
$(CC) $(CFLAGS) /Zi /Fe$(APP_NAME) $(INCS) *.obj *.res $(LIBS) $(LFLAGS) /SUBSYSTEM:CONSOLE
7668
IF NOT EXIST debug MKDIR debug
7769
COPY $(SDL_DLL) debug\SDL2.dll
78-
MOVE $(APP_NAME).exe $@
70+
MOVE $(APP_EXE) $@
7971

80-
$(APP_RELEASE): $(SDL_LIB) $(SDL_DLL) $(OBJS) $(RESOURCE)
81-
$(CC) $(CFLAGS) /Fe$(APP_NAME) $(INCS) *.obj *.res $(LIBS) $(LFLAGS) $(RELEASE)
72+
release\$(APP_EXE): $(SDL_LIB) $(SDL_DLL) $(OBJS) $(RESOURCE)
73+
$(CC) $(CFLAGS) /Fe$(APP_NAME) $(INCS) *.obj *.res $(LIBS) $(LFLAGS) /SUBSYSTEM:WINDOWS
8274
IF NOT EXIST release MKDIR release
8375
COPY $(SDL_DLL) release\SDL2.dll
84-
MOVE $(APP_NAME).exe $@
76+
MOVE $(APP_EXE) $@
8577

8678
test-debug:
87-
debug\$(APP_NAME).exe
79+
debug\$(APP_EXE)
8880

8981
test-release:
90-
release\$(APP_NAME).exe
82+
release\$(APP_EXE)
9183

9284
# Remove just SDL (for forcing recompile)
9385
clean-sdl:
@@ -96,7 +88,7 @@ clean-sdl:
9688

9789
# Clean any leftover build files (keeps SDL)
9890
clean:
99-
-DEL /Q $(APP_DEBUG) $(APP_RELEASE) *.obj *.res *.pdb 2>nul
91+
-DEL /Q *.obj *.res *.pdb 2>nul
10092
-IF EXIST debug RD /S /Q debug
10193
-IF EXIST release RD /S /Q release
10294

0 commit comments

Comments
 (0)