Skip to content

Commit

Permalink
Add makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
KonPet committed Jun 19, 2020
1 parent aa4de63 commit cf96d49
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# define the correct path and name
export PATH := c:/raylib/mingw/bin:$(PATH)
PROJECT_NAME ?= GAMENAME
OUTDIR = bin/
SOURCE = src/
DEBUGGING ?= FALSE

CC = g++
MAKE = mingw32-make

ifeq ($(DEBUGGING), TRUE)
CFLAGS += -g
else
CFLAGS += -O1 -s
endif

CFLAGS += -Wall -D_DEFAULT_SOURCE -Wno-missing-braces
CFLAGS += -Wl,--subsystem,windows

INCLUDE_PATHS = -I.
LDFLAGS = -L.
LDLIBS = -lraylib -lgdi32 -lwinmm -static

PROJECT_SOURCE_FILES ?= $(wildcard $(SOURCE)*.cpp $(SOURCE)**/*.cpp)
OBJS = $(patsubst %.cpp, %.o, $(PROJECT_SOURCE_FILES))

.PHONY: all

all:
$(MAKE) $(PROJECT_NAME)
$(OUTDIR)$(PROJECT_NAME)

$(PROJECT_NAME): $(OBJS)
$(CC) -o $(OUTDIR)$(PROJECT_NAME)$(EXT) $(OBJS) $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS)

clean:
del $(wildcard $(SOURCE)*.o $(SOURCE)**/*.o)

0 comments on commit cf96d49

Please sign in to comment.