ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/gclib/cdbfasta/Makefile
Revision: 8
Committed: Mon Mar 22 22:11:25 2010 UTC (12 years, 4 months ago) by gpertea
File size: 1917 byte(s)
Log Message:
added cdbfasta source files

Line File contents
1 # Useful directories
2
3 THISCODEDIR := .
4 GCLDIR := ../gclib
5 # Directory where libz.a can be found
6 # (please build that first before making this package)
7 ZDIR := ../zlib
8 # Directories to search for header files
9 SEARCHDIRS := -I${ZDIR} -I${THISCODEDIR} -I${GCLDIR}
10
11
12 SYSTYPE := $(shell uname)
13
14
15 MACHTYPE := $(shell uname -m)
16 ifeq ($(MACHTYPE), i686)
17 MARCH = -march=i686
18 else
19 MARCH =
20 endif
21
22 CC := g++
23 BASEFLAGS = -Wall ${SEARCHDIRS} $(MARCH) -DENABLE_COMPRESSION=1 -D_FILE_OFFSET_BITS=64 \
24 -D_LARGEFILE_SOURCE -fno-exceptions -fno-rtti -fno-strict-aliasing \
25 -D_REENTRANT
26
27
28 ifeq ($(findstring debug,$(MAKECMDGOALS)),)
29 DBGFLAGS = -O2 -DNDEBUG
30 LDFLAGS =
31 else
32 DBGFLAGS = -g -DDEBUG
33 LDFLAGS = -g
34 endif
35
36 ifeq ($(findstring nommap,$(MAKECMDGOALS)),)
37 CFLAGS = $(DBGFLAGS) $(BASEFLAGS)
38 else
39 CFLAGS = $(DBGFLAGS) $(BASEFLAGS) -DNO_MMAP
40 endif
41
42 %.o : %.c
43 ${CC} ${CFLAGS} -c $< -o $@
44
45 %.o : %.cc
46 ${CC} ${CFLAGS} -c $< -o $@
47
48 %.o : %.C
49 ${CC} ${CFLAGS} -c $< -o $@
50
51 %.o : %.cpp
52 ${CC} ${CFLAGS} -c $< -o $@
53
54 %.o : %.cxx
55 ${CC} ${CFLAGS} -c $< -o $@
56
57 # C/C++ linker
58
59 LINKER := g++
60 LDFLAGS = -L${ZDIR} -lz
61 #if ENABLE_COMPRESSION is not needed,
62 # LDFLAGS =
63
64 .PHONY : all
65 all: cdbfasta cdbyank
66 debug: all
67 nommap: all
68 cdbfasta: ./cdbfasta.o ./gcdbz.o $(LIBS) ${GCLDIR}/gcdb.o ${GCLDIR}/GBase.o ${GCLDIR}/GStr.o ${GCLDIR}/GArgs.o
69 ${LINKER} -o $@ ${filter-out %.a %.so, $^} $(LDFLAGS)
70
71 cdbyank : ./cdbyank.o ./gcdbz.o ${GCLDIR}/gcdb.o ${GCLDIR}/GBase.o ${GCLDIR}/GStr.o ${GCLDIR}/GArgs.o
72 ${LINKER} -o $@ ${filter-out %.a %.so, $^} $(LDFLAGS)
73
74 # target for removing all object files
75
76 .PHONY : tidy
77 tidy::
78 @${RM} core cdbfasta cdbyank *.o ${GCLDIR}/gcdb.o ${GCLDIR}/GBase.o ${GCLDIR}/GStr.o ${GCLDIR}/GArgs.o
79
80 # target for removing all object files
81
82 .PHONY : clean
83 clean:: tidy
84 @${RM} core cdbfasta cdbyank *.o ${GCLDIR}/gcdb.o ${GCLDIR}/GBase.o ${GCLDIR}/GStr.o ${GCLDIR}/GArgs.o