forked from shnjp/py-tokyodystopia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (24 loc) · 804 Bytes
/
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
CC = gcc
CPPFLAGS = -I. -I/opt/local/include/python2.5 -I/usr/local/include/python2.5 -I/usr/local/include
CFLAGS = -g -O2 -std=c99 -Wall -fPIC -fsigned-char -DNDEBUG
LIBS = -ltokyodystopia -ltokyocabinet -lbz2 -lz -lpthread -lm -lc
LDFLAGS = -L. -L/usr/local/lib -L/opt/local/lib
OS=$(shell uname)
objects = pykhufu.o pykhufu.so
ifeq ($(OS),Darwin)
SHAREDFLAGS = -bundle -flat_namespace -undefined suppress
PYSITEPACKAGE = /opt/local/lib/python2.5/site-packages/
else
SHAREDFLAGS = -shared
PYSITEPACKAGE = /usr/local/lib/python2.5/site-packages/
endif
pykhufu.so : pykhufu.o
$(CC) $(CFLAGS) $(SHAREDFLAGS) -o $@ pykhufu.o \
$(LDFLAGS) $(LIBS)
pykhufu.o : pykhufu.c
$(CC) -c $(CPPFLAGS) $(CFLAGS) pykhufu.c
install :
cp pykhufu.so $(PYSITEPACKAGE)
.PHONY : clean
clean :
rm $(objects)