-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
44 lines (33 loc) · 988 Bytes
/
Copy pathmakefile
File metadata and controls
44 lines (33 loc) · 988 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
$(shell CC=$(CC) CXX=$(CXX) TARGET_OS=$(TARGET_OS) \
./build_detect_platform build_config.mk ./)
include build_config.mk
CC:=g++
CXX:=g++
DEBUG=DEBUG
OUTPUTNAME:=liblevelque.$(PLATFORM_SHARED_EXT)
#OUTPUTNAME:=bfqueue
OUTPATH=output
INCLUDES += -I/usr/include/ -I./include/
LDFLAGS +=-lpthread
LDFLAGS +=$(PLATFORM_SHARED_LDFLAGS)$(OUTPUTNAME) -lpthread
CPPFLAGS += -g -fPIC -pg -Wall
OS := $(shell uname -s)
IS_DARWIN := $(shell echo $(OS)|grep -i Darwin)
ifdef IS_DARWIN
LDFLAGS += -D_DARWIN
endif
objects := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
objects += $(patsubst util/%.cpp,util/%.o,$(wildcard util/*.cpp))
.PHONY: all clean
all: $(OUTPUTNAME)
%.o:%.cpp
$(CXX) $(CPPFLAGS) -c $< -o $@ $(INCLUDES) -D$(DEBUG)
clean:
-rm -f $(OUTPUTNAME) $(objects)
install:
rm -f /lib/$(OUTPUTNAME) /lib64/$(OUTPUTNAME)
cp $(OUTPUTNAME) /lib/
cp $(OUTPUTNAME) /lib64/
cp include/queue.h /usr/include/
$(OUTPUTNAME):$(objects)
$(CC) $(LDFLAGS) $(objects) -o $(OUTPUTNAME)