-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (27 loc) · 919 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
42
43
44
45
46
47
48
49
# 目标文件名
TARGET := Bomberman
# 编译器
CC := gcc
CXX := g++
CFLAGS := -Wall -O2
LDFLAGS := -Wall
# C 文件
C_SRCS := $(wildcard ./common/*.c)
$(info C_SRCS : $(C_SRCS))
# /common/graphic.c ./common/image.c ./common/task.c ./common/touch.c
CXX_SRCS := $(wildcard ./src/*.cpp) main.cpp
# CXX_SRCS := ./src/Game.cpp ./src/Background.cpp ./src/Config.cpp ./src/Item.cpp main.cpp
$(info CXX_SRCS :$(CXX_SRCS))
OBJS := $(C_SRCS:.c=.o) $(CXX_SRCS:.cpp=.o)
INCLUDE := -I./common/external/include -I./common -I./include
LIBS := -L./common/external/lib -ljpeg -lfreetype -lpng -lasound -lz -lc -lm -ljsoncpp
DEBUG_FLAG := -g $(CFLAGS)
%.o : %.cpp
$(CXX) $(DEBUG_FLAG) $< -c -o $@ $(INCLUDE) $(LIBS);
%.o : %.c
$(CC) $(DEBUG_FLAG) $< -c -o $@ $(INCLUDE) $(LIBS);
$(TARGET) : $(OBJS)
$(CXX) $(DEBUG_FLAG) $^ -o $@ $(INCLUDE) $(LIBS);
@echo "> build success <"
clean:
rm -f $(OBJS) $(TARGET)