shithub: cstory

Download patch

ref: e2ed9ad950a8f8f599251b74a7c7e87819ab9a46
parent: 2c8ccc5a0b551c8cd4afd38d51469573702a4ef0
author: Clownacy <Clownacy@users.noreply.github.com>
date: Sun Apr 14 14:25:12 EDT 2019

Okay, forget all that. Generating an output folder was stupid.

--- a/.gitignore
+++ b/.gitignore
@@ -3,7 +3,8 @@
 
 # Misc
 /obj
-/build
+/build_en
+/build_jp
 *.dat
 *.rec
 build.7z
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -220,11 +220,9 @@
 
 # Handle options
 if (JAPANESE)
-	set(FILES_DIR "res/files_jp")
 	list(APPEND RESOURCES "BITMAP/PIXEL_JP.bmp")
 	target_compile_definitions(CSE2 PRIVATE JAPANESE)
 else()
-	set(FILES_DIR "res/files_en")
 	list(APPEND RESOURCES "BITMAP/PIXEL.bmp")
 endif()
 
@@ -242,7 +240,7 @@
 
 # Make some tweaks if we're targetting Windows
 if (WIN32)
-	target_sources(CSE2 PRIVATE "res/resources/ICON/ICON.rc")
+	target_sources(CSE2 PRIVATE "res/ICON/ICON.rc")
 	target_compile_definitions(CSE2 PRIVATE WINDOWS)
 	set_target_properties(CSE2 PROPERTIES WIN32_EXECUTABLE YES)	# Disable the console window
 else()
@@ -252,7 +250,7 @@
 # Magic to convert resources to header files
 add_executable(bin2h src/misc/bin2h.c)
 foreach(FILENAME IN LISTS RESOURCES)
