-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (25 loc) · 774 Bytes
/
Makefile
File metadata and controls
33 lines (25 loc) · 774 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
CC = g++
PROJECT = libarma_ml.so
INCLUDES = $(shell find ./include -name "*.h")
SRC = $(shell find ./src -name "*.cc")
OBJ = $(SRC:%.cc=%.o)
CXXFLAGS = -std=c++14 -larmadillo -I ./include/ -fPIC
LINKFLAGS = -larmadillo -shared -fPIC
PREFIX = /usr
$(PROJECT): $(OBJ)
$(CC) -o $(PROJECT) $(OBJ) $(LINKFLAGS)
@echo "[Successfully Build.]"
%.o: %.c $(INCLUDES)
$(CC) -c $< -o $@ $(CXXFLAGS)
.PHONY: install
install: $(PROJECT)
install $(PROJECT) $(PREFIX)/lib/
mkdir $(PREFIX)/include/arma_ml
cp ./include/* $(PREFIX)/include/arma_ml/ -r
@echo export CPLUS_INCLUDE_PATH=$PLUS_INCLUDE_PATH:$(PREFIX)/include/arma_ml/ >> ~/.bashrc
source ~/.bashrc
@echo "[Successfully installed.]"
.PHONY: clean
clean:
rm -rf $(OBJ) $(PROJECT)
@echo "[Successfully Cleaned.]"