-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (51 loc) · 2.21 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Author: Rudy Faile (@rfaile313)
# Description: A simple Makefile that incorporates
# Raylib on OS: Windows && Platform: Desktop
# License: MIT
# What you need to do:
# 1. Git clone Raylib https://github.com/raysan5/raylib.git
# 2. Compile Raylib and generate the static library "libraylib.a"
# 3. Copy libraylib.a and the header only file, raylib.h to your project's directory and point to them with the Makefile below.
# 4. Run "make" in your project's dir to compile / "make clean" clears the executable & any object files
# Define default make program (on windows this is usually mingw32-make)
MAKE = mingw32-make
# Protect clean
.PHONY: all clean
# OUTPUT determines the name of the executable
OUTPUT = mygame.exe
# Local path to Raylib header-only file
# Ensure "raylib.h" is in the directory you list below
INCLUDE_PATH = include/
# Local Path to Raylib static compiled library
# Ensure "libraylib.a" is in the directory you list below
LIBRARY_PATH = lib/
# Source file(s)
# For a single file or unity build, rename source to your entry point (often main.c)
# To include all C files, use the wildcard below:
# SOURCE = $( wildcard *.c **/*.c )
SOURCE = main.c
# Compiler Flags
CFLAGS += -O1 -Wall -std=c99 -Wno-missing-braces
# Compiler flags for reference
# -O1 defines optimization level
# -g include debug information on compilation
# -Wall turns on most, but not all, compiler warnings
# -std=c99 defines C language mode (standard C from 1999 revision)
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
# Library Flags
LFLAGS = -lraylib -lopengl32 -lgdi32 -lwinmm
# Library Flags for Reference:
# ---- Required ----
# -lraylib Raylib static compiled library, must be in LIBRARY_PATH
# -lopengl32 OpenGL - comes with MinGW
# -lgdi32 Graphics library - comes with MinGW
# -lwinmm Import library for windows system file winmm.dll - comes with MinGW
# ---- Options ----
# -Wl,-subsystem,windows <--- Add these to hide the cmd console when launching game window
# Compiler (gcc == MinGW)
COMPILER = gcc
all:
$(COMPILER) $(SOURCE) -o $(OUTPUT) $(CFLAGS) -I $(INCLUDE_PATH) -L $(LIBRARY_PATH) $(LFLAGS)
clean:
del *.o *.exe /s
@echo Cleaning done