mirror of
https://github.com/celisej567/mcpe.git
synced 2026-01-04 14:09:47 +03:00
Update makefile to also compile zlib.
This commit is contained in:
43
Makefile
43
Makefile
@@ -1,20 +1,41 @@
|
||||
# ReMinecraftPE - Makefile for linux
|
||||
|
||||
# Commonly included directories.
|
||||
SRC_DIR=source
|
||||
BLD_DIR=build
|
||||
RAKNET_DIR=thirdparty/raknet
|
||||
PLATFORM_DIR=platforms
|
||||
RKN_DIR=thirdparty/raknet
|
||||
ZLB_DIR=thirdparty/zlib
|
||||
PLT_DIR=platforms
|
||||
|
||||
# Target executable's name.
|
||||
TARGET=minecraftcpp
|
||||
|
||||
# Compilation flags for C++ source files
|
||||
CXXFLAGS=-Isource -I. -Ithirdparty/raknet -DUSE_SDL -DUSE_OPENAL -DUSE_MATH_DEFINES -DHANDLE_CHARS_SEPARATELY -O3 -MMD
|
||||
|
||||
# Compilation flags for zlib source files
|
||||
ZLIBFLAGS=-O3 -I. -MMD
|
||||
|
||||
# Link flags
|
||||
LINKFLAGS=-L/opt/vc/lib/ -lpng -lpthread -lSDL2 -lGL -lopenal -lGLU
|
||||
|
||||
#include everything in source/, plus certain files from platforms
|
||||
SRC_FILES = $(shell find $(SRC_DIR) -type f -name '*.cpp')
|
||||
PLT_FILES = $(shell find platforms/sdl platforms/openal -type f -name '*.cpp')
|
||||
RKN_FILES = $(shell find $(RAKNET_DIR) -type f -name '*.cpp')
|
||||
OBJ_FILES = $(patsubst $(SRC_DIR)/%,$(BLD_DIR)/s/%,$(SRC_FILES:.cpp=.o)) $(patsubst $(PLATFORM_DIR)/%,$(BLD_DIR)/p/%,$(PLT_FILES:.cpp=.o)) $(patsubst $(PLATFORM_DIR)/%,$(BLD_DIR)/r/%,$(RKN_FILES:.cpp=.o))
|
||||
DEP_FILES = $(patsubst $(SRC_DIR)/%,$(BLD_DIR)/s/%,$(SRC_FILES:.cpp=.d)) $(patsubst $(PLATFORM_DIR)/%,$(BLD_DIR)/p/%,$(PLT_FILES:.cpp=.d)) $(patsubst $(PLATFORM_DIR)/%,$(BLD_DIR)/r/%,$(RKN_FILES:.cpp=.d))
|
||||
SRC_FILES = $(shell find $(SRC_DIR) -type f -name '*.cpp')
|
||||
PLT_FILES = $(shell find $(PLT_DIR)/sdl $(PLT_DIR)/openal -type f -name '*.cpp')
|
||||
RKN_FILES = $(shell find $(RKN_DIR) -type f -name '*.cpp')
|
||||
ZLB_FILES = $(shell find $(ZLB_DIR) -type f -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 $(ZLB_DIR)/%,$(BLD_DIR)/z/%,$(ZLB_FILES:.c=.o))
|
||||
|
||||
DEP_FILES = \
|
||||
$(patsubst $(SRC_DIR)/%,$(BLD_DIR)/s/%,$(SRC_FILES:.cpp=.d)) \
|
||||
$(patsubst $(PLT_DIR)/%,$(BLD_DIR)/p/%,$(PLT_FILES:.cpp=.d)) \
|
||||
$(patsubst $(RKN_DIR)/%,$(BLD_DIR)/r/%,$(RKN_FILES:.cpp=.d)) \
|
||||
$(patsubst $(ZLB_DIR)/%,$(BLD_DIR)/z/%,$(ZLB_FILES:.c=.d))
|
||||
|
||||
#default target.
|
||||
.PHONY = all
|
||||
@@ -38,10 +59,12 @@ $(BLD_DIR)/p/%.o: $(PLATFORM_DIR)/%.cpp
|
||||
$(BLD_DIR)/r/%.o: $(RAKNET_DIR)/%.cpp
|
||||
@mkdir -p $(dir $@)
|
||||
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
||||
|
||||
|
||||
program: $(TARGET)
|
||||
|
||||
$(BLD_DIR)/z/%.o: $(ZLIB_DIR)/%.c
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) $(ZLIBFLAGS) -c -o $@ $<
|
||||
|
||||
program: $(TARGET)
|
||||
|
||||
clean:
|
||||
rm -rf $(BLD_DIR)
|
||||
|
||||
Reference in New Issue
Block a user