forked from dpryan79/MethylDackel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (34 loc) · 1013 Bytes
/
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
46
47
48
49
prefix ?= /usr/local/bin #This can be changed
CC ?= gcc
AR ?= ar
RANLIB ?= ranlib
OPTS ?= -Wall -g -O3
.PHONY: all clean htslib install clean-all version.h
.SUFFIXES:.c .o
all: lib MethylDackel
OBJS = common.o bed.o svg.o pileup.o extract.o MBias.o mergeContext.o
VERSION = 0.2.1
#If we're building from a git repo, then append the most recent tag
ifneq "$(wildcard .git)" ""
VERSION := $(shell git describe --tags --always --dirty)
endif
version.h:
echo '#define VERSION "$(VERSION)"' > $@
.c.o:
$(CC) -c $(OPTS) -Ihtslib $< -o $@
htslib:
$(MAKE) -C htslib
libMethylDackel.a: version.h $(OBJS)
-@rm -f $@
$(AR) -rcs $@ $(OBJS)
lib: libMethylDackel.a
MethylDackel: htslib version.h libMethylDackel.a
$(CC) $(OPTS) -Ihtslib -o MethylDackel main.c libMethylDackel.a htslib/libhts.a -lm -lz -lpthread
test: MethylDackel
python tests/test.py
clean:
rm -f *.o MethylDackel libMethylDackel.a
clean-all: clean
make --directory=htslib clean
install: MethylDackel
install MethylDackel $(prefix)