-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
44 lines (26 loc) · 969 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
CC = g++
INCLUDES = -IC:/msys/include
CFLAGS = $(INCLUDES) -O2 -c -Wall -pedantic -std=c++11 -fexec-charset=UTF-8 -finput-charset=UTF-8 -D_GLIBCXX_HAVE_BROKEN_VSWPRINTF
LIB_PATHS = -LC:/msys/lib
LIBS =
LDFLAGS = ${LIB_PATHS} ${LIBS}
find = $(foreach dir,$(1),$(foreach d,$(wildcard $(dir)/*),$(call find,$(d),$(2))) $(wildcard $(dir)/$(strip $(2))))
SOURCES_LIB = $(call find, src, *.cpp)
OBJECTS_LIB = $(SOURCES_LIB:.cpp=.o)
STATIC_TARGET = lib/libglfw_mock.a
SHARED_TARGET = lib/libglfw_mock.dll
all: $(SOURCES) $(STATIC_TARGET) check $(SHARED_TARGET)
$(STATIC_TARGET): $(OBJECTS_LIB)
ar rcs $@ $(OBJECTS_LIB)
$(SHARED_TARGET): $(OBJECTS_LIB)
# $(CC) -shared $(OBJECTS) -o $@ $(LDFLAGS)
check: $(STATIC_TARGET)
+make -C ./tests check
.cpp.o:
$(CC) ${CFLAGS} $< -o $@
clean:
make -C ./tests clean
rm -f $(OBJECTS_LIB)
rm -f $(STATIC_TARGET)
rm -f $(SHARED_TARGET)
rm -f gmon.out