-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Makefile調整:入力ファイルUTF-8指定、GitHash出力 #306
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ DEFINES= \ | |
-DUNICODE \ | ||
-DNDEBUG | ||
CFLAGS= -O2 \ | ||
-finput-charset=cp932 -fexec-charset=cp932 \ | ||
-finput-charset=utf-8 -fexec-charset=cp932 \ | ||
-I. \ | ||
$(DEFINES) $(MYCFLAGS) | ||
CXXFLAGS= $(CFLAGS) $(MYCXXFLAGS) | ||
|
@@ -421,9 +421,12 @@ RCTOOL=$(RCTOOLDIR)/mrc2grc.exe | |
HEADERMAKETOOLDIR= ../HeaderMake | ||
HEADERMAKE= $(HEADERMAKETOOLDIR)/HeaderMake.exe | ||
|
||
COMMITID=`git show -s --format=%H` | ||
SHORT_COMMITID=`git show -s --format=%h` | ||
|
||
all: $(RCTOOL) $(HEADERMAKE) $(exe) | ||
|
||
$(exe): Funccode_define.h Funccode_enum.h svnrev stdafx $(OBJS) | ||
$(exe): Funccode_define.h Funccode_enum.h githash stdafx $(OBJS) | ||
$(CXX) -o $@ $(OBJS) $(LIBS) | ||
|
||
Funccode_define.h: Funccode_x.hsrc | ||
|
@@ -432,9 +435,10 @@ Funccode_define.h: Funccode_x.hsrc | |
Funccode_enum.h: Funccode_x.hsrc | ||
$(HEADERMAKE) -in=../sakura_core/Funccode_x.hsrc -out=../sakura_core/Funccode_enum.h -mode=enum -enum=EFunctionCode | ||
|
||
svnrev: | ||
cp svnrev_unknown.h svnrev.h | ||
-$(SUBWCREV) ".\\" ".\svnrev_template.h" ".\svnrev.h" | ||
githash: | ||
echo >githash.h "#pragma once" | ||
echo >>githash.h "#define GIT_COMMIT_HASH \"$(COMMITID)\"" | ||
echo >>githash.h "#define GIT_SHORT_COMMIT_HASH \"$(SHORT_COMMITID)\"" | ||
|
||
stdafx: | ||
$(CXX) $(CXXFLAGS) -c StdAfx.h | ||
|
@@ -449,14 +453,12 @@ $(HEADERMAKE): $(HEADERMAKETOOLDIR)/HeaderMake.cpp | |
$(CXX) $(CXXFLAGS) $(HEADERMAKETOOLDIR)/HeaderMake.cpp -o $@ -static-libgcc | ||
|
||
.rc.o: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ここ間違ってませんか? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ここは使う人が勝手に決めるものなので、間違ってるとかではないのかな、と思います。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MinGWではリソースファイルはCOFF obj形式にコンパイルして使います。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. そうなんや |
||
$(RCTOOL) $< sakura_grc.rc | ||
$(RC) --language=0411 $(DEFINES) sakura_grc.rc -o $@ | ||
$(RM) sakura_grc.rc | ||
$(RC) -c65001 --language=0411 $(DEFINES) sakura_rc.rc -o $@ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. すみません。提示した修正案が間違っておりました。 -c UTF8と書かないと動かないみたいです。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. なんだか自分の環境では There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
ん? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
clean: | ||
$(RM) $(exe) $(OBJS) $(RCTOOL) $(HEADERMAKE) StdAfx.h.gch | ||
|
||
depend: svnrev | ||
depend: githash | ||
$(CXX) -E -MM -w $(DEFINES) $(CXXFLAGS) *.cpp */*.cpp */*/*.cpp > depend.mak | ||
|
||
.SUFFIXES: .cpp .o .rc | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ちゃんと試せてませんが「-finput-charset=utf-8」はなしでもいけてます。
「-finput-charset=utf8」だと「iconvにそんなエンコード名ないよ」と怒られます。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
まぁもともと明示的な指定があったみたいなのでそれを踏襲して
utf-8
にした、という経緯があります。無くても BOM 付き UTF-8 なら自動判定してくれそうではありますね。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
問題ないっす。
-finput-charset=utf-8
を付けた場合で問題ないことも確認できてます。