forked from bhickey/librng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (40 loc) · 1.09 KB
/
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
50
51
###############################################################################
# libRNG
################################################################################
DEBUG := NO
CC := g++
DEFAULT_FLAGS := -Wall -I${SRC_DIR}
DEBUG_FLAGS := ${DEFAULT_FLAGS} -Wno-format -g -DDEBUG
RELEASE_FLAGS := ${DEFAULT_FLAGS} -Wno-unknown-pramas -Wno-format -O3
SOFLAGS := -fPIC -shared
SHARED_OBJECT := librng.so
ifeq (YES, ${DEBUG})
CFLAGS := ${DEBUG_FLAGS}
else
CFLAGS := ${RELEASE_FLAGS}
endif
BUILD_DIR := build
SRC_DIR := src
LIBRNG_SRCS := \
rng.cpp \
cmwc.cpp \
kiss.cpp \
jkiss.cpp \
jlkiss64.cpp \
jkiss32.cpp \
superkiss.cpp \
buffered_rng.cpp
LIBRNG_OBJS := $(addsuffix .o, $(basename $(LIBRNG_SRCS)))
SRCS := $(addprefix $(SRC_DIR)/, $(LIBRNG_SRCS))
OBJS := $(addprefix $(BUILD_DIR)/, $(LIBRNG_OBJS))
all: $(OBJS) $(SHARED_OBJECT)
$(SHARED_OBJECT): $(OBJS)
$(CC) $(CFLAGS) $(SOFLAGS) -o $@ $(OBJS)
clean:
rm -rf $(BUILD_DIR)
$(OBJS): $(SRCS) | $(BUILD_DIR)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(BUILD_DIR)/%.o : $(SRC_DIR)/%.cpp
${CC} $(CFLAGS) -c $< -o $@
%.cpp : %.h