-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDefines.mk
69 lines (55 loc) · 1.33 KB
/
Defines.mk
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
# This Makefile requires GNU make.
# Query the shell to compile the code correctly for different architectures.
OSTYPE = $(shell uname)
ifeq ($(OSTYPE),CYGWIN_NT-5.1)
OS = -D_CYGWIN_
endif
ifeq ($(OSTYPE),Linux)
OS = -D_LINUX_
DEBUG = -g
#NUMA = -DNUMA_SUPPORT
CFLAGS = $(DEBUG) -Wall -O3 $(OS) $(NUMA) -DMMAP_POPULATE -fstrict-aliasing -Wstrict-aliasing
LIBS = -lpthread -lrt
endif
ifeq ($(OSTYPE),SunOS)
OS = -D_SOLARIS_
DEBUG = -g
#NUMA = -DNUMA_SUPPORT
CFLAGS = $(DEBUG) -Wall -O3 $(OS) $(NUMA) -D_FILE_OFFSET_BITS=64
LIBS = -lm -lrt -lthread -lmtmalloc -llgrp
endif
ifeq ($(OSTYPE),Darwin)
OS = -D_DARWIN_
DEBUG = -g
CFLAGS = $(DEBUG) -Wall -O3 $(OS)
LIBS = -lpthread
endif
ARCHTYPE = $(shell uname -p)
ifeq ($(ARCHTYPE),sparc)
ARCH = -DCPU_V9
endif
ifeq ($(shell uname -m),x86_64)
ARCH = -D__x86_64__
endif
CFLAGS += $(ARCH)
# The $(OS) flag is included here to define the OS-specific constant so that
# only the appropriate portions of the application get compiled. See the README
# file for more information.
AR = ar
RANLIB = ranlib
LDFLAGS =
PHOENIX = phoenix
LIB_PHOENIX = lib$(PHOENIX)
LINKAGE = static
ifeq ($(LINKAGE),static)
TARGET = $(LIB_PHOENIX).a
LIB_DEP = $(HOME)/$(LIB_DIR)/$(TARGET)
endif
ifeq ($(LINKAGE),dynamic)
TARGET = $(LIB_PHOENIX).so
LIB_DEP =
endif
SRC_DIR = src
LIB_DIR = lib
INC_DIR = include
TESTS_DIR = tests