#Project Name
PROJECT 	?= tetris
# Define required raylib variables
RAYLIB_PATH        ?= ./lib

# Define include path 
INCLUDE_PATH        ?= ./include

# Define compiler path on Windows
COMPILER_PATH      ?= C:/raylib/w64devkit/bin
# Build mode for project: DEBUG or RELEASE
BUILD_MODE            ?= RELEASE

# Define default C compiler: gcc
# NOTE: define g++ compiler if using C++
CC = g++

# Define default make program: Mingw32-make
MAKE = mingw32-make $(PROJECT)
# Compile option
CFLAGS += -Wall -std=c++14 -D_DEFAULT_SOURCE -Wno-missing-braces 

ifeq ($(BUILD_MODE),DEBUG)
    CFLAGS += -g -O0
else
    CFLAGS += -s -O1
endif

# Define include paths for required headers
# NOTE: Several external required libraries (stb and others)
INCLUDE_PATHS = -I. -I$(INCLUDE_PATH) 

# Define library paths containing required libs.
LDFLAGS = -L. -L$(RAYLIB_PATH)  

# Define any libraries required on linking
# if you want to link libraries (libname.so or libname.a), use the -lname
LDLIBS = -lraylib -lgdi32 -lwinmm 

# Define all source files required
SRC_DIR = .
OBJ_DIR = obj


# Default target entry
# NOTE: We call this Makefile target or Makefile.Android target
all:
	$(MAKE)

$(OBJ_DIR)/main.o : main.cpp
	@mkdir -p obj
	$(CC)  -c main.cpp $(CFLAGS) $(INCLUDE_PATHS) -o $@


#Icon file path
ICON += icon/seodang_res.o


#목적 파일 만들기
OBJS =  $(OBJ_DIR)/main.o


#컴파일
tetris : $(OBJS)
	$(CC) $(CFLAGS)  $(OBJS) -o $(PROJECT) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) $(ICON)
 