-	set(IN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/res/resources")
+	set(IN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/res")
 	set(OUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/Resource")
 	get_filename_component(DIRECTORY "${FILENAME}" DIRECTORY)
 	add_custom_command(
@@ -274,10 +272,6 @@
 endif()
 
 if (MSVC)
-	if (STATIC)
-		message(STATUS "STATIC option doesn't affect MSVC builds")
-	endif()
-
 	# Find dependencies
 
 	# In MSVC we just use our own provided copy of SDL2 and FreeType
@@ -337,20 +331,3 @@
 target_include_directories(CSE2 PRIVATE ${SDL2_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIRS})
 target_compile_options(CSE2 PRIVATE ${SDL2_CFLAGS_OTHER} ${FREETYPE_CFLAGS_OTHER})
 target_link_libraries(CSE2 ${SDL2_LIBRARIES} ${FREETYPE_LIBRARIES})
-
-# Set up the output directory
-
-# Copy the files to the output directory
-file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/${FILES_DIR}/" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/cavestory")
-
-# Send the Release executable to the directory
-set_target_properties(CSE2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_CURRENT_BINARY_DIR}/cavestory")
-
-# On MSVC, copy across SDL2.dll as well
-if (MSVC)
-	if (CMAKE_CL_64)
-		file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/msvc/SDL2/lib/x64/SDL2.dll" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/cavestory")
-	else()
-		file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/msvc/SDL2/lib/x86/SDL2.dll" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/cavestory")
-	endif()
-endif()
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,8 @@
 endif
 
 ifeq ($(JAPANESE), 1)
+	BUILD_DIR = build_jp
+
 	CXXFLAGS += -DJAPANESE
 
 	ifeq ($(RELEASE), 1)
@@ -15,6 +17,8 @@
 	else
 		FILENAME_DEF = debugjp
 	endif
+else
+	BUILD_DIR = build_en
 endif
 
 FILENAME ?= $(FILENAME_DEF)
@@ -200,20 +204,10 @@
 	OBJECTS += obj/$(FILENAME)/win_icon.o
 endif
 
-all: build
+all: $(BUILD_DIR)/$(FILENAME)
 
-ifeq ($(JAPANESE), 1)
-build: res/files_jp obj/$(FILENAME)/$(FILENAME)
-else
-build: res/files_en obj/$(FILENAME)/$(FILENAME)
-endif
+$(BUILD_DIR)/$(FILENAME): $(OBJECTS)
 	@mkdir -p $(@D)
-	@echo "Copying files to 'build'"
-	@cp -r $< $@
-	@cp obj/$(FILENAME)/$(FILENAME) $@
-
-obj/$(FILENAME)/$(FILENAME): $(OBJECTS)
-	@mkdir -p $(@D)
 	@echo Linking
 	@$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
 	@echo Finished compiling: $@
@@ -228,7 +222,7 @@
 	@echo Compiling $<
 	@$(CXX) $(CXXFLAGS) $< -o $@ -c
 
-src/Resource/%.h: res/resources/% obj/bin2h
+src/Resource/%.h: res/% obj/bin2h
 	@mkdir -p $(@D)
 	@echo Converting $<
 	@obj/bin2h $< $@
@@ -240,9 +234,10 @@
 
 include $(wildcard $(DEPENDENCIES))
 
-obj/$(FILENAME)/win_icon.o: res/resources/ICON/ICON.rc res/resources/ICON/0.ico res/resources/ICON/ICON_MINI.ico
+obj/$(FILENAME)/win_icon.o: res/ICON/ICON.rc res/ICON/0.ico res/ICON/ICON_MINI.ico
 	@mkdir -p $(@D)
 	@windres $< $@
 
+# TODO
 clean:
-	@rm -rf build obj
+	@rm -rf obj
binary files /dev/null b/build_en/font/cour.ttf differ
binary files /dev/null b/build_jp/font/msgothic.ttc differ
binary files /dev/null b/res/BITMAP/CREDIT01.bmp differ
binary files /dev/null b/res/BITMAP/CREDIT02.bmp differ
binary files /dev/null b/res/BITMAP/CREDIT03.bmp differ
binary files /dev/null b/res/BITMAP/CREDIT04.bmp differ
binary files /dev/null b/res/BITMAP/CREDIT05.bmp differ
binary files /dev/null b/res/BITMAP/CREDIT06.bmp differ
binary files /dev/null b/res/BITMAP/CREDIT07.bmp differ
binary files /dev/null b/res/BITMAP/CREDIT08.bmp differ
binary files /dev/null b/res/BITMAP/CREDIT09.bmp differ
binary files /dev/null b/res/BITMAP/CREDIT10.bmp differ
binary files /dev/null b/res/BITMAP/CREDIT11.bmp differ
binary files /dev/null b/res/BITMAP/CREDIT12.bmp differ
binary files /dev/null b/res/BITMAP/CREDIT14.bmp differ
binary files /dev/null b/res/BITMAP/CREDIT15.bmp differ
binary files /dev/null b/res/BITMAP/CREDIT16.bmp differ
binary files /dev/null b/res/BITMAP/CREDIT17.bmp differ
binary files /dev/null b/res/BITMAP/CREDIT18.bmp differ
binary files /dev/null b/res/BITMAP/PIXEL.bmp differ
binary files /dev/null b/res/BITMAP/PIXEL_JP.bmp differ
binary files /dev/null b/res/CURSOR/CURSOR_IKA.bmp differ
binary files /dev/null b/res/CURSOR/CURSOR_NORMAL.bmp differ
binary files /dev/null b/res/ICON/0.ico differ
--- /dev/null
+++ b/res/ICON/ICON.rc
@@ -1,0 +1,2 @@
+101 ICON "0.ico"
+102 ICON "ICON_MINI.ico"
binary files /dev/null b/res/ICON/ICON_MINI.bmp differ
binary files /dev/null b/res/ICON/ICON_MINI.ico differ
binary files /dev/null b/res/ORG/ACCESS.org differ
binary files /dev/null b/res/ORG/ANZEN.org differ
binary files /dev/null b/res/ORG/BALCONY.org differ
binary files /dev/null b/res/ORG/BALLOS.org differ
binary files /dev/null b/res/ORG/BDOWN.org differ
binary files /dev/null b/res/ORG/CEMETERY.org differ
binary files /dev/null b/res/ORG/CURLY.org differ
binary files /dev/null b/res/ORG/DR.org differ
binary files /dev/null b/res/ORG/ENDING.org differ
binary files /dev/null b/res/ORG/ESCAPE.org differ
binary files /dev/null b/res/ORG/FANFALE1.org differ
binary files /dev/null b/res/ORG/FANFALE2.org differ
binary files /dev/null b/res/ORG/FANFALE3.org differ
binary files /dev/null b/res/ORG/FIREEYE.org differ
binary files /dev/null b/res/ORG/GAMEOVER.org differ
binary files /dev/null b/res/ORG/GINSUKE.org differ
binary files /dev/null b/res/ORG/GRAND.org differ
binary files /dev/null b/res/ORG/GRAVITY.org differ
binary files /dev/null b/res/ORG/HELL.org differ
binary files /dev/null b/res/ORG/IRONH.org differ
binary files /dev/null b/res/ORG/JENKA.org differ
binary files /dev/null b/res/ORG/JENKA2.org differ
binary files /dev/null b/res/ORG/KODOU.org differ
binary files /dev/null b/res/ORG/LASTBT3.org differ
binary files /dev/null b/res/ORG/LASTBTL.org differ
binary files /dev/null b/res/ORG/LASTCAVE.org differ
binary files /dev/null b/res/ORG/MARINE.org differ
binary files /dev/null b/res/ORG/MAZE.org differ
binary files /dev/null b/res/ORG/MDOWN2.org differ
binary files /dev/null b/res/ORG/MURA.org differ
binary files /dev/null b/res/ORG/OSIDE.org differ
binary files /dev/null b/res/ORG/PLANT.org differ
binary files /dev/null b/res/ORG/QUIET.org differ
binary files /dev/null b/res/ORG/REQUIEM.org differ
binary files /dev/null b/res/ORG/TOROKO.org differ
binary files /dev/null b/res/ORG/VIVI.org differ
binary files /dev/null b/res/ORG/WANPAK2.org differ
binary files /dev/null b/res/ORG/WANPAKU.org differ
binary files /dev/null b/res/ORG/WEED.org differ
binary files /dev/null b/res/ORG/WHITE.org differ
binary files /dev/null b/res/ORG/XXXX.org differ
binary files /dev/null b/res/ORG/ZONBIE.org differ
binary files /dev/null b/res/WAVE/WAVE100 differ
binary files a/res/files_en/font/cour.ttf /dev/null differ
binary files a/res/files_jp/font/msgothic.ttc /dev/null differ
binary files a/res/resources/BITMAP/CREDIT01.bmp /dev/null differ
binary files a/res/resources/BITMAP/CREDIT02.bmp /dev/null differ
binary files a/res/resources/BITMAP/CREDIT03.bmp /dev/null differ
binary files a/res/resources/BITMAP/CREDIT04.bmp /dev/null differ
binary files a/res/resources/BITMAP/CREDIT05.bmp /dev/null differ
binary files a/res/resources/BITMAP/CREDIT06.bmp /dev/null differ
binary files a/res/resources/BITMAP/CREDIT07.bmp /dev/null differ
binary files a/res/resources/BITMAP/CREDIT08.bmp /dev/null differ
binary files a/res/resources/BITMAP/CREDIT09.bmp /dev/null differ
binary files a/res/resources/BITMAP/CREDIT10.bmp /dev/null differ
binary files a/res/resources/BITMAP/CREDIT11.bmp /dev/null differ
binary files a/res/resources/BITMAP/CREDIT12.bmp /dev/null differ
binary files a/res/resources/BITMAP/CREDIT14.bmp /dev/null differ
binary files a/res/resources/BITMAP/CREDIT15.bmp /dev/null differ
binary files a/res/resources/BITMAP/CREDIT16.bmp /dev/null differ
binary files a/res/resources/BITMAP/CREDIT17.bmp /dev/null differ
binary files a/res/resources/BITMAP/CREDIT18.bmp /dev/null differ
binary files a/res/resources/BITMAP/PIXEL.bmp /dev/null differ
binary files a/res/resources/BITMAP/PIXEL_JP.bmp /dev/null differ
binary files a/res/resources/CURSOR/CURSOR_IKA.bmp /dev/null differ
binary files a/res/resources/CURSOR/CURSOR_NORMAL.bmp /dev/null differ
binary files a/res/resources/ICON/0.ico /dev/null differ
--- a/res/resources/ICON/ICON.rc
+++ /dev/null
@@ -1,2 +1,0 @@
-101 ICON "0.ico"
-102 ICON "ICON_MINI.ico"
binary files a/res/resources/ICON/ICON_MINI.bmp /dev/null differ
binary files a/res/resources/ICON/ICON_MINI.ico /dev/null differ
binary files a/res/resources/ORG/ACCESS.org /dev/null differ
binary files a/res/resources/ORG/ANZEN.org /dev/null differ
binary files a/res/resources/ORG/BALCONY.org /dev/null differ
binary files a/res/resources/ORG/BALLOS.org /dev/null differ
binary files a/res/resources/ORG/BDOWN.org /dev/null differ
binary files a/res/resources/ORG/CEMETERY.org /dev/null differ
binary files a/res/resources/ORG/CURLY.org /dev/null differ
binary files a/res/resources/ORG/DR.org /dev/null differ
binary files a/res/resources/ORG/ENDING.org /dev/null differ
binary files a/res/resources/ORG/ESCAPE.org /dev/null differ
binary files a/res/resources/ORG/FANFALE1.org /dev/null differ
binary files a/res/resources/ORG/FANFALE2.org /dev/null differ
binary files a/res/resources/ORG/FANFALE3.org /dev/null differ
binary files a/res/resources/ORG/FIREEYE.org /dev/null differ
binary files a/res/resources/ORG/GAMEOVER.org /dev/null differ
binary files a/res/resources/ORG/GINSUKE.org /dev/null differ
binary files a/res/resources/ORG/GRAND.org /dev/null differ
binary files a/res/resources/ORG/GRAVITY.org /dev/null differ
binary files a/res/resources/ORG/HELL.org /dev/null differ
binary files a/res/resources/ORG/IRONH.org /dev/null differ
binary files a/res/resources/ORG/JENKA.org /dev/null differ
binary files a/res/resources/ORG/JENKA2.org /dev/null differ
binary files a/res/resources/ORG/KODOU.org /dev/null differ
binary files a/res/resources/ORG/LASTBT3.org /dev/null differ
binary files a/res/resources/ORG/LASTBTL.org /dev/null differ
binary files a/res/resources/ORG/LASTCAVE.org /dev/null differ
binary files a/res/resources/ORG/MARINE.org /dev/null differ
binary files a/res/resources/ORG/MAZE.org /dev/null differ
binary files a/res/resources/ORG/MDOWN2.org /dev/null differ
binary files a/res/resources/ORG/MURA.org /dev/null differ
binary files a/res/resources/ORG/OSIDE.org /dev/null differ
binary files a/res/resources/ORG/PLANT.org /dev/null differ
binary files a/res/resources/ORG/QUIET.org /dev/null differ
binary files a/res/resources/ORG/REQUIEM.org /dev/null differ
binary files a/res/resources/ORG/TOROKO.org /dev/null differ
binary files a/res/resources/ORG/VIVI.org /dev/null differ
binary files a/res/resources/ORG/WANPAK2.org /dev/null differ
binary files a/res/resources/ORG/WANPAKU.org /dev/null differ
binary files a/res/resources/ORG/WEED.org /dev/null differ
binary files a/res/resources/ORG/WHITE.org /dev/null differ
binary files a/res/resources/ORG/XXXX.org /dev/null differ
binary files a/res/resources/ORG/ZONBIE.org /dev/null differ
binary files a/res/resources/WAVE/WAVE100 /dev/null differ