Last active
November 25, 2016 16:52
-
-
Save diplojocus/10484acb7966108cd317a6e7d71e581d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC = clang | |
CXX = clang++ | |
MKDIR = mkdir -p | |
SRC_DIR = ../source | |
WWISE_SDK_DIR = /home/osiris/Desktop/Wwise/SDK/include | |
PATCH_NAME = sine | |
OUT_DIR = ../build/unix | |
BASEFLAGS = -I$(WWISE_SDK_DIR) -I$(SRC_DIR) -I$(SRC_DIR)/include -I$(SRC_DIR)/heavy -DNDEBUG -msse4.1 -O3 -ffast-math -std=c11 -fPIC -Werror -Wno-unused-function -Wno-\#warnings | |
CFLAGS = $(BASEFLAGS) -std=c11 | |
CXXFLAGS = $(BASEFLAGS) -std=c++11 -Wno-deprecated-writable-strings -fno-exceptions -fno-rtti | |
HEADERS = $(wildcard $(SRC_DIR)/include/*.h) | |
HEADERS += $(wildcard $(SRC_DIR)/heavy/*.h) | |
HEADERS += $(wildcard $(SRC_DIR)/engine/*.h) | |
CFILES = $(wildcard $(SRC_DIR)/heavy/*.c) | |
OBJC = $(CFILES:%.c=%.o) | |
CXXFILES = $(wildcard $(SRC_DIR)/engine/*.cpp) | |
CXXFILES += $(wildcard $(SRC_DIR)/heavy/*.cpp) | |
OBJCXX = $(CXXFILES:%.cpp=%.o) | |
RUNTIME_CXXFILES = $(wildcard $(SRC_DIR)/runtime/*.cpp) | |
RUNTIME_OBJCXX = $(RUNTIME_CXXFILES:%.cpp=%.o) | |
%.o: %.c $(HEADERS) | |
$(CC) -c -o $@ $< $(CFLAGS) | |
%.o: %.cpp $(HEADERS) | |
$(CXX) -c -o $@ $< $(CXXFLAGS) | |
all: directories engine runtime | |
directories: $(OUT_DIR) | |
$(OUT_DIR): | |
$(MKDIR) $(OUT_DIR) | |
engine: $(OBJC) $(OBJCXX) | |
ar -cvq $(OUT_DIR)/libHv_$(PATCH_NAME)_WwiseSourceEngine.a $^ | |
cp $(SRC_DIR)/include/Hv_$(PATCH_NAME)_WwiseSourcePluginFactory.h $(OUT_DIR) | |
runtime: $(RUNTIME_OBJCXX) | |
$(CXX) -L$(OUT_DIR) -lHv_$(PATCH_NAME)_WwiseSourceEngine -o $(OUT_DIR)/Hv_$(PATCH_NAME)_WwiseSourcePlugin.so $^ $(CXXFLAGS) -shared | |
.PHONY: clean | |
clean: | |
rm -rf $(SRC_DIR)/**/*.o $(OUT_DIR)/*.* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment