]> git.proxmox.com Git - ceph.git/blob - ceph/src/blkin/blkin-lib/Makefile
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / blkin / blkin-lib / Makefile
1 # Copyright 2014 Marios Kogias <marioskogias@gmail.com>
2 # All rights reserved.
3 #
4 # Redistribution and use in source and binary forms, with or
5 # without modification, are permitted provided that the following
6 # conditions are met:
7 #
8 # 1. Redistributions of source code must retain the above
9 # copyright notice, this list of conditions and the following
10 # disclaimer.
11 # 2. Redistributions in binary form must reproduce the above
12 # copyright notice, this list of conditions and the following
13 # disclaimer in the documentation and/or other materials
14 # provided with the distribution.
15 #
16 # THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESS
17 # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 # POSSIBILITY OF SUCH DAMAGE.
28
29 .PHONY: default clean distclean run run_c run_pp
30
31 MAJOR=0
32 MINOR=1
33 LIBS= -ldl -llttng-ust
34 DLIB=libblkin
35
36 LIB_DIR=$(shell pwd)
37 TEST_DIR=$(shell pwd)/tests
38 prefix= /usr/local
39 libdir= $(prefix)/lib
40 incdir= $(prefix)/include
41
42 H_FILES= zipkin_c.h zipkin_trace.h ztracer.hpp
43
44 default: $(DLIB).so test testpp testppp
45
46 $(DLIB).so: $(DLIB).$(MAJOR).so
47 ln -sf $< $@
48
49 $(DLIB).$(MAJOR).so: $(DLIB).$(MAJOR).$(MINOR).so
50 ln -sf $< $@
51
52 $(DLIB).$(MAJOR).$(MINOR).so: zipkin_c.o tp.o
53 g++ -shared -o $@ $^ $(LIBS)
54
55 zipkin_c.o: zipkin_c.c zipkin_c.h zipkin_trace.h
56 gcc -I. -Wall -fpic -g -c -o $@ $<
57
58 tp.o: tp.c zipkin_trace.h
59 gcc -I. -fpic -g -c -o $@ $<
60
61 test: $(TEST_DIR)/test.c $(DLIB).so
62 make -C tests test
63
64 testpp: $(TEST_DIR)/test.cc $(DLIB).so
65 make -C tests testpp
66
67 testppp: $(TEST_DIR)/test_p.cc $(DLIB).so
68 make -C tests testppp
69
70 run_c:
71 make -C tests run_c
72
73 run_pp:
74 make -C tests run_pp
75
76 run_ppp:
77 make -C tests run_ppp
78
79 run: run_c run_pp
80
81 install:
82 install -m 644 $(DLIB).$(MAJOR).$(MINOR).so $(DESTDIR)/$(libdir)
83 cp -P $(DLIB).$(MAJOR).so $(DESTDIR)/$(libdir)
84 cp -P $(DLIB).so $(DESTDIR)/$(libdir)
85 install -m 644 $(H_FILES) $(DESTDIR)/$(incdir)
86
87 clean:
88 rm -f *.o *.so
89 make -C tests clean
90
91 distclean: clean
92 rm -f socket