File: Makefile

package info (click to toggle)
libtabixpp 1.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 376 kB
  • sloc: cpp: 194; makefile: 45; sh: 16
file content (44 lines) | stat: -rw-r--r-- 1,065 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

# Use ?= to allow override from the env or command-line.

CC?=		gcc
CXX?= 		g++
CXXFLAGS+=	-fPIC
INCLUDES?=	-Ihtslib
HTS_HEADERS?=	htslib/htslib/bgzf.h htslib/htslib/tbx.h
HTS_LIB?=	htslib/libhts.a
LIBPATH?=	-L. -Lhtslib
LIBS?=	-lhts -lpthread -lm -lbz2 -llzma -lz
DFLAGS=		-D_FILE_OFFSET_BITS=64 -D_USE_KNETFILE
PROG=		tabix++
SUBDIRS=.
SONUMBER=0

ifeq ($(OS),Windows_NT)
	LIBS += -lws2_32
endif

.SUFFIXES:.c .o

.c.o:
	$(CC) $(CPPFLAGS) -c $(CXXFLAGS) $(DFLAGS) $(INCLUDES) $< -o $@

all:   $(PROG) libtabixpp.so.$(SONUMBER) libtabixpp.a

tabix.o: tabix.cpp tabix.hpp
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c tabix.cpp $(INCLUDES)

libtabixpp.a: tabix.o
	ar rcs $@ $<

libtabixpp.so.$(SONUMBER): tabix.o
	$(CXX) -shared -o $@ $< -fPIC -Wl,-soname,libtabixpp.so.$(SONUMBER) $(LDFLAGS) -lhts

tabix++: tabix.o main.cpp
	$(CXX) $(LDFLAGS) $(CPPFLAGS) $(CXXFLAGS) -o $@ main.cpp tabix.o $(INCLUDES) $(LIBPATH) $(LIBS)

cleanlocal:
	rm -fr gmon.out *.o a.out *.dSYM $(PROG) *~ *.a tabix.aux tabix.log \
		tabix.pdf *.class libtabix*.dylib libtabix*so*

clean: cleanlocal