ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/gclib/map_report/Makefile
Revision: 162
Committed: Tue Feb 7 19:27:55 2012 UTC (7 years, 7 months ago) by gpertea
File size: 1974 byte(s)
Log Message:
initial map_report commit

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