forked from RaftLib/RaftLib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (44 loc) · 1.31 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
52
53
54
55
56
57
58
59
60
61
CC ?= gcc
CXX ?= clang++
PREFIX = /usr/local
include fifo/buffer.makefile
DIRINCS = $(RINGBUFFERDIR)
ifneq ($(shell uname -s), Darwin)
RT = -lrt
STATIC = -static -static-libgcc -static-libstdc++
PTHREAD = -lpthread
endif
CFLAGS = -O3 -Wall -std=c99
CXXFLAGS = -O3 -Wall -std=c++11 -DRDTSCP=1 -DLIMITRATE=1
RAFTLIGHTCXXOBJS = allocate map graphtools port portexception schedule \
simpleschedule stdalloc
COBJS = $(RBCOBJS)
CXXOBJS = $(RBCXXOBJS) $(RAFTLIGHTCXXOBJS)
CFILES = $(addsuffix .c, $(COBJS) )
CXXFILES = $(addsuffix .cpp, $(CXXOBJS) )
OBJS = $(addsuffix .o, $(COBJS) ) $(addsuffix .o, $(CXXOBJS) )
INCS = $(addprefix -I, $(DIRINCS))
LIBS = $(RT) $(PTHREAD)
compile: $(CXXFILES) $(CFILES)
$(MAKE) $(OBJS)
$(AR) rvs libraftlight.a $(OBJS)
install:
cp libraftlight.a $(PREFIX)/lib/
mkdir -p $(PREFIX)/include/raft_dir
cp *.hpp $(PREFIX)/include/raft_dir/
cp ./fifo/*.hpp $(PREFIX)/include/raft_dir/
cp ./fifo/*.tcc $(PREFIX)/include/raft_dir/
cp raft $(PREFIX)/include/
echo "Install complete!"
uninstall:
rm -rf $(PREFIX)/lib/libraftlight.a
rm -rf $(PREFIX)/include/raft_dir
rm -rf $(PREFIX)/include/raft
echo "Uninstalled!"
%.o: %.cpp
$(CXX) -c $(CXXFLAGS) $(INCS) -o $@ $<
%.o: %.c
$(CC) -c $(CFLAGS) $(INCS) -o $@ $<
.PHONY: clean
clean:
rm -rf libraftlight.a $(OBJS)