forked from mcsab/stk-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (34 loc) · 1.06 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
NAME = stk-editor
SRC = $(wildcard src/*.cpp src/gui/*.cpp src/mesh/*.cpp \
src/spline/*.cpp src/commands/*.cpp src/viewport/*.cpp \
src/input/*.cpp src/b3d/*.cpp)
OBJ = $(SRC:.cpp=.o)
HDR = $(wildcard *.hpp */*.hpp */*/*.hpp)
# Irr paths will depend on your system.
IRR_INCLUDE ?= /opt/irr2/include/irrlicht
IRR_LIB ?= /opt/irr2/lib/libIrrlicht.a
ifeq (,$(wildcard $(IRR_INCLUDE)))
IRR_INCLUDE = /usr/local/include/irrlicht
endif
ifeq (,$(wildcard $(IRR_INCLUDE)))
IRR_INCLUDE = /usr/include/irrlicht
endif
ifeq (,$(wildcard $(IRR_INCLUDE)))
$(error Irr includes not found. Set the IRR_INCLUDE env var correctly)
endif
ifeq (,$(wildcard $(IRR_LIB)))
IRR_LIB = -lIrrlicht
$(warning Attempting to link irrlicht dynamically)
endif
CXXFLAGS += -isystem $(IRR_INCLUDE) -I src
LDFLAGS += $(IRR_LIB)
CXXFLAGS += -Wall -Wextra -g
LDFLAGS += -Wl,-O1
LDFLAGS += -lz -lpng -ljpeg -L /usr/X11R7/lib -lGL -lX11 -lXxf86vm -lphysfs
.PHONY: all clean
all: $(NAME)
$(NAME): $(OBJ)
$(CXX) -o $(NAME) $(OBJ) $(CXXFLAGS) $(LDFLAGS)
$(OBJ): $(HDR) Makefile
clean:
rm -f $(OBJ) $(NAME)