-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (34 loc) · 941 Bytes
/
Makefile
File metadata and controls
44 lines (34 loc) · 941 Bytes
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
CC = gcc
CXX = g++
DEFINES =
CFLAGS =
CXXFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -pthread -fPIC -std=c++11 ${DEFINES}
CPPFLAGS =
INCPATH = -I. -Isrc -I/usr/include/SDL2
LINK = g++
LFLAGS = -m64 -Wl,-O1
LIBS = $(SUBLIBS) -L/usr/X11R6/lib64 -lGL -lpthread -lSDL2 -lSDL2_image
TARGET = sdltest
Q = @
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
OBJECTS_DIR = .obj
SOURCES = $(call rwildcard, src/, *.cpp)
OBJECTS = $(patsubst %.cpp, .obj/%.o,$(SOURCES))
all: $(OBJECTS)
mkdir -p $(OBJECTS_DIR)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
.obj/%.o: %.cpp
@echo "CXX ===> $@"
@mkdir -p $(@D)
$(CXX) -c $(CXXFLAGS) $(INCPATH) $< -o $@
clean:
@find . -type f -name '*.o' -delete
@rm -Rf .obj/
@rm -f $(TARGET)
@echo cleaned objects
@ccache -Cz
$(TARGET): $(OBJECTS)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
install: FORCE
uninstall: FORCE
FORCE: