Skip to content

Commit 7a4d225

Browse files
committed
add build targets for profiles.ini
1 parent ceb1329 commit 7a4d225

File tree

4 files changed

+36
-10
lines changed

4 files changed

+36
-10
lines changed

.github/workflows/build-reusable.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
run: |
3939
cd macos
4040
make clean
41+
make release/Kiwi8.app/Contents/Resources/profiles.ini
4142
make release/Kiwi8.app
4243
4344
- name: Verify binary and dependencies
@@ -97,6 +98,7 @@ jobs:
9798
run: |
9899
cd windows
99100
nmake clean
101+
nmake release\profiles.ini
100102
nmake release\Kiwi8.exe
101103
102104
- name: Verify binary and dependencies
@@ -151,6 +153,7 @@ jobs:
151153
run: |
152154
cd linux
153155
make clean
156+
make release/profiles.ini
154157
make release/Kiwi8
155158
156159
- name: Verify binary and dependencies

linux/makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ OBJS = $(notdir $(CORE_SRCS:.cc=.o)) \
5757
$(notdir $(LINUX_SRCS:.cc=.o))
5858
DEPS = $(OBJS:.o=.d)
5959

60+
PROFILES_INI = ../roms/profiles.ini
61+
6062
# Include auto-generated dependency files (must be before targets)
6163
-include $(DEPS)
6264

6365
.DEFAULT_GOAL := all
6466

65-
all: debug/$(APP_EXE) release/$(APP_EXE)
67+
all: debug/$(APP_EXE) release/$(APP_EXE) debug/profiles.ini release/profiles.ini
6668

6769
# Build SDL (force rebuild with: make sdl)
6870
sdl:
@@ -90,18 +92,24 @@ $(BOOTROM_HEADER): $(BOOTROM_SOURCE)
9092
%.o: src/%.cc
9193
$(CC) $(CFLAGS) $(INCS) -c $< -o $@
9294

95+
debug/profiles.ini: $(PROFILES_INI)
96+
mkdir -p debug
97+
cp $(PROFILES_INI) debug/profiles.ini
98+
99+
release/profiles.ini: $(PROFILES_INI)
100+
mkdir -p release
101+
cp $(PROFILES_INI) release/profiles.ini
102+
93103
# debug executable
94104
debug/$(APP_EXE): $(SDL_LIB) $(OBJS)
95105
mkdir -p debug
96106
cp $(SDL_LIB) debug/libSDL2-2.0.so.0
97-
cp ../roms/profiles.ini debug/profiles.ini
98107
$(CC) $(CFLAGS) -g $(INCS) $(LIBDIRS) $(OBJS) -o $@ $(LIBS) $(LFLAGS)
99108

100109
# release executable
101110
release/$(APP_EXE): $(SDL_LIB) $(OBJS)
102111
mkdir -p release
103112
cp $(SDL_LIB) release/libSDL2-2.0.so.0
104-
cp ../roms/profiles.ini release/profiles.ini
105113
$(CC) $(CFLAGS) $(INCS) $(LIBDIRS) $(OBJS) -o $@ $(LIBS) $(LFLAGS)
106114

107115
run-debug: debug/$(APP_EXE)

macos/makefile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ OBJS = $(notdir $(CORE_SRCS:.cc=.o)) \
4242
$(notdir $(MACOS_SRCS:.mm=.o))
4343
DEPS = $(OBJS:.o=.d)
4444

45+
PROFILES_INI = ../roms/profiles.ini
46+
4547
# Include auto-generated dependency files (must be before targets)
4648
-include $(DEPS)
4749

4850
.DEFAULT_GOAL := all
4951

50-
all: debug/$(APP_EXE) release/$(APP_BUNDLE)
52+
all: debug/$(APP_EXE) release/$(APP_BUNDLE) debug/profiles.ini release/$(APP_BUNDLE)/Contents/Resources/profiles.ini
5153

5254
# Build SDL (force rebuild with: make sdl)
5355
sdl:
@@ -79,11 +81,18 @@ $(APP_MANIFEST): $(APP_MANIFEST).in
7981
%.o: src/%.mm
8082
$(CC) $(CFLAGS) $(INCS) -c $< -o $@
8183

84+
debug/profiles.ini: $(PROFILES_INI)
85+
mkdir -p debug
86+
cp $(PROFILES_INI) debug/profiles.ini
87+
88+
release/$(APP_BUNDLE)/Contents/Resources/profiles.ini: $(PROFILES_INI)
89+
mkdir -p release/$(APP_BUNDLE)/Contents/Resources
90+
cp $(PROFILES_INI) release/$(APP_BUNDLE)/Contents/Resources/profiles.ini
91+
8292
# debug executable
8393
debug/$(APP_EXE): $(SDL_LIB) $(OBJS)
8494
mkdir -p debug
8595
cp $(SDL_LIB) debug/libSDL2-2.0.0.dylib
86-
cp ../roms/profiles.ini debug/profiles.ini
8796
$(CC) $(CFLAGS) -g $(LIBS) $(INCS) $(OBJS) -o $@ $(LFLAGS)
8897

