-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (33 loc) · 868 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
CFLAGS = -MMD -MP -Os -DOBJC_OLD_DISPATCH_PROTOTYPES -g
CXXFLAGS = -std=c++11 $(CFLAGS)
WARNINGS = -Wall -Wextra
LIB_DIR = simulator_libraries
CPPFLAGS = -I$(LIB_DIR) -I.
OBJS = $(LIB_DIR)/FEHLCD.o $(LIB_DIR)/FEHRandom.o $(LIB_DIR)/FEHSD.o $(LIB_DIR)/FEHUtility.o $(LIB_DIR)/tigr.o
ifeq ($(OS),Windows_NT)
CC=gcc
LDFLAGS = -lopengl32 -lgdi32
EXEC = game.exe
SHELL := CMD
else
ifeq ($(shell uname), Linux)
LDFLAGS = -lGLU -lGL -lX11
else
LDFLAGS = -framework OpenGL -framework Cocoa
endif
EXEC = game.out
endif
SRC_FILES := $(wildcard ./*.cpp)
OBJS += $(patsubst ./%.cpp,./%.o,$(SRC_FILES))
$(EXEC): $(OBJS)
$(CXX) $(CXXFLAGS) $(WARNINGS) $(INC_DIRS) $^ -o $@ $(LDFLAGS)
.PHONY: clean
clean:
ifeq ($(OS),Windows_NT)
del $(LIB_DIR)\*.o
del $(LIB_DIR)\*.d
del *.o *.d $(EXEC)
else
rm -f $(LIB_DIR)/*.o $(LIB_DIR)/*.d
rm -f *.o *.d $(EXEC)
endif