| 1 |
From: Kevin Murray <[email protected]> |
| 2 |
Date: Mon, 27 Apr 2015 16:04:30 +1000 |
| 3 |
Subject: Makefile cleaning for debian |
| 4 |
|
| 5 |
--- |
| 6 |
Makefile | 53 +++++++++++++++++++++++++++++++++++------------------ |
| 7 |
1 file changed, 35 insertions(+), 18 deletions(-) |
| 8 |
|
| 9 |
diff --git a/Makefile b/Makefile |
| 10 |
index fec7050..3cabbbd 100644 |
| 11 |
--- a/Makefile |
| 12 |
+++ b/Makefile |
| 13 |
@@ -1,24 +1,31 @@ |
| 14 |
PROGRAM_NAME = scythe |
| 15 |
|
| 16 |
+VERSION = 0.994 |
| 17 |
CC = gcc |
| 18 |
DEBUG ?= 0 |
| 19 |
|
| 20 |
ifeq ($(DEBUG), 1) |
| 21 |
CFLAGS += -g -O0 |
| 22 |
|
| 23 |
+else |
| 24 |
CFLAGS += -O3 |
| 25 |
endif |
| 26 |
+ |
| 27 |
ARCHIVE = $(PROGRAM_NAME)_$(VERSION) |
| 28 |
|
| 29 |
+override CFLAGS += -Wall -pedantic -DVERSION=$(VERSION) -std=gnu99 -fPIC |
| 30 |
+override LDFLAGS += -lz -lm |
| 31 |
LDTESTFLAGS = -lcheck |
| 32 |
SDIR = src |
| 33 |
|
| 34 |
|
| 35 |
+LOBJS = match.o util.o prob.o |
| 36 |
+OBJS = $(LOBJS) scythe.o |
| 37 |
+ |
| 38 |
+.PHONY: clean distclean dist testclean lib test all debian debian-clean |
| 39 |
|
| 40 |
+all: scythe test-scythe libscythe.so |
| 41 |
|
| 42 |
|
| 43 |
+# Executables |
| 44 |
+scythe: $(OBJS) |
| 45 |
+ $(CC) $(CFLAGS) $(OBJS) -o scythe $(LDFLAGS) |
| 46 |
|
| 47 |
|
| 48 |
+test-scythe: $(LOBJS) tests.o |
| 49 |
+ $(CC) $(CFLAGS) $(LOBJS) tests.o -o test-scythe $(LDFLAGS) $(LDTESTFLAGS) |
| 50 |
|
| 51 |
%.o: $(SDIR)/%.c |
| 52 |
$(CC) $(CFLAGS) -c $< -o $@ |
| 53 |
@@ -27,31 +34,41 @@ match.o: $(SDIR)/scythe.h |
| 54 |
scythe.o: $(SDIR)/kseq.h $(SDIR)/scythe.h |
| 55 |
util.o: $(SDIR)/kseq.h $(SDIR)/scythe.h |
| 56 |
prob.o: $(SDIR)/scythe.h |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
+# special case, source is not ./src/tests.c |
| 61 |
+tests.o: $(SDIR)/scythe.h src/tests/tests.c |
| 62 |
+ $(CC) $(CFLAGS) -c src/tests/tests.c -o $@ |
| 63 |
+ |
| 64 |
+valgrind: scythe |
| 65 |
valgrind --leak-check=full --show-reachable=yes ./scythe -a solexa_adapters.fa test.fastq |
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
+test: test-scythe |
| 70 |
+ ./test-scythe |
| 71 |
|
| 72 |
testclean: |
| 73 |
|
| 74 |
+ rm -rf ./tests ./test-scythe |
| 75 |
|
| 76 |
clean: |
| 77 |
|
| 78 |
+ rm -rf *.o ./scythe ./test-scythe ./libscythe.so *.dSYM |
| 79 |
|
| 80 |
distclean: clean |
| 81 |
rm -rf *.tar.gz |
| 82 |
|
| 83 |
dist: |
| 84 |
|
| 85 |
+ tar -zcf $(ARCHIVE).tar.gz src Makefile illumina_adapters.fa |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
lib: libscythe.so |
| 91 |
|
| 92 |
|
| 93 |
libscythe.so: $(LOBJS) |
| 94 |
$(CC) $(CFLAGS) -shared -o $@ $^ $(LDFLAGS) |
| 95 |
+ |
| 96 |
+debian: |
| 97 |
+ mkdir -p scythe-debian |
| 98 |
+ cp -r debian src Makefile illumina_adapters.fa scythe-debian |
| 99 |
+ tar -zcf $(ARCHIVE).orig.tar.gz src Makefile illumina_adapters.fa |
| 100 |
+ |
| 101 |
+debian-clean: |
| 102 |
+ rm -f scythe_*.deb scythe*.dsc scythe_*.build scythe_*.changes scythe_*.debian.tar.* scythe_*.orig.tar.gz |
| 103 |
+ rm -rf scythe-debian |
| 104 |
+ $(MAKE) clean distclean |