8998
# Set the dylib's install name to be relative to the bundle
@@ -98,7 +107,7 @@ release/$(APP_BUNDLE)/Contents/MacOS/$(APP_EXE): $(SDL_LIB) $(OBJS)
98107
$(CC) $(CFLAGS) $(LIBS) $(INCS) $(OBJS) -o $@ $(LFLAGS)
99108

100109
# .app bundle
101-
release/$(APP_BUNDLE): release/$(APP_BUNDLE)/Contents/MacOS/$(APP_EXE) $(SDL_LIB) resources/Kiwi8.icns $(APP_MANIFEST)
110+
release/$(APP_BUNDLE): $(APP_MANIFEST) $(SDL_LIB) resources/Kiwi8.icns release/$(APP_BUNDLE)/Contents/MacOS/$(APP_EXE)
102111
mkdir -p release/$(APP_BUNDLE)/Contents/{Resources,Frameworks}
103112

104113
# Copying the frameworks into .app bundle
@@ -107,7 +116,6 @@ release/$(APP_BUNDLE): release/$(APP_BUNDLE)/Contents/MacOS/$(APP_EXE) $(SDL_LIB
107116
# Moving other files into .app bundle
108117
cp resources/Kiwi8.icns release/$(APP_BUNDLE)/Contents/Resources/Kiwi8.icns
109118
cp $(APP_MANIFEST) release/$(APP_BUNDLE)/Contents/Info.plist
110-
cp ../roms/profiles.ini release/$(APP_BUNDLE)/Contents/Resources/profiles.ini
111119

112120
# Set the dylib's install name to be relative to the bundle
113121
install_name_tool -id @executable_path/../Frameworks/libSDL2-2.0.0.dylib release/$(APP_BUNDLE)/Contents/Frameworks/libSDL2-2.0.0.dylib

windows/makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ OBJS = audio.obj chip8.obj crc32.obj display.obj gui.obj imgui_impl_sdl.obj inpu
5959
main.obj notifications.obj profiles.obj open_file_dialog.obj imgui.obj imgui_draw.obj \
6060
file_dialog.obj
6161

62+
PROFILES_INI = ..\roms\profiles.ini
6263

6364
# Default target
64-
all: debug\$(APP_EXE) release\$(APP_EXE)
65+
all: debug\$(APP_EXE) release\$(APP_EXE) debug\profiles.ini release\profiles.ini
6566

6667
# Detect architecture from environment (set by MSVC vcvarsall.bat)
6768
# VSCMD_ARG_TGT_ARCH is set to x64, x86, arm64, or arm
@@ -113,18 +114,24 @@ $(APP_RES): src\Kiwi8.rc resources\Kiwi8.ico
113114
RC src\Kiwi8.rc
114115
MOVE src\Kiwi8.res $@
115116

117+
debug\profiles.ini: $(PROFILES_INI)
118+
IF NOT EXIST debug MKDIR debug
119+
COPY $(PROFILES_INI) debug\profiles.ini
120+
121+
release\profiles.ini: $(PROFILES_INI)
122+
IF NOT EXIST release MKDIR release
123+
COPY $(PROFILES_INI) release\profiles.ini
124+
116125
debug\$(APP_EXE): $(SDL_LIB) $(SDL_DLL) $(OBJS) $(APP_RES)
117126
$(CC) $(CFLAGS) /Zi /Fe$(APP_NAME) $(INCS) $(OBJS) $(APP_RES) $(LIBS) $(LFLAGS) /SUBSYSTEM:CONSOLE
118127
IF NOT EXIST debug MKDIR debug
119128
COPY $(SDL_DLL) debug\SDL2.dll
120-
COPY ..\roms\profiles.ini debug\profiles.ini
121129
MOVE $(APP_EXE) $@
122130

123131
release\$(APP_EXE): $(SDL_LIB) $(SDL_DLL) $(OBJS) $(APP_RES)
124132
$(CC) $(CFLAGS) /Fe$(APP_NAME) $(INCS) $(OBJS) $(APP_RES) $(LIBS) $(LFLAGS) /SUBSYSTEM:WINDOWS
125133
IF NOT EXIST release MKDIR release
126134
COPY $(SDL_DLL) release\SDL2.dll
127-
COPY ..\roms\profiles.ini release\profiles.ini
128135
MOVE $(APP_EXE) $@
129136

130137
run-debug:

0 commit comments

Comments
 (0)