-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
30 lines (23 loc) · 810 Bytes
/
makefile
File metadata and controls
30 lines (23 loc) · 810 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
export PROJ_DIR=$(shell pwd)
export BUILD_DIR=$(PROJ_DIR)/build
export CC=g++
INSTALL_DIR=/usr/local/
TARGET=libchroma.so
SRC_DIR=src
HDR_DIR=headers
SRC_NAMES=$(shell ls $(SRC_DIR)| sed -n 's/\.cpp//p')
export SRC_FILES=$(wildcard $(PROJ_DIR)/$(SRC_DIR)/*.cpp)
export HDR_FILES=$(wildcard $(PROJ_DIR)/$(HDR_DIR)/*.h)
export OBJ_FILES=$(addprefix $(BUILD_DIR)/, $(SRC_NAMES:=.o))
$(BUILD_DIR)/$(TARGET): $(BUILD_DIR) $(SRC_FILES) $(HDR_FILES)
make SRC
$(CC) -fPIC -shared $(OBJ_FILES) -std=c++14 -Wall -o $@
SRC: $(SRC_FILES) $(HDR_FILES)
make -C $(SRC_DIR)
$(BUILD_DIR):
mkdir $(BUILD_DIR)
install:
install -d $(INSTALL_DIR)/lib/
install -m 644 $(BUILD_DIR)/$(TARGET) $(INSTALL_DIR)/lib/
install -d $(INSTALL_DIR)/include/chroma-pi/
install -m 644 $(HDR_FILES) $(INSTALL_DIR)/include/chroma-pi/