diff --git a/Makefile b/Makefile index 3a9684a0..a8b8f3ae 100644 --- a/Makefile +++ b/Makefile @@ -70,26 +70,26 @@ bsnes/out/libsnes.$(ARCHIVE_SUFFIX): forcelook $(REALRANLIB) bsnes/out/libsnes.$(ARCHIVE_SUFFIX) -src/__all_files__: src/core/version.cpp buildaux/mkdeps.exe buildaux/txt2cstr.exe forcelook +src/__all_files__: src/core/version.cpp buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) buildaux/txt2cstr$(DOT_EXECUTABLE_SUFFIX) forcelook $(MAKE) -C src precheck $(MAKE) -C src cp src/lsnes$(DOT_EXECUTABLE_SUFFIX) . -buildaux/txt2cstr.exe: buildaux/txt2cstr.cpp +buildaux/txt2cstr$(DOT_EXECUTABLE_SUFFIX): buildaux/txt2cstr.cpp $(HOSTCC) $(HOSTCCFLAGS) -o $@ $< -buildaux/version.exe: buildaux/version.cpp VERSION +buildaux/version$(DOT_EXECUTABLE_SUFFIX): buildaux/version.cpp VERSION $(HOSTCC) $(HOSTCCFLAGS) -o $@ $< -buildaux/mkdeps.exe: buildaux/mkdeps.cpp VERSION +buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX): buildaux/mkdeps.cpp VERSION $(HOSTCC) $(HOSTCCFLAGS) -o $@ $< -lboost_filesystem$(HOST_BOOST_POSTFIX) -lboost_system$(HOST_BOOST_POSTFIX) -src/core/version.cpp: buildaux/version.exe forcelook - buildaux/version.exe >$@ +src/core/version.cpp: buildaux/version$(DOT_EXECUTABLE_SUFFIX) forcelook + buildaux/version$(DOT_EXECUTABLE_SUFFIX) >$@ platclean: $(MAKE) -C src platclean clean: $(MAKE) -C src clean - rm -f buildaux/version.exe + rm -f buildaux/version$(DOT_EXECUTABLE_SUFFIX) forcelook: @true diff --git a/src/cmdhelp/Makefile b/src/cmdhelp/Makefile index afe2cf0b..4acb90c2 100644 --- a/src/cmdhelp/Makefile +++ b/src/cmdhelp/Makefile @@ -9,17 +9,17 @@ __all__.files: $(JSON_OBJECTS) inverselist.$(OBJECT_SUFFIX) lua ../genfilelist.lua $^ >$@ touch $(ALLFLAGS) -mkstubs.exe: mkstubs.cpp ../library/json.cpp ../library/utf8.cpp ../library/string.cpp ../library/hex.cpp ../library/eatarg.cpp ../library/int24.cpp +mkstubs$(DOT_EXECUTABLE_SUFFIX): mkstubs.cpp ../library/json.cpp ../library/utf8.cpp ../library/string.cpp ../library/hex.cpp ../library/eatarg.cpp ../library/int24.cpp $(HOSTCC) -g -std=gnu++0x -I../../include/library -o $@ $^ -lboost_regex$(HOST_BOOST_POSTFIX) -lboost_system$(HOST_BOOST_POSTFIX) -Wall -mkstubsi.exe: mkstubsi.cpp ../library/json.cpp ../library/utf8.cpp ../library/string.cpp ../library/hex.cpp ../library/eatarg.cpp ../library/int24.cpp +mkstubsi$(DOT_EXECUTABLE_SUFFIX): mkstubsi.cpp ../library/json.cpp ../library/utf8.cpp ../library/string.cpp ../library/hex.cpp ../library/eatarg.cpp ../library/int24.cpp $(HOSTCC) -g -std=gnu++0x -I../../include/library -o $@ $^ -lboost_regex$(HOST_BOOST_POSTFIX) -lboost_system$(HOST_BOOST_POSTFIX) -Wall -inverselist.cpp: $(JSON_FILES) mkstubsi.exe - ./mkstubsi.exe $^ +inverselist.cpp: $(JSON_FILES) mkstubsi$(DOT_EXECUTABLE_SUFFIX) + ./mkstubsi$(DOT_EXECUTABLE_SUFFIX) $^ -%.cpp: %.json mkstubs.exe - ./mkstubs.exe $< +%.cpp: %.json mkstubs$(DOT_EXECUTABLE_SUFFIX) + ./mkstubs$(DOT_EXECUTABLE_SUFFIX) $< mv *.hpp ../../include/cmdhelp %.$(OBJECT_SUFFIX): %.cpp @@ -33,7 +33,7 @@ precheck: clean: rm -f *.$(OBJECT_SUFFIX) $(JSON_SRC) inverselist.cpp __all__.ldflags __all__.files - rm -f mkstubs.exe + rm -f mkstubs$(DOT_EXECUTABLE_SUFFIX) forcelook: @true diff --git a/src/cmdhelp/mkstubsi.cpp b/src/cmdhelp/mkstubsi.cpp index 2087d754..d84b397e 100644 --- a/src/cmdhelp/mkstubsi.cpp +++ b/src/cmdhelp/mkstubsi.cpp @@ -44,6 +44,14 @@ void process_command_inverse(JSON::node& n, std::string name, std::ostream& imp) } } +bool is_crap_filename(const std::string& arg) +{ + if(arg.length() >= 4 && arg.substr(arg.length() - 4) == ".exe") return true; + if(arg.length() >= 9 && arg.substr(arg.length() - 9) == "/mkstubsi") return true; + if(arg == "mkstubsi") return true; + return false; +} + int main(int argc, char** argv) { std::ofstream impl("inverselist.cpp"); @@ -54,7 +62,7 @@ int main(int argc, char** argv) for(int i = 1; i < argc; i++) { //Hack, skip crap. - if(argv[i][0] == 0 || argv[i][strlen(argv[i])-1] == 'e') + if(argv[i][0] == 0 || is_crap_filename(argv[i])) continue; std::ifstream infile(argv[i]); std::string in_json; diff --git a/src/core/Makefile b/src/core/Makefile index d05bd786..69314e20 100644 --- a/src/core/Makefile +++ b/src/core/Makefile @@ -10,7 +10,7 @@ __all__.files: $(OBJECTS) $(REALCC) $(CFLAGS) -c -o $@ $< -I../../include -Wall precheck: - ../../buildaux/mkdeps.exe ../../include -- *.cpp + ../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../include -- *.cpp @true clean: diff --git a/src/emulation/Makefile b/src/emulation/Makefile index 8d8010fd..8464066a 100644 --- a/src/emulation/Makefile +++ b/src/emulation/Makefile @@ -8,19 +8,19 @@ __all__.files: $(CORES_FILES) lua ../genfilelist.lua $^ >$@ cat $(CORES_FLAGS) >$(ALLFLAGS) -make-ports.exe: make-ports.cpp ../library/json.cpp ../library/utf8.cpp ../library/string.cpp ../library/portctrl-parse.cpp ../library/portctrl-data.cpp ../library/sha256.cpp ../library/assembler.cpp ../library/hex.cpp ../library/eatarg.cpp ../library/int24.cpp ../library/binarystream.cpp ../library/integer-pool.cpp +make-ports$(DOT_EXECUTABLE_SUFFIX): make-ports.cpp ../library/json.cpp ../library/utf8.cpp ../library/string.cpp ../library/portctrl-parse.cpp ../library/portctrl-data.cpp ../library/sha256.cpp ../library/assembler.cpp ../library/hex.cpp ../library/eatarg.cpp ../library/int24.cpp ../library/binarystream.cpp ../library/integer-pool.cpp $(HOSTCC) -g -std=gnu++0x -I../../include/library -o $@ $^ -lboost_regex$(HOST_BOOST_POSTFIX) -lboost_system$(HOST_BOOST_POSTFIX) -Wall -DNO_ASM_GENERATION -bsnes-legacy/$(ALLFILES): forcelook make-ports.exe +bsnes-legacy/$(ALLFILES): forcelook make-ports$(DOT_EXECUTABLE_SUFFIX) $(MAKE) -C bsnes-legacy -gambatte/$(ALLFILES): forcelook make-ports.exe +gambatte/$(ALLFILES): forcelook make-ports$(DOT_EXECUTABLE_SUFFIX) $(MAKE) -C gambatte -sky/$(ALLFILES): forcelook make-ports.exe +sky/$(ALLFILES): forcelook make-ports$(DOT_EXECUTABLE_SUFFIX) $(MAKE) -C sky -test/$(ALLFILES): forcelook make-ports.exe +test/$(ALLFILES): forcelook make-ports$(DOT_EXECUTABLE_SUFFIX) $(MAKE) -C test .PRECIOUS: %.$(OBJECT_SUFFIX) %.files @@ -37,7 +37,7 @@ clean: $(MAKE) -C gambatte clean $(MAKE) -C sky clean $(MAKE) -C test clean - rm -f make-ports.exe + rm -f make-ports$(DOT_EXECUTABLE_SUFFIX) forcelook: @true diff --git a/src/emulation/bsnes-legacy/Makefile b/src/emulation/bsnes-legacy/Makefile index 02039a70..1475fce9 100644 --- a/src/emulation/bsnes-legacy/Makefile +++ b/src/emulation/bsnes-legacy/Makefile @@ -37,8 +37,8 @@ __all__.files: $(OBJECTS) ../../../$(BSNES_LIBRARY) $(MAKE) -C ../../../bsnes $(BSNES_PROFILE_STRING) $(BSNES_TARGET_STRING) $(REALRANLIB) $@ -ports.inc: ports.json ../make-ports.exe - ../make-ports.exe <$< >$@ +ports.inc: ports.json ../make-ports$(DOT_EXECUTABLE_SUFFIX) + ../make-ports$(DOT_EXECUTABLE_SUFFIX) <$< >$@ %.$(OBJECT_SUFFIX): %.cpp %.cpp.dep ports.inc $(REALCC) -c -o $@ $< -I../../../include -I../../../bsnes $(CFLAGS) $(BSNES_CFLAGS) -Wreturn-type @@ -55,7 +55,7 @@ forcelook: @true precheck: - ../../../buildaux/mkdeps.exe ../../../include -- *.cpp + ../../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../../include -- *.cpp @true clean: diff --git a/src/emulation/gambatte/Makefile b/src/emulation/gambatte/Makefile index d4ffd9a7..09c54f69 100644 --- a/src/emulation/gambatte/Makefile +++ b/src/emulation/gambatte/Makefile @@ -15,8 +15,8 @@ __all__.files: $(OBJECTS) ../../../$(GAMBATTE_LIBRARY) $(MAKE) -C ../../../gambatte $(REALRANLIB) $@ -ports.inc: ports.json ../make-ports.exe - ../make-ports.exe <$< >$@ +ports.inc: ports.json ../make-ports$(DOT_EXECUTABLE_SUFFIX) + ../make-ports$(DOT_EXECUTABLE_SUFFIX) <$< >$@ %.$(OBJECT_SUFFIX): %.cpp %.cpp.dep ports.inc $(REALCC) -c -o $@ $< -I../../../include -I../../../gambatte $(CFLAGS) $(GAMBATTE_CFLAGS) -Wreturn-type @@ -34,7 +34,7 @@ forcelook: @true precheck: - ../../../buildaux/mkdeps.exe ../../../include ../../../gambatte -- *.cpp + ../../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../../include ../../../gambatte -- *.cpp @true clean: diff --git a/src/emulation/sky/Makefile b/src/emulation/sky/Makefile index 16ab9bce..35b5a8c9 100644 --- a/src/emulation/sky/Makefile +++ b/src/emulation/sky/Makefile @@ -13,7 +13,7 @@ forcelook: @true precheck: - ../../../buildaux/mkdeps.exe ../../../include -- *.cpp + ../../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../../include -- *.cpp @true clean: diff --git a/src/emulation/test/Makefile b/src/emulation/test/Makefile index 3256542a..f6b6f558 100644 --- a/src/emulation/test/Makefile +++ b/src/emulation/test/Makefile @@ -6,8 +6,8 @@ __all__.files: $(OBJECTS) lua ../../genfilelist.lua $^ >$@ echo >__all__.ldflags -ports.inc: ports.json ../make-ports.exe - ../make-ports.exe <$< >$@ +ports.inc: ports.json ../make-ports$(DOT_EXECUTABLE_SUFFIX) + ../make-ports$(DOT_EXECUTABLE_SUFFIX) <$< >$@ %.$(OBJECT_SUFFIX): %.cpp %.cpp.dep ports.inc $(REALCC) -c -o $@ $< -I../../../include $(CFLAGS) @@ -16,7 +16,7 @@ forcelook: @true precheck: - ../../../buildaux/mkdeps.exe ../../../include -- *.cpp + ../../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../../include -- *.cpp @true clean: diff --git a/src/fonts/Makefile b/src/fonts/Makefile index 741aa4bf..0ac0405c 100644 --- a/src/fonts/Makefile +++ b/src/fonts/Makefile @@ -19,7 +19,7 @@ font.cpp font.cpp.dep: $(FONT_SRC) touch font.cpp.dep precheck: - ../../buildaux/mkdeps.exe ../../include -- *.cpp + ../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../include -- *.cpp @true forcelook: diff --git a/src/interface/Makefile b/src/interface/Makefile index 0ceed139..7f1f6b69 100644 --- a/src/interface/Makefile +++ b/src/interface/Makefile @@ -10,7 +10,7 @@ __all__.files: $(OBJECTS) $(REALCC) $(CFLAGS) -c -o $@ $< -I../../include -Wall precheck: - ../../buildaux/mkdeps.exe ../../include -- *.cpp + ../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../include -- *.cpp @true forcelook: diff --git a/src/library/Makefile b/src/library/Makefile index 88fcd133..f1e0a0f0 100644 --- a/src/library/Makefile +++ b/src/library/Makefile @@ -10,7 +10,7 @@ __all__.files: $(OBJECTS) $(REALCC) $(CFLAGS) -c -o $@ $< -I../../include/library -Wall precheck: forcelook - ../../buildaux/mkdeps.exe ../../include/library -- *.cpp + ../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../include/library -- *.cpp @true forcelook: diff --git a/src/lua/Makefile b/src/lua/Makefile index 7b9dc303..5a4737b2 100644 --- a/src/lua/Makefile +++ b/src/lua/Makefile @@ -8,7 +8,7 @@ __all__.files: $(OBJECTS) sysrc.cpp: sysrc.lua luac -p $< - ../../buildaux/txt2cstr.exe lua_sysrc_script $< >$@ + ../../buildaux/txt2cstr$(DOT_EXECUTABLE_SUFFIX) lua_sysrc_script $< >$@ sysrc.cpp.dep: sysrc.cpp touch sysrc.cpp.dep @@ -17,7 +17,7 @@ sysrc.cpp.dep: sysrc.cpp $(REALCC) -c -o $@ $< -I../../include $(CFLAGS) -Wall precheck: - ../../buildaux/mkdeps.exe ../../include -- *.cpp + ../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../include -- *.cpp @true forcelook: diff --git a/src/platform/evdev/Makefile b/src/platform/evdev/Makefile index 83fab40a..e94f7c2a 100644 --- a/src/platform/evdev/Makefile +++ b/src/platform/evdev/Makefile @@ -14,7 +14,7 @@ __all__.files: $(OBJECTS) $(REALCC) -c -o $@ $< -I../../../include $(CFLAGS) -Wall precheck: - ../../../buildaux/mkdeps.exe ../../../include -- *.cpp + ../../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../../include -- *.cpp @true forcelook: diff --git a/src/platform/libao/Makefile b/src/platform/libao/Makefile index 377bf088..79a4a852 100644 --- a/src/platform/libao/Makefile +++ b/src/platform/libao/Makefile @@ -16,7 +16,7 @@ __all__.files: $(OBJECTS) $(REALCC) -c -o $@ $< -I../../../include $(CFLAGS) $(PA_CFLAGS) precheck: - ../../../buildaux/mkdeps.exe ../../../include -- *.cpp + ../../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../../include -- *.cpp @true forcelook: diff --git a/src/platform/macosx/Makefile b/src/platform/macosx/Makefile index 9eaa2231..2fe91e62 100644 --- a/src/platform/macosx/Makefile +++ b/src/platform/macosx/Makefile @@ -17,7 +17,7 @@ __all__.files: $(OBJECTS) $(REALCC) -DSDL_JOYSTICK_IOKIT -x c --std=gnu99 -c -o $@ $< $(CSTDFLAGS) precheck: - ../../../buildaux/mkdeps.exe ../../../include -- *.cpp *.c + ../../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../../include -- *.cpp *.c @true forcelook: diff --git a/src/platform/portaudio/Makefile b/src/platform/portaudio/Makefile index b823186f..bb087108 100644 --- a/src/platform/portaudio/Makefile +++ b/src/platform/portaudio/Makefile @@ -17,7 +17,7 @@ __all__.files: $(OBJECTS) $(REALCC) -c -o $@ $< -I../../../include $(CFLAGS) $(PA_CFLAGS) -Wall precheck: - ../../../buildaux/mkdeps.exe ../../../include -- *.cpp + ../../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../../include -- *.cpp @true forcelook: diff --git a/src/platform/win32mm/Makefile b/src/platform/win32mm/Makefile index 8d21cf4f..c1865b65 100644 --- a/src/platform/win32mm/Makefile +++ b/src/platform/win32mm/Makefile @@ -14,7 +14,7 @@ __all__.files: $(OBJECTS) $(REALCC) -c -o $@ $< -I../../../include $(CFLAGS) precheck: - ../../../buildaux/mkdeps.exe ../../../include -- *.cpp + ../../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../../include -- *.cpp @true forcelook: diff --git a/src/platform/wxwidgets/Makefile b/src/platform/wxwidgets/Makefile index f6679ba6..332f150a 100644 --- a/src/platform/wxwidgets/Makefile +++ b/src/platform/wxwidgets/Makefile @@ -24,7 +24,7 @@ __all__.files: $(OBJECTS) $(REALCC) -c -o $@ $< -I../../../include $(CFLAGS) $(WXW_CFLAGS) precheck: - ../../../buildaux/mkdeps.exe ../../../include -- *.cpp + ../../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../../include -- *.cpp @true forcelook: diff --git a/src/util/Makefile b/src/util/Makefile index 11ad6e5d..1473f3e5 100644 --- a/src/util/Makefile +++ b/src/util/Makefile @@ -9,7 +9,7 @@ __all_files__: $(OBJECTS) $(REALCC) -c -o $@ $< -I../../include $(CFLAGS) precheck: - ../../buildaux/mkdeps.exe ../../include -- *.cpp + ../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../include -- *.cpp @true forcelook: diff --git a/src/video/Makefile b/src/video/Makefile index 9eb933a6..456a5551 100644 --- a/src/video/Makefile +++ b/src/video/Makefile @@ -21,7 +21,7 @@ forcelook: @true precheck: - ../../buildaux/mkdeps.exe ../../include -- *.cpp + ../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../include -- *.cpp $(MAKE) -C avi precheck clean: diff --git a/src/video/avi/Makefile b/src/video/avi/Makefile index 398278f7..14f5a1f0 100644 --- a/src/video/avi/Makefile +++ b/src/video/avi/Makefile @@ -15,7 +15,7 @@ forcelook: @true precheck: - ../../../buildaux/mkdeps.exe ../../../include -- *.cpp + ../../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../../include -- *.cpp $(MAKE) -C codec precheck clean: diff --git a/src/video/avi/codec/audio/Makefile b/src/video/avi/codec/audio/Makefile index fdd71139..77f5ef50 100644 --- a/src/video/avi/codec/audio/Makefile +++ b/src/video/avi/codec/audio/Makefile @@ -9,7 +9,7 @@ __all__.files: $(OBJECTS) $(REALCC) $(CFLAGS) -c -o $@ $< -I../../../../../include precheck: - ../../../../../buildaux/mkdeps.exe ../../../../../include -- *.cpp + ../../../../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../../../../include -- *.cpp @true forcelook: diff --git a/src/video/avi/codec/video/Makefile b/src/video/avi/codec/video/Makefile index fdd71139..77f5ef50 100644 --- a/src/video/avi/codec/video/Makefile +++ b/src/video/avi/codec/video/Makefile @@ -9,7 +9,7 @@ __all__.files: $(OBJECTS) $(REALCC) $(CFLAGS) -c -o $@ $< -I../../../../../include precheck: - ../../../../../buildaux/mkdeps.exe ../../../../../include -- *.cpp + ../../../../../buildaux/mkdeps$(DOT_EXECUTABLE_SUFFIX) ../../../../../include -- *.cpp @true forcelook: