Author: Andreas Tille <tille@debian.org>
Description: Enhanced Makefile

--- readseq-1/Makefile.orig	1992-12-30 01:00:00.000000000 +0100
+++ readseq-1/Makefile	2007-11-17 21:31:39.000000000 +0100
@@ -10,7 +10,7 @@
 #CC=cc  # SGI Irix
 #CC=vcc # some DEC Ultrix
 
-CFLAGS=
+CFLAGS= -g -O2
 #CFLAGS= -DSMALLCHECKSUM  # if you prefer to use a GCG-standard 13 bit checksum
 #    instead of a full 32 bit checksum. This may enhance compatibility w/ GCG software
 
@@ -29,63 +29,66 @@
 LIB2=-lncbiobj
 LIB3=-lncbicdr
 LIB4=-lvibrant
-INCPATH=$(NCBI)/include
-LIBPATH=$(NCBI)/lib
+LIB5=-lncbimmdb -lncbiid1 -lnetcli
+LIB6=-lncbiacc
+LIB7=-lncbitool
+INCPATH=/usr/include/ncbi
+#LIBPATH=$(NCBI)/lib
 NCFLAGS=$(CFLAGS) -DNCBI -I$(INCPATH)
-NLDFLAGS=-I$(INCPATH) -L$(LIBPATH)
-NLIBS=$(LIB1) $(LIB2) $(OTHERLIBS)
+NLDFLAGS=-I$(INCPATH) 
+NLIBS=$(LIB1) $(LIB2) $(LIB3) $(LIB6) $(LIB7) $(LIB5) $(OTHERLIBS)
+ARBFLAGS=-DARB
 
+all: build 
 
-all: build test
-
-build: $(SOURCES)
-	@echo "Compiling readseq..."
-	$(CC) $(CFLAGS) -o readseq readseq.c ureadseq.c
+#build: $(SOURCES)
+#	@echo "Compiling readseq..."
+#	$(CC) $(CFLAGS) -o readseq readseq.c ureadseq.c
 
 # if using NCBI, uncomment these lines in place of build: above
-#build: $(SOURCES)
-# @echo "Compiling readseq with NCBI toolkit support...";
-# $(CC) -o readseq $(NLDFLAGS) $(NCFLAGS) readseq.c ureadseq.c ureadasn.c $(NLIBS)
+build: $(SOURCES)
+	@echo "Compiling readseq with NCBI toolkit support and ARB patches";
+	$(CC) -o readseq $(NLDFLAGS) $(NCFLAGS) $(ARBFLAGS) readseq.c ureadseq.c ureadasn.c $(NLIBS)
 
-test: $(SOURCES) readseq
+test: 
 	@echo ""
 	@echo "Test for general read/write of all chars:"
-	./readseq -p alphabet.std -otest.alpha
+	readseq -p alphabet.std -otest.alpha
 	-diff test.alpha alphabet.std
 
 	@echo ""
 	@echo "Test for valid format conversions:"
-	./readseq -v -p -f=ig   nucleic.std -otest.ig
-	./readseq -v -p -f=gb   test.ig     -otest.gb
-	./readseq -v -p -f=nbrf test.gb     -otest.nbrf
-	./readseq -v -p -f=embl test.nbrf   -otest.embl
-	./readseq -v -p -f=gcg  test.embl   -otest.gcg
-	./readseq -v -p -f=strider test.gcg -otest.strider
-	./readseq -v -p -f=fitch test.strider -otest.fitch
-	./readseq -v -p -f=fasta test.fitch -otest.fasta
-	./readseq -v -p -f=pir  test.fasta  -otest.pir
-	./readseq -v -p -f=ig   test.pir    -otest.ig-b
+	readseq -v -p -f=ig   nucleic.std -otest.ig
+	readseq -v -p -f=gb   test.ig     -otest.gb
+	readseq -v -p -f=nbrf test.gb     -otest.nbrf
+	readseq -v -p -f=embl test.nbrf   -otest.embl
+	readseq -v -p -f=gcg  test.embl   -otest.gcg
+	readseq -v -p -f=strider test.gcg -otest.strider
+	readseq -v -p -f=fitch test.strider -otest.fitch
+	readseq -v -p -f=fasta test.fitch -otest.fasta
+	readseq -v -p -f=pir  test.fasta  -otest.pir
+	readseq -v -p -f=ig   test.pir    -otest.ig-b
 	-diff test.ig test.ig-b
 
 	@echo ""
 	@echo "Test for multiple-sequence format conversions:"
-	./readseq -p -f=ig    multi.std   -otest.m-ig
-	./readseq -p -f=gb    test.m-ig   -otest.m-gb
-	./readseq -p -f=nbrf  test.m-gb   -otest.m-nbrf
-	./readseq -p -f=embl  test.m-nbrf -otest.m-embl
-	./readseq -p -f=fasta test.m-embl -otest.m-fasta
-	./readseq -p -f=pir   test.m-fasta -otest.m-pir
-	./readseq -p -f=msf   test.m-pir  -otest.m-msf
-	./readseq -p -f=paup  test.m-msf  -otest.m-paup
-	./readseq -p -f=ig    test.m-paup -otest.m-ig-b
+	readseq -p -f=ig    multi.std   -otest.m-ig
+	readseq -p -f=gb    test.m-ig   -otest.m-gb
+	readseq -p -f=nbrf  test.m-gb   -otest.m-nbrf
+	readseq -p -f=embl  test.m-nbrf -otest.m-embl
+	readseq -p -f=fasta test.m-embl -otest.m-fasta
+	readseq -p -f=pir   test.m-fasta -otest.m-pir
+	readseq -p -f=msf   test.m-pir  -otest.m-msf
+	readseq -p -f=paup  test.m-msf  -otest.m-paup
+	readseq -p -f=ig    test.m-paup -otest.m-ig-b
 	-diff test.m-ig test.m-ig-b
 #
 # if using NCBI, uncomment these lines
-# @echo ""
-# @echo "Test of NCBI ASN.1 conversions:"
-# ./readseq -p -f=asn test.m-ig  -otest.m-asn
-# ./readseq -p -f=ig  test.m-asn -otest.m-ig-c
-# -diff test.m-ig test.m-ig-c
+	@echo ""
+	@echo "Test of NCBI ASN.1 conversions:"
+	readseq -p -f=asn test.m-ig  -otest.m-asn
+	readseq -p -f=ig  test.m-asn -otest.m-ig-c
+	-diff test.m-ig test.m-ig-c
 #
 	@echo ""
 	@echo "Expect differences in the header lines due to"
@@ -97,8 +100,13 @@
 	@echo "    make clean"
 
 
+install:
+	install readseq $(DESTDIR)/usr/bin
+	install *.std $(DESTDIR)/usr/share/doc/readseq/tests
+	install Makefile $(DESTDIR)/usr/share/doc/readseq/tests
+
 clean:
-	rm -f *.o core test.*
+	rm -f *.o core test.* readseq
 
 shar:
 	@echo "shell archiving files..."
@@ -109,3 +117,7 @@
 	shar -v readseqd > readseq.shar
 	rm -rf readseqd
 
+
+
+
+
