mirror of
https://github.com/ReMinecraftPE/mcpe.git
synced 2025-01-22 09:11:56 -05:00
86 lines
2.4 KiB
Text
86 lines
2.4 KiB
Text
# ReMinecraftPE - Makefile for MinGW
|
|
|
|
# User Settings
|
|
EMULATE_VBOS ?= no
|
|
|
|
ifeq ($(EMULATE_VBOS), yes)
|
|
VBO_EMULATION_FLAG = -DUSE_GL_VBO_EMULATION
|
|
endif
|
|
|
|
# Commonly included directories.
|
|
SRC_DIR=source
|
|
BLD_DIR=build
|
|
RKN_DIR=thirdparty/raknet
|
|
ZLB_DIR=thirdparty/zlib
|
|
PLT_DIR=platforms
|
|
TGL_DIR=thirdparty/GL
|
|
|
|
# Target executable's name.
|
|
TARGET=minecraftcpp.exe
|
|
|
|
# Compilation flags for C++ source files
|
|
CXXFLAGS=-Isource -I. -Ithirdparty/raknet -Ithirdparty/zlib -DUSE_MATH_DEFINES -DSHA1_HAS_TCHAR -DHANDLE_CHARS_SEPARATELY -DUSE_WIN32_THREADS -DLOCKLESS_TYPES_USE_MUTEX -DNDEBUG -O3 -mno-sse -mno-sse2 -mno-mmx -march=i386 -MMD $(VBO_EMULATION_FLAG)
|
|
|
|
# Compilation flags for zlib source files
|
|
ZLIBFLAGS=-O3 -I. -MMD -Ithirdparty/stb_image/include
|
|
|
|
# Link flags
|
|
LINKFLAGS=-lopengl32 -lws2_32 -lglu32 -lgdi32 -ldsound -ldxguid -luuid -static-libgcc -mwindows
|
|
|
|
#include everything in source/, plus certain files from platforms
|
|
SRC_FILES = $(shell find $(SRC_DIR) -name '*.cpp')
|
|
PLT_FILES = $(shell find $(PLT_DIR)/windows -name '*.cpp')
|
|
RKN_FILES = $(shell find $(RKN_DIR) -name '*.cpp')
|
|
TGL_FILES = $(shell find $(TGL_DIR) -name '*.cpp')
|
|
ZLB_FILES = $(shell find $(ZLB_DIR) -name '*.c')
|
|
|
|
OBJ_FILES = \
|
|
$(patsubst $(SRC_DIR)/%,$(BLD_DIR)/s/%,$(SRC_FILES:.cpp=.o)) \
|
|
$(patsubst $(PLT_DIR)/%,$(BLD_DIR)/p/%,$(PLT_FILES:.cpp=.o)) \
|
|
$(patsubst $(RKN_DIR)/%,$(BLD_DIR)/r/%,$(RKN_FILES:.cpp=.o)) \
|
|
$(patsubst $(TGL_DIR)/%,$(BLD_DIR)/g/%,$(TGL_FILES:.cpp=.o)) \
|
|
$(patsubst $(ZLB_DIR)/%,$(BLD_DIR)/z/%,$(ZLB_FILES:.c=.o)) \
|
|
build/t/stb_image_impl.o
|
|
|
|
DEP_FILES = $(OBJ_FILES:.o=.d))
|
|
|
|
#default target.
|
|
.PHONY = all
|
|
all: program
|
|
|
|
#link rules for the executable
|
|
$(TARGET): $(OBJ_FILES)
|
|
$(CXX) -o $@ $^ $(LINKFLAGS)
|
|
|
|
#include header dependencies
|
|
-include $(DEP_FILES)
|
|
|
|
$(BLD_DIR)/p/%.o: $(PLT_DIR)/%.cpp
|
|
@mkdir -p $(dir $@)
|
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
$(BLD_DIR)/g/%.o: $(TGL_DIR)/%.cpp
|
|
@mkdir -p $(dir $@)
|
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
$(BLD_DIR)/r/%.o: $(RKN_DIR)/%.cpp
|
|
@mkdir -p $(dir $@)
|
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
$(BLD_DIR)/z/%.o: $(ZLB_DIR)/%.c
|
|
@mkdir -p $(dir $@)
|
|
$(CC) $(ZLIBFLAGS) -c -o $@ $<
|
|
|
|
$(BLD_DIR)/s/%.o: $(SRC_DIR)/%.cpp
|
|
@mkdir -p $(dir $@)
|
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
$(BLD_DIR)/t/%.o: thirdparty/stb_image/src/%.c
|
|
@mkdir -p $(dir $@)
|
|
$(CC) $(ZLIBFLAGS) -c -o $@ $<
|
|
|
|
program: $(TARGET)
|
|
|
|
clean:
|
|
rm -rf $(BLD_DIR)
|
|
rm -rf minecraftcpp
|