-
Notifications
You must be signed in to change notification settings - Fork 31
/
Makefile
51 lines (45 loc) · 2.17 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
LIBIMPULSE=-limpulse -Wl,-rpath,.
MACHINE=`uname -m`
MAIN_BUILD_DIR=build
BUILD_DIR=$(MAIN_BUILD_DIR)/$(MACHINE)/$(VERNUM)
COPY_DEFAULTS=COPYING README
VERNUM=`vernum`
impulse: libimpulse python-impulse
mkdir -p $(BUILD_DIR)/impulse
cp $(COPY_DEFAULTS) $(BUILD_DIR)/impulse
cp Impulse.py $(BUILD_DIR)/impulse
cp $(BUILD_DIR)/libimpulse/libimpulse.so $(BUILD_DIR)/impulse/
cp $(BUILD_DIR)/python-impulse/impulse.so $(BUILD_DIR)/impulse/
impulse-screenlet: libimpulse python-impulse
mkdir -p $(BUILD_DIR)/screenlet
cp $(COPY_DEFAULTS) $(BUILD_DIR)/screenlet
cp -R screenlet/* $(BUILD_DIR)/screenlet
cp $(BUILD_DIR)/libimpulse/libimpulse.so $(BUILD_DIR)/screenlet/
cp $(BUILD_DIR)/python-impulse/impulse.so $(BUILD_DIR)/screenlet/
test-libimpulse: libimpulse
mkdir -p $(BUILD_DIR)/test-libimpulse
cp $(COPY_DEFAULTS) $(BUILD_DIR)/test-libimpulse
cp $(BUILD_DIR)/libimpulse/libimpulse.so $(BUILD_DIR)/test-libimpulse/
gcc -c src/test-libimpulse.c -o $(BUILD_DIR)/test-libimpulse/test-libimpulse.o
gcc -L$(BUILD_DIR)/test-libimpulse/ $(LIBIMPULSE)\
$(BUILD_DIR)/test-libimpulse/test-libimpulse.o -o $(BUILD_DIR)/test-libimpulse/test-libimpulse
rm $(BUILD_DIR)/test-libimpulse/test-libimpulse.o
libimpulse:
mkdir -p $(BUILD_DIR)/libimpulse
cp $(COPY_DEFAULTS) $(BUILD_DIR)/libimpulse
gcc -pthread -Wall -fPIC -c\
src/Impulse.c -o $(BUILD_DIR)/libimpulse/Impulse.o
gcc -pthread -lpulse -lfftw3 -shared -Wl,-soname,libimpulse.so -fPIC\
$(BUILD_DIR)/libimpulse/Impulse.o -o $(BUILD_DIR)/libimpulse/libimpulse.so
rm $(BUILD_DIR)/libimpulse/Impulse.o
python-impulse: libimpulse
mkdir -p $(BUILD_DIR)/python-impulse
cp $(COPY_DEFAULTS) $(BUILD_DIR)/python-impulse
cp $(BUILD_DIR)/libimpulse/libimpulse.so $(BUILD_DIR)/python-impulse/
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC\
-I/usr/include/python2.6 -c src/impulsemodule.c -o $(BUILD_DIR)/python-impulse/impulsemodule.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -L$(BUILD_DIR)/python-impulse/ $(LIBIMPULSE)\
$(BUILD_DIR)/python-impulse/impulsemodule.o -o $(BUILD_DIR)/python-impulse/impulse.so
rm $(BUILD_DIR)/python-impulse/impulsemodule.o
clean:
rm -rf $(MAIN_BUILD_DIR)