ref: d7ca8b3874ba13acc2ab50954e55fcb5a4744f54
parent: 199e21623e35524b919a191b2cc2de3b7f58185d
author: Clownacy <Clownacy@users.noreply.github.com>
date: Thu Apr 2 10:23:10 EDT 2020
Remove the Makefile Made redundant by CMake, and it's an absolute pain to maintain.
--- a/.travis.yml
+++ b/.travis.yml
@@ -48,25 +48,12 @@
update: true
env:
- - BUILD_SYSTEM=make RENDERER=Software
- - BUILD_SYSTEM=make RENDERER=SDLSurface
- - BUILD_SYSTEM=make RENDERER=SDLTexture
- - BUILD_SYSTEM=make RENDERER=OpenGL3
- - BUILD_SYSTEM=make RENDERER=OpenGLES2
- - BUILD_SYSTEM=cmake RENDERER=Software
- - BUILD_SYSTEM=cmake RENDERER=SDLSurface
- - BUILD_SYSTEM=cmake RENDERER=SDLTexture
- - BUILD_SYSTEM=cmake RENDERER=OpenGL3
- - BUILD_SYSTEM=cmake RENDERER=OpenGLES2
+ - RENDERER=Software
+ - RENDERER=SDLSurface
+ - RENDERER=SDLTexture
+ - RENDERER=OpenGL3
+ - RENDERER=OpenGLES2
-jobs:
- exclude:
- # Apple's OpenGL is in a non-standard location, so these builds don't work
- - os: osx
- env: BUILD_SYSTEM=make RENDERER=OpenGL3
- - os: osx
- env: BUILD_SYSTEM=make RENDERER=OpenGLES2
-
before_install:
# Set URL for Discord send script
- DISCORD_SEND_SCRIPT_URL=https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
@@ -78,9 +65,6 @@
# Display Travis OS name
- echo $TRAVIS_OS_NAME
- # Display build type
- - echo $BUILD_SYSTEM
-
# The following Homebrew packages aren't linked by default, and need to be prepended to the path explicitly.
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
export PATH="$(brew --prefix llvm)/bin:$PATH";
@@ -122,25 +106,15 @@
fi
before_script:
- - |
- if [ "$BUILD_SYSTEM" == "cmake" ]; then
- # Make build directory and generate CMake build files
- mkdir -p ${CMAKE_BUILD_DIR} && cd ${CMAKE_BUILD_DIR}
- cmake .. -DCMAKE_BUILD_TYPE=Release -DFIX_BUGS=ON -DRENDERER=$RENDERER -DCMAKE_C_FLAGS="-Wall -Wextra -pedantic" -DCMAKE_CXX_FLAGS="-Wall -Wextra -pedantic"
- cd ..
- fi
+ # Make build directory and generate CMake build files
+ - mkdir -p ${CMAKE_BUILD_DIR} && cd ${CMAKE_BUILD_DIR}
+ - cmake .. -DCMAKE_BUILD_TYPE=Release -DFIX_BUGS=ON -DRENDERER=$RENDERER -DCMAKE_C_FLAGS="-Wall -Wextra -pedantic" -DCMAKE_CXX_FLAGS="-Wall -Wextra -pedantic"
+ - cd ..
script:
- - |
- if [ "$BUILD_SYSTEM" == "cmake" ]; then
- # CMake build
- cd ${CMAKE_BUILD_DIR}
- cmake --build . --config Release --parallel $JOBS
- cd ..
- else
- # Make build
- make -j $JOBS FIX_BUGS=1 RELEASE=1 RENDERER=$RENDERER CFLAGS="-Wall -Wextra -pedantic" CXXFLAGS="-Wall -Wextra -pedantic"
- fi
+ - cd ${CMAKE_BUILD_DIR}
+ - cmake --build . --config Release --parallel $JOBS
+ - cd ..
after_success:
# Send success notification to Discord through DISCORD_WEBHOOK_URL
--- a/Makefile
+++ /dev/null
@@ -1,307 +1,0 @@
-NATIVECC ?= cc
-NATIVECXX ?= c++
-WINDRES ?= windres
-PKGCONFIG ?= pkg-config
-
-ASSETS_DIRECTORY = assets
-
-# Default options
-BACKEND_RENDERER = SDLTexture
-BACKEND_AUDIO = SDL2
-
-ALL_CFLAGS = $(CFLAGS)
-ALL_CXXFLAGS = $(CXXFLAGS)
-ALL_LDFLAGS = $(LDFLAGS)
-ALL_LIBS = $(LIBS)
-
-ifeq ($(WINDOWS), 1)
- EXE_EXTENSION = .exe
-endif
-
-ifeq ($(RELEASE), 1)
- ALL_CFLAGS += -O3 -DNDEBUG
- ALL_CXXFLAGS += -O3 -DNDEBUG
- ALL_LDFLAGS += -s
- FILENAME_DEF = CSE2$(EXE_EXTENSION)
- DOCONFIG_FILENAME_DEF = DoConfig$(EXE_EXTENSION)
-else
- ALL_CFLAGS += -Og -ggdb3
- ALL_CXXFLAGS += -Og -ggdb3
- FILENAME_DEF = CSE2_debug$(EXE_EXTENSION)
- DOCONFIG_FILENAME_DEF = DoConfig_debug$(EXE_EXTENSION)
-endif
-
-ifeq ($(JAPANESE), 1)
- BUILD_DIRECTORY = game_japanese
-
- DEFINES += -DJAPANESE
-else
- BUILD_DIRECTORY = game_english
-endif
-
-FILENAME ?= $(FILENAME_DEF)
-DOCONFIG_FILENAME ?= $(DOCONFIG_FILENAME_DEF)
-
-ifeq ($(FIX_BUGS), 1)
- DEFINES += -DFIX_BUGS
-endif
-
-ifeq ($(DEBUG_SAVE), 1)
- DEFINES += -DDEBUG_SAVE
-endif
-
-ALL_CFLAGS += -std=c99 -MMD -MP -MF $@.d
-CSE2_CFLAGS += $(shell $(PKGCONFIG) sdl2 --cflags) $(shell $(PKGCONFIG) freetype2 --cflags)
-
-ALL_CXXFLAGS += -std=c++11 -MMD -MP -MF $@.d
-CSE2_CXXFLAGS += $(shell $(PKGCONFIG) sdl2 --cflags) $(shell $(PKGCONFIG) freetype2 --cflags)
-
-ifeq ($(STATIC), 1)
- ALL_LDFLAGS += -static
- CSE2_LIBS += $(shell $(PKGCONFIG) sdl2 --libs --static) $(shell $(PKGCONFIG) freetype2 --libs --static) -lfreetype
- DOCONFIG_LIBS += $(shell fltk-config --cxxflags --libs --ldstaticflags)
-else
- CSE2_LIBS += $(shell $(PKGCONFIG) sdl2 --libs) $(shell $(PKGCONFIG) freetype2 --libs)
- DOCONFIG_LIBS += $(shell fltk-config --cxxflags --libs --ldflags)
-endif
-
-SOURCES = \
- src/ArmsItem.cpp \
- src/Back.cpp \
- src/Bitmap.cpp \
- src/Boss.cpp \
- src/BossAlmo1.cpp \
- src/BossAlmo2.cpp \
- src/BossBallos.cpp \
- src/BossFrog.cpp \
- src/BossIronH.cpp \
- src/BossLife.cpp \
- src/BossOhm.cpp \
- src/BossPress.cpp \
- src/BossTwinD.cpp \
- src/BossX.cpp \
- src/BulHit.cpp \
- src/Bullet.cpp \
- src/Caret.cpp \
- src/Config.cpp \
- src/Draw.cpp \
- src/Ending.cpp \
- src/Escape.cpp \
- src/Fade.cpp \
- src/File.cpp \
- src/Flags.cpp \
- src/Flash.cpp \
- src/Font.cpp \
- src/Frame.cpp \
- src/Game.cpp \
- src/Generic.cpp \
- src/GenericLoad.cpp \
- src/Input.cpp \
- src/KeyControl.cpp \
- src/Main.cpp \
- src/Map.cpp \
- src/MapName.cpp \
- src/MiniMap.cpp \
- src/MyChar.cpp \
- src/MycHit.cpp \
- src/MycParam.cpp \
- src/NpcAct000.cpp \
- src/NpcAct020.cpp \
- src/NpcAct040.cpp \
- src/NpcAct060.cpp \
- src/NpcAct080.cpp \
- src/NpcAct100.cpp \
- src/NpcAct120.cpp \
- src/NpcAct140.cpp \
- src/NpcAct160.cpp \
- src/NpcAct180.cpp \
- src/NpcAct200.cpp \
- src/NpcAct220.cpp \
- src/NpcAct240.cpp \
- src/NpcAct260.cpp \
- src/NpcAct280.cpp \
- src/NpcAct300.cpp \
- src/NpcAct320.cpp \
- src/NpcAct340.cpp \
- src/NpChar.cpp \
- src/NpcHit.cpp \
- src/NpcTbl.cpp \
- src/Organya.cpp \
- src/PixTone.cpp \
- src/Profile.cpp \
- src/Random.cpp \
- src/Resource.cpp \
- src/SelStage.cpp \
- src/Shoot.cpp \
- src/Sound.cpp \
- src/Stage.cpp \
- src/Star.cpp \
- src/TextScr.cpp \
- src/Triangle.cpp \
- src/ValueView.cpp
-
-RESOURCES = \
- BITMAP/Credit01.bmp \
- BITMAP/Credit02.bmp \
- BITMAP/Credit03.bmp \
- BITMAP/Credit04.bmp \
- BITMAP/Credit05.bmp \
- BITMAP/Credit06.bmp \
- BITMAP/Credit07.bmp \
- BITMAP/Credit08.bmp \
- BITMAP/Credit09.bmp \
- BITMAP/Credit10.bmp \
- BITMAP/Credit11.bmp \
- BITMAP/Credit12.bmp \
- BITMAP/Credit14.bmp \
- BITMAP/Credit15.bmp \
- BITMAP/Credit16.bmp \
- BITMAP/Credit17.bmp \
- BITMAP/Credit18.bmp \
- CURSOR/CURSOR_IKA.bmp \
- CURSOR/CURSOR_NORMAL.bmp \
- ORG/Access.org \
- ORG/Anzen.org \
- ORG/Balcony.org \
- ORG/Ballos.org \
- ORG/BreakDown.org \
- ORG/Cemetery.org \
- ORG/Curly.org \
- ORG/Dr.org \
- ORG/Ending.org \
- ORG/Escape.org \
- ORG/Fanfale1.org \
- ORG/Fanfale2.org \
- ORG/Fanfale3.org \
- ORG/FireEye.org \
- ORG/Gameover.org \
- ORG/Ginsuke.org \
- ORG/Grand.org \
- ORG/Gravity.org \
- ORG/Hell.org \
- ORG/ironH.org \
- ORG/Jenka.org \
- ORG/Jenka2.org \
- ORG/Kodou.org \
- ORG/LastBtl3.org \
- ORG/LastBtl.org \
- ORG/LastCave.org \
- ORG/Marine.org \
- ORG/Maze.org \
- ORG/MDown2.org \
- ORG/Mura.org \
- ORG/Oside.org \
- ORG/Plant.org \
- ORG/quiet.org \
- ORG/Requiem.org \
- ORG/Toroko.org \
- ORG/Vivi.org \
- ORG/Wanpak2.org \
- ORG/Wanpaku.org \
- ORG/Weed.org \
- ORG/White.org \
- ORG/XXXX.org \
- ORG/Zonbie.org \
- WAVE/Wave.dat
-
-ifeq ($(JAPANESE), 1)
- RESOURCES += BITMAP/pixel_jp.bmp
-else
- RESOURCES += BITMAP/pixel.bmp
-endif
-
-ifneq ($(WINDOWS), 1)
- RESOURCES += ICON/ICON_MINI.bmp
-endif
-
-ifeq ($(BACKEND_RENDERER), OpenGL3)
- SOURCES += src/Backends/Rendering/OpenGL3.cpp external/glad/src/glad.c
-
- ifeq ($(WINDOWS), 1)
- CSE2_LIBS += -lopengl32
- else
- CSE2_LIBS += -lGL -ldl
- endif
-else ifeq ($(BACKEND_RENDERER), OpenGLES2)
- SOURCES += src/Backends/Rendering/OpenGLES2.cpp
- CSE2_CFLAGS += $(shell $(PKGCONFIG) --cflags glesv2)
- CSE2_CXXFLAGS += $(shell $(PKGCONFIG) --cflags glesv2)
- CSE2_LIBS += $(shell $(PKGCONFIG) --libs glesv2)
-else ifeq ($(BACKEND_RENDERER), SDLTexture)
- SOURCES += src/Backends/Rendering/SDLTexture.cpp
-else ifeq ($(BACKEND_RENDERER), SDLSurface)
- SOURCES += src/Backends/Rendering/SDLSurface.cpp
-else ifeq ($(BACKEND_RENDERER), Software)
- SOURCES += src/Backends/Rendering/Software.cpp
-else
- $(error Invalid BACKEND_RENDERER selected)
-endif
-
-ifeq ($(BACKEND_AUDIO), SDL2)
- SOURCES += src/Backends/Audio/SDL2.cpp src/Backends/Audio/SoftwareMixer.cpp
-else ifeq ($(BACKEND_AUDIO), miniaudio)
- SOURCES += src/Backends/Audio/miniaudio.cpp src/Backends/Audio/SoftwareMixer.cpp
- CSE2_LIBS += -lm -lpthread
-
- ifneq ($(WINDOWS), 1)
- CSE2_LIBS += -ldl
- endif
-else
- $(error Invalid BACKEND_AUDIO selected)
-endif
-
-OBJECTS = $(addprefix obj/$(FILENAME)/, $(addsuffix .o, $(SOURCES)))
-DEPENDENCIES = $(addprefix obj/$(FILENAME)/, $(addsuffix .o.d, $(SOURCES)))
-
-ifeq ($(WINDOWS), 1)
- OBJECTS += obj/$(FILENAME)/windows_resources.o
-endif
-
-all: $(BUILD_DIRECTORY)/$(FILENAME) $(BUILD_DIRECTORY)/$(DOCONFIG_FILENAME)
- $(info Finished)
-
-$(BUILD_DIRECTORY)/$(FILENAME): $(OBJECTS)
- @mkdir -p $(@D)
- $(info Linking $@)
- @$(CXX) $(ALL_CXXFLAGS) $(CSE2_CXXFLAGS) $(ALL_LDFLAGS) $^ -o $@ $(ALL_LIBS) $(CSE2_LIBS)
-
-obj/$(FILENAME)/%.c.o: %.c
- @mkdir -p $(@D)
- $(info Compiling $<)
- @$(CC) $(ALL_CFLAGS) $(CSE2_CFLAGS) $(DEFINES) $< -o $@ -c
-
-obj/$(FILENAME)/%.cpp.o: %.cpp
- @mkdir -p $(@D)
- $(info Compiling $<)
- @$(CXX) $(ALL_CXXFLAGS) $(CSE2_CXXFLAGS) $(DEFINES) $< -o $@ -c
-
-obj/$(FILENAME)/src/Resource.cpp.o: src/Resource.cpp $(addprefix src/Resource/, $(addsuffix .h, $(RESOURCES)))
- @mkdir -p $(@D)
- $(info Compiling $<)
- @$(CXX) $(ALL_CXXFLAGS) $(CSE2_CXXFLAGS) $(DEFINES) $< -o $@ -c
-
-src/Resource/%.h: $(ASSETS_DIRECTORY)/resources/% obj/bin2h
- @mkdir -p $(@D)
- $(info Converting $<)
- @obj/bin2h $< $@
-
-obj/bin2h: bin2h/bin2h.c
- @mkdir -p $(@D)
- $(info Compiling $^)
- @$(NATIVECC) -O3 -s -std=c90 -Wall -Wextra -pedantic $^ -o $@
-
-include $(wildcard $(DEPENDENCIES))
-
-obj/$(FILENAME)/windows_resources.o: $(ASSETS_DIRECTORY)/resources/CSE2.rc $(ASSETS_DIRECTORY)/resources/resource1.h $(ASSETS_DIRECTORY)/resources/afxres.h $(ASSETS_DIRECTORY)/resources/ICON/0.ico
- @mkdir -p $(@D)
- $(info Compiling Windows resource file $<)
- @$(WINDRES) $< $@
-
-$(BUILD_DIRECTORY)/$(DOCONFIG_FILENAME): DoConfig/DoConfig.cpp
- @mkdir -p $(@D)
- $(info Linking $@)
- @$(CXX) $(ALL_CXXFLAGS) $(ALL_LDFLAGS) $^ -o $@ $(DOCONFIG_LIBS)
-
-# TODO
-clean:
- @rm -rf obj
--- a/README.md
+++ b/README.md
@@ -48,10 +48,8 @@
## Building
-### CMake
+This project uses CMake, allowing it to be built with a range of compilers.
-This project primarily uses CMake, allowing it to be built with a range of compilers.
-
Switch to the terminal (Visual Studio users should open the [Developer Command Prompt](https://docs.microsoft.com/en-us/dotnet/framework/tools/developer-command-prompt-for-vs)) and `cd` into this folder. After that, generate the files for your build system with:
```
@@ -88,30 +86,6 @@
```
If you're a Visual Studio user, you can open the generated `CSE2.sln` file instead, which can be found in the `build` folder.
-
-Once built, the executables can be found in the `game_english`/`game_japanese` folder, depending on the selected language.
-
-### Makefile \[deprecated - use CMake instead\]
-
-Run 'make' in this folder, preferably with some of the following settings:
-
-Name | Function
---------|--------
-`JAPANESE=1` | Enable the Japanese-language build (instead of the unofficial Aeon Genesis English translation)
-`FIX_BUGS=1` | Fix various bugs in the game
-`DEBUG_SAVE=1` | Re-enable the ability to drag-and-drop save files onto the window
-`BACKEND_RENDERER=OpenGL3` | Use the hardware-accelerated OpenGL 3.2 renderer
-`BACKEND_RENDERER=OpenGLES2` | Use the hardware-accelerated OpenGL ES 2.0 renderer
-`BACKEND_RENDERER=SDLTexture` | Use the hardware-accelerated SDL2 Texture API renderer (default)
-`BACKEND_RENDERER=SDLSurface` | Use the software-rendered SDL2 Surface API renderer
-`BACKEND_RENDERER=Software` | Use the hand-written software renderer
-`BACKEND_AUDIO=SDL2` | Use the SDL2-driven software audio-mixer
-`BACKEND_AUDIO=miniaudio` | Use the miniaudio-driven software audio-mixer
-`RELEASE=1` | Compile a release build (optimised, stripped, etc.)
-`STATIC=1` | Produce a statically-linked executable (good for Windows builds, so you don't need to bundle DLL files)
-`WINDOWS=1` | Build for Windows
-
-You can pass your own compiler flags by defining `CFLAGS` and `CXXFLAGS`.
Once built, the executables can be found in the `game_english`/`game_japanese` folder, depending on the selected language.