forked from ianhalpern/Impulse
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
38 lines (31 loc) · 1.07 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
ARCH=`uname -m`
MAIN_BUILD_DIR=build
BUILD_DIR=$(MAIN_BUILD_DIR)/$(ARCH)
COPY_DEFAULTS=COPYING README.md
all: impulse test
rm $(BUILD_DIR)/impulse/*.o
rm $(BUILD_DIR)/test/*.o
init:
mkdir -p $(BUILD_DIR)/impulse
mkdir -p $(BUILD_DIR)/test
cp $(COPY_DEFAULTS) $(BUILD_DIR)/impulse
impulse: init module.o impulse.o
cp impulse.py $(BUILD_DIR)/impulse
gcc -pthread -shared -Wl,-O2 -Bsymbolic-functions\
-L$(BUILD_DIR)/impulse/ $(BUILD_DIR)/impulse/module.o\
$(BUILD_DIR)/impulse/impulse.o -o $(BUILD_DIR)/impulse/impulse.so\
-lfftw3 -lpulse
test: impulse.o
gcc -c src/test-impulse.c -o $(BUILD_DIR)/test/test-impulse.o
gcc -L$(BUILD_DIR)/test/\
$(BUILD_DIR)/impulse/impulse.o $(BUILD_DIR)/test/test-impulse.o\
-o $(BUILD_DIR)/test/test-impulse -lm\
-lfftw3 -lpulse
impulse.o:
gcc -pthread -Wall -fPIC -c src/impulse.c -o $(BUILD_DIR)/impulse/impulse.o
module.o:
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall\
-Wstrict-prototypes -fPIC -I/usr/include/python2.7 \
-c src/module.c -o $(BUILD_DIR)/impulse/module.o
clean:
rm -rf $(MAIN_BUILD_DIR)