-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
31 lines (20 loc) · 1.33 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
CC = gcc
SRC_DIR=src
BUILD_DIR=build
default: $(BUILD_DIR)/multimedia pymultimedia
test: $(BUILD_DIR)/test_imageprocessing $(BUILD_DIR)/test_camera test_pymultimedia
test_imageprocessing: $(BUILD_DIR)/test_imageprocessing
test_pymultimedia: setup.py $(SRC_DIR)/pymultimedia.pyx $(SRC_DIR)/camera.c $(SRC_DIR)/imageprocessing.c
python3 setup.py build_ext --inplace && rm -f $(SRC_DIR)/pymultimedia.c && PYTHONPATH=. pytest $(SRC_DIR)/tests/test_pymultimedia.py
$(BUILD_DIR)/test_imageprocessing: $(SRC_DIR)/tests/test_imageprocessing.c $(SRC_DIR)/camera.c $(SRC_DIR)/imageprocessing.c
$(CC) -g3 -I$(SRC_DIR) $^ -o $@ -lm && $(BUILD_DIR)/test_imageprocessing
$(BUILD_DIR)/test_camera: $(SRC_DIR)/tests/test_camera.c $(SRC_DIR)/camera.c $(SRC_DIR)/imageprocessing.c
$(CC) -g3 -I$(SRC_DIR) $^ -o $@ -lm && $(BUILD_DIR)/test_camera
pymultimedia: setup.py $(SRC_DIR)/pymultimedia.pyx $(SRC_DIR)/camera.c $(SRC_DIR)/imageprocessing.c
python3 setup.py build_ext --inplace && rm -f $(SRC_DIR)/pymultimedia.c
$(BUILD_DIR)/multimedia: $(SRC_DIR)/multimedia.c $(SRC_DIR)/camera.c $(SRC_DIR)/imageprocessing.c
$(CC) -g3 -I$(SRC_DIR) $^ -o $@ -lm
install:
python3 setup.py install
clean:
rm -f *.o *.a *.so $(BUILD_DIR)/multimedia $(BUILD_DIR)/test_camera $(BUILD_DIR)/test_imageprocessing && rm -rf $(SRC_DIR)/tests/__pycache__ && rm -rf $(BUILD_DIR)/*