OSDN Git Service

Changed to have main-cocoa.m use the application delegate declaration from cocoa...
[hengbandforosx/hengbandosx.git] / src / Makefile.am
index d3566fe..bdfe4a5 100644 (file)
@@ -91,57 +91,65 @@ hengband_SOURCES = \
 
 EXTRA_hengband_SOURCES = \
        angband.ico angband.rc ang_eng.rc maid-x11.c main-mac.c main-win.c \
-       main-dos.c main-ibm.c \
+       main-cap.c main-dos.c main-ibm.c main-xaw.c \
        makefile.bcc makefile.std makefile.dos makefile.ibm \
-       readdib.c wall.bmp
+       readdib.c readdib.h wall.bmp
 
+cocoa_xcode_files = \
+       cocoa/AppDelegate.m \
+       cocoa/Base.lproj/MainMenu.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/en.lproj/MainMenu.nib/designable.nib \
-       cocoa/en.lproj/MainMenu.nib/keyedobjects.nib
+       cocoa/Base.lproj/MainMenu.nib
 cocoa_en_strings_files = \
        cocoa/en.lproj/Localizable.strings \
        cocoa/en.lproj/CommandMenu.strings \
        cocoa/en.lproj/GraphicsMenu.strings
-cocoa_ja_nib_files = \
-       cocoa/ja.lproj/MainMenu.nib/designable.nib \
-       cocoa/ja.lproj/MainMenu.nib/keyedobjects.nib
 cocoa_ja_strings_files = \
+       cocoa/ja.lproj/MainMenu.strings \
        cocoa/ja.lproj/Localizable.strings \
        cocoa/ja.lproj/CommandMenu.strings \
        cocoa/ja.lproj/GraphicsMenu.strings
 
 EXTRA_DIST = \
        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_nib_files) \
        $(cocoa_ja_strings_files)
 
 if COCOA
-hengband_SOURCES += main-cocoa.m grafmode.h grafmode.c
-AM_CFLAGS = -mmacosx-version-min=10.7
-AM_OBJCFLAGS = -mmacosx-version-min=10.7
+hengband_SOURCES += main-cocoa.m grafmode.h grafmode.c cocoa/AppDelegate.h
+AM_CFLAGS = -mmacosx-version-min=10.8 -Wunguarded-availability
+AM_OBJCFLAGS = -mmacosx-version-min=10.8 -Wunguarded-availability
 hengband_LDFLAGS = -framework cocoa $(AM_LDFLAGS)
-hengband_LINK = MACOSX_DEPLOYMENT_TARGET=10.7 $(OBJCLINK) $(hengband_LDFLAGS) $(LDFLAGS) -o $@ 
+hengband_LINK = MACOSX_DEPLOYMENT_TARGET=10.8 $(OBJCLINK) $(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 English version.  Should be localized to Japanese.
+COPYRIGHT_JA = $(COPYRIGHT)
 APPBNDL = $(bindir)/$(APPDIR)
 APPCONT = $(APPBNDL)/Contents
 APPBIN = $(APPCONT)/MacOS
@@ -153,15 +161,14 @@ appicondir = $(APPRES)
 appplist_DATA = $(cocoa_plist_files)
 appplistdir = $(APPRES)
 appennib_DATA = $(cocoa_en_nib_files)
-appennibdir = $(APPRES)/en.lproj/MainMenu.nib
+appennibdir = $(APPRES)/Base.lproj
 appen_DATA = $(cocoa_en_strings_files)
 appendir = $(APPRES)/en.lproj
-appjanib_DATA = $(cocoa_ja_nib_files)
-appjanibdir = $(APPRES)/ja.lproj/MainMenu.nib
 appja_DATA = $(cocoa_ja_strings_files)
 appjadir = $(APPRES)/ja.lproj
 else
-EXTRA_hengband_SOURCES += main-cocoa.m grafmode.h grafmode.c
+EXTRA_hengband_SOURCES += main-cocoa.m grafmode.h grafmode.c \
+       cocoa/AppDelegate.h
 hengband_LINK = $(LINK)
 endif
 
@@ -177,11 +184,18 @@ if SET_GID
 endif
 
 if COCOA
+# Suppress the warnings from the EUC-JP encoded strings used when building
+# the Japanese version.
+AM_CFLAGS += -Wno-invalid-source-encoding
+AM_OBJCFLAGS += -Wno-invalid-source-encoding
+
 # Create lib/info within the application bundle since not currently
 # installing anything to it.  Other relevant lib directories should
 # be created from the Makefiles in the lib directory.
 install-data-local:
        @mkdir -p $(APPCONT)
+       @mkdir -p $(appendir)
+       @mkdir -p $(appjadir)
        @mkdir -p $(APPRES)/lib/info
        sed -e 's/\$$VERSION\$$/$(PACKAGE_VERSION)/' \
                -e 's/\$$COPYRIGHT\$$/$(COPYRIGHT)/' \
@@ -189,9 +203,23 @@ install-data-local:
                -e 's/\$$EXECUTABLE\$$/$(APPEXE)/' \
                -e 's/\$$BUNDLE_VERSION\$$/$(BUNDLE_VERSION)/' \
                -e 's/\$$BUNDLE_IDENTIFIER\$$/$(BUNDLE_IDENTIFIER)/' \
+               -e 's/\$$BUNDLE_DISPLAY_NAME\$$/$(BUNDLE_DISPLAY_NAME)/' \
+               -e 's/\$$BUNDLE_NAME\$$/$(BUNDLE_NAME)/' \
                $(srcdir)/$(cocoa_plist_template) > $(APPCONT)/Info.plist
+       sed -e 's/\$$VERSION\$$/$(PACKAGE_VERSION)/' \
+               -e 's/\$$COPYRIGHT\$$/$(COPYRIGHT)/' \
+               -e 's/\$$BUNDLE_DISPLAY_NAME\$$/$(BUNDLE_DISPLAY_NAME)/' \
+               -e 's/\$$BUNDLE_NAME\$$/$(BUNDLE_NAME)/' \
+               $(srcdir)/$(cocoa_plist_strings_template) > $(appendir)/InfoPlist.strings
+       sed -e 's/\$$VERSION\$$/$(PACKAGE_VERSION)/' \
+               -e 's/\$$COPYRIGHT\$$/$(COPYRIGHT_JA)/' \
+               -e 's/\$$BUNDLE_DISPLAY_NAME\$$/$(BUNDLE_DISPLAY_NAME_JA)/' \
+               -e 's/\$$BUNDLE_NAME\$$/$(BUNDLE_NAME_JA)/' \
+               $(srcdir)/$(cocoa_plist_strings_template) > $(appjadir)/InfoPlist.strings
 
 distclean-local:
        -rm $(APPCONT)/Info.plist
+       -rm $(appendir)/InfoPlist.strings
+       -rm $(appjadir)/InfoPlist.strings
 
 endif