-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathMakedefs.Darwin
73 lines (58 loc) · 1.4 KB
/
Makedefs.Darwin
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#CC = gcc
#CXX = g++
#CC = clang
#CXX = clang++
#CXX = clang++ -stdlib=libc++
CC = clang-omp
CXX = clang-omp++
AR = ar
ARCHOPTS = -m32 -march=core2 -mfpmath=sse -mtune=native
COPTS = -fno-strict-overflow -fno-math-errno -fno-trapping-math
COPTS += -Wall -Wextra -Wshadow
DEFINES = -U_FORTIFY_SOURCE
ifdef DEBUG
COPTS += -O1 -ggdb3 -fno-omit-frame-pointer
DEFINES += -DDEBUG
else
COPTS += -O3 -fomit-frame-pointer
DEFINES += -DNDEBUG
endif
ifeq (,$(shell $(CXX) --version | grep clang))
OPENMPOPTS = -fopenmp
endif
ifeq (clang-omp++, $(CXX))
OPENMPOPTS = -fopenmp
endif
CXXOPTS = $(COPTS)
CFLAGS = $(ARCHOPTS) $(OPENMPOPTS) $(INCLUDES) $(DEFINES) $(COPTS)
CXXFLAGS = $(ARCHOPTS) $(OPENMPOPTS) $(INCLUDES) $(DEFINES) $(CXXOPTS)
LDFLAGS = $(LIBDIR) $(LDOPTS)
LIBS = -lm
DONT_BUILD_FREEGLUT = y
GLLIBS = -lgluit -framework GLUT -framework OpenGL
$(OBJDIR)/%.o: %.c
@ echo "Compiling $<"
@ rm -f $@
@ $(CC) $(CFLAGS) -MMD -MP -c $< -o $@
$(OBJDIR)/%.o: %.cc
@ echo "Compiling $<"
@ rm -f $@
@ $(CXX) $(CXXFLAGS) -MMD -MP -c $< -o $@
$(OBJDIR)/%.o: %.cpp
@ echo "Compiling $<"
@ rm -f $@
@ $(CXX) $(CXXFLAGS) -MMD -MP -c $< -o $@
ifneq (,$(findstring -L,$(LIBDIR)))
VPATH = $(subst -L,,$(LIBDIR))
endif
define LINK
@ echo "Linking $@"
@ rm -f $@
@ $(CXX) $(CXXFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@
endef
define STATICLIB
@ echo "Creating library $@"
@ rm -f $@
@ $(AR) -rcs $@ $^
endef
-include $(OBJDIR)/*.d