-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (28 loc) · 857 Bytes
/
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
BIN_DIR := bin
SRC_DIR := src
EXTERNAL_DIR := external
GFS_LIB := gfs
GFS_LIB_NAME := lib$(GFS_LIB)
GFS_LIB_DIR := $(EXTERNAL_DIR)/$(GFS_LIB)
GFS_LIB_PATH := $(GFS_LIB_DIR)/bin/$(GFS_LIB_NAME).a
TARGET := $(BIN_DIR)/asteriods
SRC_EXT := cpp
SOURCES := $(shell find $(SRC_DIR) -type f -name *.$(SRC_EXT))
LIB := -lstdc++
INC := -I include -I $(GFS_LIB_DIR)/include
CXXFLAGS := -g -std=c++11 -Wall -pedantic -DDEBUG
MAKEFLAGS += --quiet
LDFLAGS = -framework Carbon -framework OpenGL -framework GLUT -L $(GFS_LIB_DIR)
game: $(TARGET)
@echo 'running game'
./$<
$(TARGET): $(SOURCES) $(GFS_LIB_PATH)
@echo 'building...'
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIB) $(INC) $^ -o $@
$(GFS_LIB_PATH): $(GFS_LIB_NAME) ;
$(GFS_LIB_NAME):
$(MAKE) -C $(GFS_LIB_DIR)
clean:
@echo 'cleaning...'
$(RM) -r $(TARGET) $(TARGET).dSYM
.PHONY: clean $(GFS_LIB_NAME)