File: Makefile

package info (click to toggle)
scythe 0.994%2Bgit20141017.20d3cff-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 2,596 kB
  • sloc: ansic: 862; makefile: 71; sh: 59
file content (74 lines) | stat: -rw-r--r-- 1,808 bytes parent folder | download | duplicates (3)
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
PROGRAM_NAME = scythe
VERSION ='"$(shell dpkg-parsechangelog | grep '^Version:' | cut -f 2 -d ' ')"'
CC ?= gcc
DEBUG ?= 0
ifeq ($(DEBUG), 1)
	CFLAGS += -g -O0
else
	CFLAGS += -O3
endif

ARCHIVE = $(PROGRAM_NAME)_$(VERSION)
override CFLAGS += $(CPPFLAGS) -Wall -pedantic -DVERSION=$(VERSION) -std=gnu99 -fPIC
override LDFLAGS += -lz -lm
LDTESTFLAGS = -lcheck
SDIR = src
LOBJS = match.o util.o prob.o
OBJS = $(LOBJS) scythe.o

.PHONY: clean distclean dist testclean lib test all debian debian-clean

all: scythe test-scythe libscythe.so

# Executables
scythe: $(OBJS)
	$(CC) $(CFLAGS) $(OBJS) -o scythe $(LDFLAGS)

test-scythe: $(LOBJS) tests.o
	$(CC) $(CFLAGS) $(LOBJS) tests.o -o test-scythe $(LDFLAGS) $(LDTESTFLAGS)

%.o: $(SDIR)/%.c
	$(CC) $(CFLAGS) -c $< -o $@

match.o: $(SDIR)/scythe.h
scythe.o: $(SDIR)/kseq.h $(SDIR)/scythe.h
util.o: $(SDIR)/kseq.h $(SDIR)/scythe.h
prob.o: $(SDIR)/scythe.h

# special case, source is not ./src/tests.c
tests.o: $(SDIR)/scythe.h src/tests/tests.c
	$(CC) $(CFLAGS) -c src/tests/tests.c -o $@

valgrind: scythe
	valgrind --leak-check=full --show-reachable=yes ./scythe -a solexa_adapters.fa test.fastq

test: test-scythe
	./test-scythe

testclean:
	rm -rf ./tests ./test-scythe

clean:
	rm -rf *.o ./scythe ./test-scythe ./libscythe.so *.dSYM

distclean: clean
	rm -rf *.tar.gz

dist:
	tar -zcf $(ARCHIVE).tar.gz src Makefile illumina_adapters.fa


lib: libscythe.so

libscythe.so: $(LOBJS)
	$(CC) $(CFLAGS) -shared -o $@ $^ $(LDFLAGS)

debian:
	mkdir -p scythe-debian
	cp -r debian src Makefile illumina_adapters.fa scythe-debian
	tar -zcf $(ARCHIVE).orig.tar.gz src Makefile illumina_adapters.fa

debian-clean:
	rm -f scythe_*.deb scythe*.dsc scythe_*.build scythe_*.changes  scythe_*.debian.tar.*  scythe_*.orig.tar.gz
	rm -rf scythe-debian
	$(MAKE) clean distclean