-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
95 lines (74 loc) · 2.72 KB
/
Makefile.in
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
CC=@CC@
export CC
datarootdir=@datarootdir@
prefix=@prefix@
exec_prefix=@prefix@
libdir=@libdir@
mandir=@mandir@
includedir=@includedir@
AR=ar
LIBS=-I.
CFLAGS=@CFLAGS@
export CFLAGS
VERSION=@PACKAGE_VERSION@
export VERSION
RELEASE_DATE=August 19, 2017
export RELEASE_DATE
TESTDIR=tests
EXAMPLEDIR=examples
LD_LIBRARY_PATH := $(shell pwd):$(LD_LIBRARY_PATH)
export LD_LIBRARY_PATH
.PHONY: test check man shared static install install-lib install-man install-header clean distclean uninstall uninstall-lib uninstall-man uninstall-header example examples
all: shared static man
shared: libbitfield.so.$(VERSION)
libbitfield.so.$(VERSION): bitfield.c
$(CC) $(CFLAGS) -c -fpic bitfield.c -o bf-shared.o -I. $(LIBS)
$(CC) $(CFLAGS) -shared -Wl,-soname,libbitfield.so.1 -o libbitfield.so.$(VERSION) bf-shared.o $(LIBS)
for i in libbitfield.so.1 libbitfield.so; do ln -svf libbitfield.so.$(VERSION) $$i; done
static: libbitfield.a
libbitfield.a: bitfield.c
$(CC) $(CFLAGS) -c bitfield.c -o bf-static.o $(LIBS)
$(AR) rcs libbitfield.a bf-static.o
man:
$(MAKE) -C man
test: check
check:
$(MAKE) -C $(TESTDIR)
examples: example
example:
$(MAKE) -C $(EXAMPLEDIR)
install: install-lib install-man install-header install-pc
install-lib:
mkdir -p $(DESTDIR)$(libdir)
for i in libbitfield.so.1 libbitfield.so libbitfield.so.$(VERSION) libbitfield.a; do if [ -e $(DESTDIR)$(libdir)/$$i ]; then rm -v $(DESTDIR)$(libdir)/$$i; fi; done
install -m 0644 libbitfield.so.$(VERSION) $(DESTDIR)$(libdir)
ln -sv libbitfield.so.$(VERSION) $(DESTDIR)$(libdir)/libbitfield.so.1
ln -sv libbitfield.so.$(VERSION) $(DESTDIR)$(libdir)/libbitfield.so
install -m 0644 libbitfield.a $(DESTDIR)$(libdir)
install-man:
$(MAKE) -C man install
install-header:
mkdir -p $(DESTDIR)$(includedir)
install -m 644 bitfield.h $(DESTDIR)$(includedir)/bitfield.h
install-pc: libbitfield.pc
install -d $(DESTDIR)$(libdir)/pkgconfig
install -m 0644 $< $(DESTDIR)$(libdir)/pkgconfig
clean:
rm -rvf *.a *.o *.so*
$(MAKE) -C examples clean
$(MAKE) -C $(TESTDIR) clean
$(MAKE) -C man clean
distclean: clean
rm config.log config.status config.h Makefile libbitfield.pc
$(MAKE) -C man distclean
$(MAKE) -C examples distclean
$(MAKE) -C $(TESTDIR) distclean
uninstall: uninstall-lib uninstall-man uninstall-header uninstall-pc
uninstall-lib:
for i in libbitfield.so.1 libbitfield.so libbitfield.so.$(VERSION) libbitfield.a; do if [ -e $(DESTDIR)$(libdir)/$$i ]; then rm -v $(DESTDIR)$(libdir)/$$i; fi; done
uninstall-man:
$(MAKE) -C man uninstall
uninstall-header:
if [ -e $(DESTDIR)$(includedir)/bitfield.h ]; then rm -v $(DESTDIR)$(includedir)/bitfield.h; fi
uninstall-pc:
if [ -e $(DESTDIR)$(libdir)/pkgconfig/libbitfield.pc ]; then rm -v $(DESTDIR)$(libdir)/pkgconfig/libbitfield.pc; fi