mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-01-22 09:01:57 -05:00
macOS: Build app bundle with makefile
This commit is contained in:
parent
0d772f5e90
commit
507f71c944
3 changed files with 33 additions and 22 deletions
51
Makefile
51
Makefile
|
@ -71,6 +71,7 @@ ifeq ($(PLAT),darwin)
|
||||||
LIBS =
|
LIBS =
|
||||||
LDFLAGS = -rdynamic -framework Cocoa -framework OpenGL -framework IOKit -lobjc
|
LDFLAGS = -rdynamic -framework Cocoa -framework OpenGL -framework IOKit -lobjc
|
||||||
BUILD_DIR = build-macos
|
BUILD_DIR = build-macos
|
||||||
|
TARGET = $(ENAME).app
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(PLAT),freebsd)
|
ifeq ($(PLAT),freebsd)
|
||||||
|
@ -159,41 +160,41 @@ endif
|
||||||
default: $(PLAT)
|
default: $(PLAT)
|
||||||
|
|
||||||
web:
|
web:
|
||||||
$(MAKE) $(ENAME) PLAT=web
|
$(MAKE) $(TARGET) PLAT=web
|
||||||
linux:
|
linux:
|
||||||
$(MAKE) $(ENAME) PLAT=linux
|
$(MAKE) $(TARGET) PLAT=linux
|
||||||
mingw:
|
mingw:
|
||||||
$(MAKE) $(ENAME) PLAT=mingw
|
$(MAKE) $(TARGET) PLAT=mingw
|
||||||
sunos:
|
sunos:
|
||||||
$(MAKE) $(ENAME) PLAT=sunos
|
$(MAKE) $(TARGET) PLAT=sunos
|
||||||
darwin:
|
darwin:
|
||||||
$(MAKE) $(ENAME) PLAT=darwin
|
$(MAKE) $(TARGET) PLAT=darwin
|
||||||
freebsd:
|
freebsd:
|
||||||
$(MAKE) $(ENAME) PLAT=freebsd
|
$(MAKE) $(TARGET) PLAT=freebsd
|
||||||
openbsd:
|
openbsd:
|
||||||
$(MAKE) $(ENAME) PLAT=openbsd
|
$(MAKE) $(TARGET) PLAT=openbsd
|
||||||
netbsd:
|
netbsd:
|
||||||
$(MAKE) $(ENAME) PLAT=netbsd
|
$(MAKE) $(TARGET) PLAT=netbsd
|
||||||
dragonfly:
|
dragonfly:
|
||||||
$(MAKE) $(ENAME) PLAT=dragonfly
|
$(MAKE) $(TARGET) PLAT=dragonfly
|
||||||
haiku:
|
haiku:
|
||||||
$(MAKE) $(ENAME) PLAT=haiku
|
$(MAKE) $(TARGET) PLAT=haiku
|
||||||
beos:
|
beos:
|
||||||
$(MAKE) $(ENAME) PLAT=beos
|
$(MAKE) $(TARGET) PLAT=beos
|
||||||
serenityos:
|
serenityos:
|
||||||
$(MAKE) $(ENAME) PLAT=serenityos
|
$(MAKE) $(TARGET) PLAT=serenityos
|
||||||
irix:
|
irix:
|
||||||
$(MAKE) $(ENAME) PLAT=irix
|
$(MAKE) $(TARGET) PLAT=irix
|
||||||
|
|
||||||
# Default overrides
|
# Default overrides
|
||||||
sdl2:
|
sdl2:
|
||||||
$(MAKE) $(ENAME) SDL2=1
|
$(MAKE) $(TARGET) SDL2=1
|
||||||
sdl3:
|
sdl3:
|
||||||
$(MAKE) $(ENAME) SDL3=1
|
$(MAKE) $(TARGET) SDL3=1
|
||||||
terminal:
|
terminal:
|
||||||
$(MAKE) $(ENAME) TERMINAL=1
|
$(MAKE) $(TARGET) TERMINAL=1
|
||||||
release:
|
release:
|
||||||
$(MAKE) $(ENAME) RELEASE=1
|
$(MAKE) $(TARGET) RELEASE=1
|
||||||
|
|
||||||
# Some builds require more complex handling, so are moved to
|
# Some builds require more complex handling, so are moved to
|
||||||
# separate makefiles to avoid having one giant messy makefile
|
# separate makefiles to avoid having one giant messy makefile
|
||||||
|
@ -240,11 +241,21 @@ macclassic_ppc:
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(OBJECTS)
|
$(RM) $(OBJECTS)
|
||||||
|
|
||||||
|
|
||||||
$(ENAME): $(BUILD_DIR) $(OBJECTS)
|
|
||||||
$(CC) $(LDFLAGS) -o $@$(OEXT) $(OBJECTS) $(EXTRA_LIBS) $(LIBS)
|
|
||||||
$(BUILD_DIR):
|
$(BUILD_DIR):
|
||||||
mkdir -p $(BUILD_DIR)
|
mkdir -p $(BUILD_DIR)
|
||||||
|
$(ENAME): $(BUILD_DIR) $(OBJECTS)
|
||||||
|
$(CC) $(LDFLAGS) -o $@$(OEXT) $(OBJECTS) $(EXTRA_LIBS) $(LIBS)
|
||||||
|
|
||||||
|
|
||||||
|
# macOS app bundle
|
||||||
|
$(ENAME).app : $(ENAME)
|
||||||
|
mkdir $(TARGET)
|
||||||
|
mkdir $(TARGET)/Contents
|
||||||
|
mkdir $(TARGET)/Contents/MacOS
|
||||||
|
mkdir $(TARGET)/Contents/Resources
|
||||||
|
cp $(ENAME) $(TARGET)/Contents/MacOS/$(ENAME)
|
||||||
|
cp misc/macOS/Info.plist $(TARGET)/Contents/Resources/Info.plist
|
||||||
|
cp misc/macOS/appicon.icns $(TARGET)/Contents/Resources/appicon.icns
|
||||||
|
|
||||||
|
|
||||||
# === Compiling with dependency tracking ===
|
# === Compiling with dependency tracking ===
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>ClassiCube</string>
|
<string>ClassiCube</string>
|
||||||
<key>CFBundleIconFile</key>
|
<key>CFBundleIconFile</key>
|
||||||
<string>ClassiCube</string>
|
<string>appicon</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>com.classicube.client.mac</string>
|
<string>com.classicube.client.mac</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
@ -17,4 +17,4 @@
|
||||||
<key>CFBundleDisplayName</key>
|
<key>CFBundleDisplayName</key>
|
||||||
<string>ClassiCube</string>
|
<string>ClassiCube</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
Loading…
Reference in a new issue