Makefile 1.15 KB
Newer Older
Celine Mercier committed
1
PREFIX=/usr/local
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

SOURCES = libfasta/fasta_header_parser.c \
		  libfasta/fasta_seq_writer.c \
		  libfasta/fasta_header_handler.c \
		  libfasta/header_mem_handler.c \
          libfasta/sequence.c \
          libfile/fileHandling.c \
          liblcs/sse_banded_LCS_alignment.c \
		  liblcs/upperband.c \
		  libutils/utilities.c \
          libutils/debug.c  
                   
SRCS=$(SOURCES)
         
OBJECTS= $(patsubst %.c,%.o,$(SOURCES))

LIBFILE = libsuma.a

RANLIB = ranlib

CC=gcc

LDFLAGS=

CFLAGS = -O3 -w

default: all

all: $(LIBFILE)

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

libfasta/fasta_header_parser.c: libfasta/fasta_header_parser.l
	flex -Pheader_yy -t $< > $@

libfasta/dic_parser.c: libfasta/dic_parser.l
	lex -Phashtable_yy -t $< > $@

clean:
	rm -rf $(OBJECTS) $(LIBFILE)

$(LIBFILE): $(OBJECTS)
	ar -cr $@ $?
	$(RANLIB) $@

Celine Mercier committed
48 49 50 51 52 53 54 55 56
install: all
	install -d $(DESTDIR)$(PREFIX)/lib/
	install -m 644 $(LIBFILE) $(DESTDIR)$(PREFIX)/lib/
	install -d $(DESTDIR)$(PREFIX)/include/
	for lib in libfasta liblcs libsse libutils libfile ; do \
		install -d $(DESTDIR)$(PREFIX)/include/$$lib ; \
		cp $$lib/*.h $(DESTDIR)$(PREFIX)/include/$$lib ; \
	done