Implement play/stop cap and shell music
This commit is contained in:
@@ -40,8 +40,15 @@ else
|
||||
DEP_FILES := $(O_FILES:.o=.d)
|
||||
endif
|
||||
|
||||
TEST_SRCS_C := test/context.c test/level.c test/gl33core/gl33core_renderer.c test/gl20/gl20_renderer.c
|
||||
TEST_SRCS_CPP := test/main.cpp test/audio.cpp
|
||||
TEST_SRCS_C := test/level.c test/gl33core/gl33core_renderer.c test/gl20/gl20_renderer.c
|
||||
TEST_SRCS_CPP := test/main.cpp test/audio.cpp test/context.cpp \
|
||||
test/imgui/imgui.cpp \
|
||||
test/imgui/imgui_demo.cpp \
|
||||
test/imgui/imgui_draw.cpp \
|
||||
test/imgui/imgui_tables.cpp \
|
||||
test/imgui/imgui_widgets.cpp \
|
||||
test/imgui/backends/imgui_impl_sdl2.cpp \
|
||||
test/imgui/backends/imgui_impl_opengl3.cpp
|
||||
TEST_OBJS := $(foreach file,$(TEST_SRCS_C),$(BUILD_DIR)/$(file:.c=.o)) $(foreach file,$(TEST_SRCS_CPP),$(BUILD_DIR)/$(file:.cpp=.o))
|
||||
|
||||
ifdef WINDOWS_BUILD
|
||||
@@ -51,7 +58,7 @@ else ifdef MACOS_BUILD
|
||||
LIB_FILE := $(DIST_DIR)/sm64.dylib
|
||||
endif
|
||||
|
||||
DUMMY := $(shell mkdir -p $(ALL_DIRS) build/test build/test/gl33core build/test/gl20 src/decomp/mario $(DIST_DIR)/include)
|
||||
DUMMY := $(shell mkdir -p $(ALL_DIRS) build/test build/test/gl33core build/test/gl20 build/test/imgui build/test/imgui/backends src/decomp/mario $(DIST_DIR)/include)
|
||||
|
||||
$(filter-out src/decomp/mario/geo.inc.c,$(IMPORTED)): src/decomp/mario/geo.inc.c
|
||||
src/decomp/mario/geo.inc.c: ./import-mario-geo.py
|
||||
@@ -88,21 +95,21 @@ test/level.c: ./import-test-collision.py
|
||||
|
||||
test/main.cpp test/gl20/gl20_renderer.c test/gl33core/gl33core_renderer.c: test/level.c
|
||||
|
||||
SDL2_CFLAGS := $(shell sdl2-config --cflags)
|
||||
|
||||
$(BUILD_DIR)/test/%.o: test/%.c
|
||||
@$(CC) $(CFLAGS) -I src/decomp/include -MM -MP -MT $@ -MF $(BUILD_DIR)/test/$*.d $<
|
||||
$(CC) -c $(CFLAGS) -I src/decomp/include -o $@ $<
|
||||
$(CC) -c $(CFLAGS) $(SDL2_CFLAGS) -I src/decomp/include -o $@ $<
|
||||
|
||||
$(BUILD_DIR)/test/%.o: test/%.cpp
|
||||
@$(CXX) $(CFLAGS) -I src/decomp/include -MM -MP -MT $@ -MF $(BUILD_DIR)/test/$*.d $<
|
||||
$(CXX) -c $(CFLAGS) -I src/decomp/include -std=c++17 -o $@ $<
|
||||
$(CXX) -c $(CFLAGS) $(SDL2_CFLAGS) -I src/decomp/include -std=c++17 -o $@ $<
|
||||
|
||||
$(TEST_FILE): $(LIB_FILE) $(TEST_OBJS)
|
||||
ifdef WINDOWS_BUILD
|
||||
$(CC) -o $@ $(TEST_OBJS) $(LIB_FILE) -lglew32 -lopengl32 -lSDL2 -lSDL2main -lm
|
||||
$(CXX) -o $@ $(TEST_OBJS) $(LIB_FILE) -lglew32 -lopengl32 -lSDL2 -lSDL2main -lm
|
||||
else ifdef MACOS_BUILD
|
||||
$(CC) -o $@ $(TEST_OBJS) $(LIB_FILE) -framework OpenGL -lGLEW -lSDL2 -lSDL2main -lm -lpthread
|
||||
$(CXX) -o $@ $(TEST_OBJS) $(LIB_FILE) -framework OpenGL -lGLEW -lSDL2 -lSDL2main -lm -lpthread
|
||||
else
|
||||
$(CC) -o $@ $(TEST_OBJS) $(LIB_FILE) -lGLEW -lGL -lSDL2 -lSDL2main -lm -lpthread
|
||||
$(CXX) -o $@ $(TEST_OBJS) $(LIB_FILE) -lGLEW -lGL $(shell sdl2-config --libs) -lm -lpthread
|
||||
endif
|
||||
|
||||
lib: $(LIB_FILE) $(LIB_H_FILE)
|
||||
@@ -119,4 +126,4 @@ endif
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR) $(DIST_DIR) $(TEST_FILE)
|
||||
|
||||
-include $(DEP_FILES)
|
||||
-include $(DEP_FILES)
|
||||
Reference in New Issue
Block a user