ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/gclib/gffread/Makefile
Revision: 17
Committed: Mon Jul 18 20:57:05 2011 UTC (8 years, 8 months ago) by gpertea
File size: 1909 byte(s)
Log Message:
sync with local source

Line User Rev File contents
1 gpertea 6 GCLDIR := ../gclib
2 gpertea 17 SEARCHDIRS := -I. -I${GCLDIR}
3 gpertea 6
4     SYSTYPE := $(shell uname)
5    
6     MACHTYPE := $(shell uname -m)
7     ifeq ($(MACHTYPE), i686)
8     MARCH = -march=i686
9     else
10     MARCH =
11     endif
12    
13     CC := g++
14    
15 gpertea 17 BASEFLAGS := -Wall -Wextra ${SEARCHDIRS} $(MARCH) -D_FILE_OFFSET_BITS=64 \
16     -D_LARGEFILE_SOURCE -D_REENTRANT -fno-exceptions -fno-rtti
17 gpertea 6
18 gpertea 17 #add the link-time optimization flag if gcc version > 4.5
19     GCC_VERSION:=$(subst ., ,$(shell gcc -dumpversion))
20     GCC_MAJOR:=$(word 1,$(GCC_VERSION))
21     GCC_MINOR:=$(word 2,$(GCC_VERSION))
22     #GCC_SUB:=$(word 3,$(GCC_VERSION))
23     GCC_SUB:=x
24    
25     GCC45OPTS :=
26     GCC45OPTMAIN :=
27    
28 gpertea 6 ifeq ($(findstring debug,$(MAKECMDGOALS)),)
29 gpertea 17 CFLAGS := -O2 -DNDEBUG $(BASEFLAGS)
30     LDFLAGS :=
31     ifeq ($(shell expr $(GCC_MAJOR).$(GCC_MINOR) '>=' 4.5),1)
32     CFLAGS += -flto
33     GCC45OPTS := -flto
34     GCC45OPTMAIN := -fwhole-program
35     endif
36 gpertea 6 else
37 gpertea 17 CFLAGS := -g -DDEBUG $(BASEFLAGS)
38     LDFLAGS := -g
39 gpertea 6 endif
40    
41     %.o : %.cpp
42     ${CC} ${CFLAGS} -c $< -o $@
43    
44     # C/C++ linker
45    
46 gpertea 17 LINKER := g++
47     LIBS :=
48     OBJS := ${GCLDIR}/GBase.o ${GCLDIR}/GArgs.o ${GCLDIR}/GFaSeqGet.o \
49     ${GCLDIR}/gdna.o ${GCLDIR}/codons.o ${GCLDIR}/gff.o ${GCLDIR}/GStr.o \
50     ${GCLDIR}/GFastaIndex.o gff_utils.o
51     # ${GCLDIR}/gcdb.o ${GCLDIR}/GCdbYank.o
52 gpertea 6
53     .PHONY : all
54     all: gffread
55 gpertea 17
56     version: ; @echo "GCC Version is: "$(GCC_MAJOR)":"$(GCC_MINOR)":"$(GCC_SUB)
57     @echo "> GCC Opt. string is: "$(GCC45OPTS)
58 gpertea 6 debug: gffread
59 gpertea 17 $(OBJS) : $(GCLDIR)/GBase.h $(GCLDIR)/gff.h
60     gffread.o : gff_utils.h $(GCLDIR)/GBase.h $(GCLDIR)/gff.h
61     gff_utils.o : gff_utils.h $(GCLDIR)/gff.h
62     ${GCLDIR}/gff.o : ${GCLDIR}/gff.h ${GCLDIR}/GFaSeqGet.h ${GCLDIR}/GList.hh ${GCLDIR}/GHash.hh
63     ${GCLDIR}/GFaSeqGet.o : ${GCLDIR}/GFaSeqGet.h
64     gffread: $(OBJS) gffread.o
65     ${LINKER} ${LDFLAGS} $(GCC45OPTS) $(GCC45OPTMAIN) -o $@ ${filter-out %.a %.so, $^} ${LIBS}
66 gpertea 6
67     # target for removing all object files
68    
69     .PHONY : clean
70     clean::
71 gpertea 17 @${RM} gffread gffread.o* gffread.exe $(OBJS)
72     @${RM} core.*