forked from haproxy-unofficial-obsolete-mirrors/ebtree
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
46 lines (32 loc) · 1.09 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
# Makefile for ebtree
#
# Copyright (C) 2000-2016 Willy Tarreau <[email protected]>
# Copyright (C) 2009-2016 dunnhumby Germany GmbH.
# Distributed under MIT/X11 license (See accompanying file LICENSE)
o ?= obj
DEBUG ?= 1
CFLAGS := -O3 -Wall -std=c99 $(if $(DEBUG),-g)
VERSION := 6
OBJS := ebtree.o eb32tree.o eb64tree.o eb128tree.o ebmbtree.o ebsttree.o ebimtree.o ebistree.o
$(shell mkdir -p $o)
.PHONY: all
all: libebtree.a libebtree.so
osx: libebtree.a libebtree.dylib
libebtree.a: $(addprefix $o/static-,$(OBJS))
$(AR) rv $@ $^
libebtree.dylib: CFLAGS += -fPIC
libebtree.dylib: $(addprefix $o/dynamic-,$(OBJS))
$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) $(OUTPUT_OPTION) -shared -Wl,-install_name,$@.$(VERSION)
libebtree.so: CFLAGS += -fPIC
libebtree.so: $(addprefix $o/dynamic-,$(OBJS))
$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) $(OUTPUT_OPTION) -shared -Wl,-soname,$@.$(VERSION)
$o/static-%.o: src/%.c
$(COMPILE.c) $(OUTPUT_OPTION) $<
$o/dynamic-%.o: src/%.c
$(COMPILE.c) $(OUTPUT_OPTION) $<
.PHONY: deb
deb: all
deb/build
.PHONY: clean
clean:
$(RM) -r libebtree.a libebtree.so $o deb/libebtree* deb/ebtree/