wall.bmp \
stdafx.cpp stdafx.h
+cocoa_xcode_files = \
+ cocoa/AppDelegate.m \
+ cocoa/Base.lproj/MainMenu.xib \
+ cocoa/Base.lproj/SoundAndMusic.xib
+cocoa_icon_files = \
+ cocoa/hengband_Icons.icns \
+ cocoa/Save.icns \
+ cocoa/Edit.icns \
+ cocoa/Data.icns
+cocoa_plist_template = cocoa/Angband-Cocoa.xml
+cocoa_plist_strings_template = cocoa/Angband-Cocoa.strings
+cocoa_plist_files = \
+ cocoa/CommandMenu.plist
+cocoa_en_nib_files = \
+ cocoa/Base.lproj/MainMenu.nib \
+ cocoa/Base.lproj/SoundAndMusic.nib
+cocoa_en_strings_files = \
+ cocoa/en.lproj/Localizable.strings \
+ cocoa/en.lproj/CommandMenu.strings \
+ cocoa/en.lproj/GraphicsMenu.strings
+cocoa_ja_strings_files = \
+ cocoa/ja.lproj/MainMenu.strings \
+ cocoa/ja.lproj/SoundAndMusic.strings \
+ cocoa/ja.lproj/Localizable.strings \
+ cocoa/ja.lproj/CommandMenu.strings \
+ cocoa/ja.lproj/GraphicsMenu.strings
+
EXTRA_DIST = \
- gcc-wrap
+ gcc-wrap \
+ $(cocoa_xcode_files) \
+ $(cocoa_icon_files) \
+ $(cocoa_plist_template) \
+ $(cocoa_plist_strings_template) \
+ $(cocoa_plist_files) \
+ $(cocoa_en_nib_files) \
+ $(cocoa_en_strings_files) \
+ $(cocoa_ja_strings_files)
-DEFAULT_INCLUDES = -I$(srcdir) -I$(top_builddir)/src
-CPPFLAGS += $(XFT_CFLAGS) $(libssl_CFLAGS) $(libcrypto_CFLAGS)
-if PCH
-CPPFLAGS += -include ../src/stdafx.h
+if COCOA
+hengband_SOURCES += \
+ main-cocoa.mm \
+ system/grafmode.h \
+ system/grafmode.cpp \
+ cocoa/AppDelegate.h \
+ cocoa/AngbandAudio.h \
+ cocoa/AngbandAudio.mm \
+ cocoa/SoundAndMusic.h \
+ cocoa/SoundAndMusic.mm
+AM_CFLAGS = -mmacosx-version-min=10.15 -Wunguarded-availability
+AM_OBJCXXFLAGS = -std=c++20 -fobjc-arc -mmacosx-version-min=10.15 -Wunguarded-availability -stdlib=libc++
+AM_CXXFLAGS = -mmacosx-version-min=10.15 -Wunguarded-availability -stdlib=libc++
+hengband_LDFLAGS = -framework cocoa -framework AVFoundation $(AM_LDFLAGS)
+hengband_LINK = MACOSX_DEPLOYMENT_TARGET=10.15 $(OBJCXXLINK) $(hengband_LDFLAGS) $(LDFLAGS) -o $@
+APPNAME = $(PACKAGE_NAME)
+APPEXE = hengband
+APPDIR = $(APPNAME).app
+BUNDLE_IDENTIFIER = jp.osdn.hengband
+BUNDLE_VERSION = $(PACKAGE_VERSION)
+BUNDLE_DISPLAY_NAME = $(APPNAME)
+BUNDLE_NAME = $(BUNDLE_DISPLAY_NAME)
+BUNDLE_DISPLAY_NAME_JA = 変愚蛮怒
+BUNDLE_NAME_JA = $(BUNDLE_DISPLAY_NAME_JA)
+# Be careful with characters (like '&') in the copyright that have special
+# meanings to sed.
+COPYRIGHT = Copyright © Mr. Hoge and many others
+# For now, using the line that appears in news_j.txt. Is that appropriate?
+# The ampersand is a kanji so it doesn't seem to be treated as a special
+# character by sed.
+COPYRIGHT_JA = Mr.hoge (echizen@users.sourceforge.jp) & 多くの方々
+APPBNDL = $(bindir)/$(APPDIR)
+APPCONT = $(APPBNDL)/Contents
+APPBIN = $(APPCONT)/MacOS
+APPRES = $(APPCONT)/Resources
+appbin_PROGRAMS = $(APPEXE)
+appbindir = $(APPBIN)
+dist_appicon_DATA = $(cocoa_icon_files)
+appicondir = $(APPRES)
+appplist_DATA = $(cocoa_plist_files)
+appplistdir = $(APPRES)
+appennib_DATA = $(cocoa_en_nib_files)
+appennibdir = $(APPRES)/Base.lproj
+appen_DATA = $(cocoa_en_strings_files)
+appendir = $(APPRES)/en.lproj
+appja_DATA = $(cocoa_ja_strings_files)
+appjadir = $(APPRES)/ja.lproj
+else
+EXTRA_hengband_SOURCES += main-cocoa.mm system/grafmode.h system/grafmode.cpp \
+ cocoa/AppDelegate.h
+hengband_LINK = $(CXXLINK)
endif
- CPPFLAGS += $(XFT_CFLAGS) $(libcurl_CFLAGS)
- LIBS += $(XFT_LIBS) $(libcurl_LIBS)
+
+# The "-I$(top_builddir)/src/cocoa" is there so can use the same include
+# directives in the cocoa/*.{h,mm} files when building here or rebuilding the
+# nib files in Xcode according to the procedure in cocoa/AppDelegate.m.
+DEFAULT_INCLUDES = -I$(srcdir) -I$(top_builddir)/src -I$(top_builddir)/src/cocoa
++CPPFLAGS += $(XFT_CFLAGS) $(libssl_CFLAGS) $(libcrypto_CFLAGS)
+ LIBS += $(XFT_LIBS) $(libssl_LIBS) $(libcrypto_LIBS)
COMPILE = $(srcdir)/gcc-wrap $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+OBJCXXCOMPILE = $(srcdir)/gcc-wrap $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) \
+ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS)
CXXCOMPILE = $(srcdir)/gcc-wrap $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CXXFLAGS)
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
if PCH
+# Would use CPPFLAGS, but that affects both the C++ and Objective-C++
+# preprocessing: don't want to use the precompiled header for the
+# Objective-C++ code.
+CXXCOMPILE += -include ../src/stdafx.h
+
stdafx.h.gch: stdafx.h stdafx.cpp Makefile
- $(CXX) -x c++-header $(CXXFLAGS) $(srcdir)/stdafx.cpp -o $@
+ $(CXX) -x c++-header $(CXXFLAGS) $(AM_CXXFLAGS) $(srcdir)/stdafx.cpp -o $@
if test none != "$(PCH_CHECKSUMMER)" ; then \
rm -f "$@".sum ; \
$(PCH_CHECKSUMMER) $@ > "$@".sum ; \