-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (50 loc) · 1.61 KB
/
Makefile
File metadata and controls
64 lines (50 loc) · 1.61 KB
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
64
#
# Makefile for saucer shoot game using Dragonfly
#
# Copyright Mark Claypool and WPI, 2016-2019
#
# 'make' to build executable
# 'make depend' to generate new dependency list
# 'make clean' to remove all constructed files
#
# Variables of interest:
# GAMESRC is the source code files for the game
# GAME is the game main() source
# EXECUTABLE is the name of the runnable game
# ENG is the name of the Dragonfly engine
#
# Compiler
CC= g++
# Libraries and includes.
LINKDIR= -L../dragonfly/lib # path to dragonfly library
INCDIR= -I../dragonfly/include # path to dragonfly includes
### Uncomment and update below if using local SFML installation.
# Note: if homebrew on Mac, sfml install, may be in:
# /usr/local/Cellar/sfml/2.5.1
LOCALSFML= $(HOME)/src/SFML-2.5.1
LINKDIR:= $(LINKDIR) -L $(LOCALSFML)/lib
INCDIR:= $(INCDIR) -I$(LOCALSFML)/include
### Uncomment either 1) or 2) below! ###
## 1) For Linux:
CFLAGS= -Wall
LINKLIB= -ldragonfly-linux64 -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio -lrt
## 2) For Mac, uncomment one of two below based on arch:
#ENG= dragonfly-x64-mac
#ENG= dragonfly-arm64-mac
#CFLAGS= -MD
#LINKLIB= -l$(ENG) -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio
######
GAMESRC= \
GAME= game.cpp
EXECUTABLE= game
OBJECTS= $(GAMESRC:.cpp=.o)
CFLAGS:= $(CFLAGS) -std=c++11
.PHONY: all clean
all: $(EXECUTABLE) Makefile
$(EXECUTABLE): $(OBJECTS) $(GAME) $(GAMESRC)
$(CC) $(CFLAGS) $(GAME) $(OBJECTS) -o $@ $(INCDIR) $(LINKDIR) $(LINKLIB)
.cpp.o:
$(CC) $(CFLAGS) -c $(INCDIR) $< -o $@
clean:
rm -rf $(OBJECTS) $(EXECUTABLE) core dragonfly.log Makefile.bak *~
# DO NOT DELETE