File: Makefile

package info (click to toggle)
libbigwig 0.4.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 460 kB
  • sloc: ansic: 3,591; makefile: 79; python: 58
file content (87 lines) | stat: -rw-r--r-- 2,367 bytes parent folder | download
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
CC ?= gcc
AR ?= ar
RANLIB ?= ranlib
CFLAGS ?= -g -Wall -O3 -Wsign-compare -flto
LIBS = -lcurl -lm -lz
EXTRA_CFLAGS_PIC = -fpic
VERSION=0.4.2
MAJOR=$(shell echo $(VERSION)| cut -f1 -d.)
LDFLAGS = -Wl,-soname,libBigWig.so.$(MAJOR) -Wl,-flto
LDLIBS =
INCLUDES = 
DESTDIR =
PREFIX ?= /usr

prefix = $(PREFIX)
includedir = $(prefix)/include
libdir = $(exec_prefix)/lib

.PHONY: all clean lib test doc

.SUFFIXES: .c .o .pico

all: lib

lib: lib-static lib-shared

lib-static: libBigWig.a

lib-shared: libBigWig.so

doc:
	doxygen

OBJS = io.o bwValues.o bwRead.o bwStats.o bwWrite.o

.c.o:
	$(CC) -I. $(CFLAGS) $(INCLUDES) -c -o $@ $<

.c.pico:
	$(CC) -I. $(CFLAGS) $(INCLUDES) $(EXTRA_CFLAGS_PIC) -c -o $@ $<

libBigWig.a: $(OBJS)
	-@rm -f $@
	$(AR) -rcs $@ $(OBJS)
	$(RANLIB) $@

libBigWig.so: libBigWig.so.$(MAJOR)
	ln -s libBigWig.so.$(MAJOR) libBigWig.so

libBigWig.so.$(MAJOR): libBigWig.so.$(VERSION)
	ln -s libBigWig.so.$(VERSION) libBigWig.so.$(MAJOR)

libBigWig.so.$(VERSION): $(OBJS:.o=.pico)
	$(CC) -shared $(LDFLAGS) -o $@ $(OBJS:.o=.pico) $(LDLIBS) $(LIBS)

test/testLocal: libBigWig.a
	$(CC) -o $@ -I. $(CFLAGS) test/testLocal.c libBigWig.a $(LIBS)

test/testRemoteManyContigs: libBigWig.a
	$(CC) -o $@ -I. $(CFLAGS) test/testRemoteManyContigs.c libBigWig.a $(LIBS)

test/testRemote: libBigWig.a
	$(CC) -o $@ -I. $(CFLAGS) test/testRemote.c libBigWig.a $(LIBS)

test/testWrite: libBigWig.a
	$(CC) -o $@ -I. $(CFLAGS) test/testWrite.c libBigWig.a $(LIBS)

test/exampleWrite: libBigWig.so
	$(CC) -o $@ -I. -L. $(CFLAGS) test/exampleWrite.c -lBigWig $(LIBS) -Wl,-rpath $(CURDIR)

test/testBigBed: libBigWig.a
	$(CC) -o $@ -I. $(CFLAGS) test/testBigBed.c libBigWig.a $(LIBS)

test/testIterator: libBigWig.a
	$(CC) -o $@ -I. $(CFLAGS) test/testIterator.c libBigWig.a $(LIBS)

test: test/testLocal test/testRemote test/testWrite test/testLocal test/exampleWrite test/testRemoteManyContigs test/testBigBed test/testIterator
	./test/test.py

clean:
	rm -f *.o libBigWig.a libBigWig.so *.pico test/testLocal test/testRemote test/testWrite test/exampleWrite test/testRemoteManyContigs test/testBigBed test/testIterator example_output.bw

install: libBigWig.a libBigWig.so
	install -d $(DESTDIR)$(prefix)/lib $(DESTDIR)$(prefix)/include
	install libBigWig.a $(DESTDIR)$(prefix)/lib
	install libBigWig.so $(DESTDIR)$(prefix)/lib
	install *.h $(DESTDIR)$(prefix)/include