-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (26 loc) · 846 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
34
UNAME := $(shell uname -s)
INCLUDES += -I. -I./src
CFLAGS += -pipe -Wall -D_BSD_SOURCE -fPIC $(INCLUDES)
LDFLAGS += -L./src -lm
ifeq ($(UNAME),Darwin)
LDFLAGS += -Wl
PKG_CONFIG_LIBS = `pkg-config --libs lua5.2`
PKG_CONFIG_CFLAGS = `pkg-config --cflags lua5.2`
else
LDFLAGS += -Wl,--gc-sections
PKG_CONFIG_LIBS = `pkg-config --libs lua5.1`
PKG_CONFIG_CFLAGS = `pkg-config --cflags lua5.1`
endif
LDFLAGS += $(PKG_CONFIG_LIBS)
CFLAGS += $(PKG_CONFIG_CFLAGS)
all: minibloom.so
src/libminibloom.a:
$(MAKE) -C src
minibloom.so: minibloom.o src/libminibloom.a
$(CROSS_COMPILE)$(CC) $(LDFLAGS) -shared $^ -o $@ $(PKG_CONFIG_LIBS) src/libminibloom.a
minibloom.o: minibloom.c
$(CROSS_COMPILE)$(CC) $(CFLAGS) $(INCLUDES) -fPIC -c -o $@ $< $(PKG_CONFIG)
clean:
$(MAKE) -C src clean
rm -rf *.o *.so
.PHONY: all clean