# Makefile for Linux # Author : Eric Bachard / monday 2017 May 1st, 21:09:45 (UTC+0200) # This makefile is licensed under the MIT License, see LICENSE # to build the binaries, you'll have to add at least one cpp file containing a main() APPLICATION_NAME = ImWindow LINUX_FLAGS = -D__Linux OS_FLAGS += -D__Linux UNAME_S = $(shell uname -s) ifeq ( $(UNAME_S), Linux) OS_FLAGS += $(LINUX_FLAGS) endif BUILD_DIR = binary VERSION_MAJOR = 0 VERSION_MINOR = 1 VERSION_MICRO = 0 VERSION = ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO} SOURCES_DIR = ImWindow BINARY_NAME = ${BUILD_DIR}/${APPLICATION_NAME} CC = gcc ####CXX = /usr/bin/g++ -O3 CXX = /usr/bin/g++ CXX_STD = -std=c++11 CC_FLAGS = -Wall CXX_FLAGS = ${OS_FLAGS} ${CXX_STD} ${CC_FLAGS} CC_STD = -std=c99 OUTBIN = ${BUILD_DIR}/${APPLICATION_NAME} OUTBIN_DEBUG = ${BUILD_DIR}/${APPLICATION_NAME}_debug OUTBIN_ALL = $(OUTBIN) $(OUTBIN_DEBUG) INC = ./inc INCLUDE_BASE = ./ImWindow IMGUI_BASE = ./Externals EXAMPLE_BASE = $(IMGUI_BASE)/imgui/examples/sdl_opengl_example IMGUI_INC = $(IMGUI_BASE)/imgui INCLUDE_DIR += -I$(INCLUDE_BASE) \ -I$(IMGUI_INC) \ -I$(INC) \ -I$(EXAMPLE_BASE) # $(STB_INC) FILES = $(shell ls $(INCLUDE_BASE)/*.cpp) IMGUI_FILES = $(shell ls $(IMGUI_BASE)/imgui/*.cpp) EXAMPLE_FILES = $(shell ls $(EXAMPLE_BASE)/*.cpp) FILES += $(IMGUI_FILES) $(EXAMPLE_FILES) DEPS = $^ SDL2_FLAGS = -lSDL2_image-2.0 -lSDL2_gpu -lSDL2_ttf SDL2_FLAGS += $(shell sdl2-config --cflags --libs) #OPENGL_FLAGS = -lGL -lGLEW OPENGL_FLAGS = -lGL LD_FLAGS = -lm ${OPENGL_FLAGS} -ldl ${OPENCV_FLAGS} ${GLFW3_FLAGS} ${SDL2_FLAGS} CFLAGS = ${CC_FLAGS} ${CC_STD} ${OS_FLAGS} CFLAGS_DEBUG = -g -DDEBUG -DUNIT_TESTS=${QA_TESTS} C++FLAGS = ${CXX_FLAGS} ${OS_FLAGS} C++FLAGS_DEBUG = -g -DDEBUG OBJS = ${FILES} ARCHIVE_EXT = .tar.gz TO_BE_ZIPPED = \ Externals/imgui \ ImWindow \ ImWindowDX11 \ Makefile-Linux \ build \ Screenshots TO_BE_ZIPPED_BINARIES = \ ${BUILD_DIR} # ici commence la creation des binaires all : clean $(OUTBIN_ALL) #all : clean $(OUTBIN) $(OUTBIN) : $(OBJS) $(CXX) $(C++FLAGS) ${GCC_SECURITY_FLAGS} $(INCLUDE_DIR) -o $@ $(DEPS) $(LD_FLAGS) $(OUTBIN_DEBUG) : $(OBJS) $(CXX) $(C++FLAGS) ${GCC_SECURITY_FLAGS} $(C++FLAGS_DEBUG) $(INCLUDE_DIR) -o $(OUTBIN_DEBUG) $(DEPS) $(LD_FLAGS) clean : rm -rf $(OUTBIN) $(OUTBIN_DEBUG) ${EXEC_NAME}_${VERSION} rm -rf $(BUILD_DIR)/dbg*.dSYM rm -rf ${APPLICATION_NAME}_${VERSION} echo Fichiers binaires supprimés. devel: clean mkdir ${APPLICATION_NAME}_${VERSION} mkdir -p ${APPLICATION_NAME}_${VERSION}/build cp -R ${TO_BE_ZIPPED} ${APPLICATION_NAME}_${VERSION} tar cvzf ${APPLICATION_NAME}_${VERSION}${ARCHIVE_EXT} ${APPLICATION_NAME}_${VERSION} archive : all mkdir ${APPLICATION_NAME}_${VERSION} cp -R ${TO_BE_ZIPPED} ${APPLICATION_NAME}_${VERSION} cp -R ${TO_BE_ZIPPED_BINARIES} ${APPLICATION_NAME}_${VERSION} tar cvzf ${APPLICATION_NAME}_${VERSION}${ARCHIVE_EXT} ${APPLICATION_NAME}_${VERSION} real_clean : clean rm -rf ${APPLICATION_NAME}_*${ARCHIVE_EXT}