Skip to content

Commit 0f3207f

Browse files
Jonathan Manningiontorrent-dev
authored andcommitted
Makefile cleanup - allow CC, CFLAGS, LDFLAGS to be passed on make command line. Use LDFLAGS in samtools compile.
Signed-off-by: Nils Homer <[email protected]>
1 parent 6e7df60 commit 0f3207f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
CC= gcc
2-
CFLAGS= -g -Wall -O2 #-m64 #-arch ppc
1+
CC?= gcc
2+
CFLAGS?= -g -Wall -O2 -march=nocona -pipe
3+
LDFLAGS?= -Wl,-O1,-as-needed -Wl,-rpath,\$$ORIGIN/../lib
34
DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1
45
KNETFILE_O= knetfile.o
56
LOBJS= bgzf.o kstring.o bam_aux.o bam.o bam_import.o sam.o bam_index.o \
@@ -16,6 +17,7 @@ LIBPATH=
1617
LIBCURSES= -lcurses # -lXCurses
1718

1819
.SUFFIXES:.c .o
20+
.PHONY: all lib
1921

2022
.c.o:
2123
$(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $< -o $@
@@ -41,7 +43,7 @@ libbam.a:$(LOBJS)
4143
$(AR) -csru $@ $(LOBJS)
4244

4345
samtools:lib-recur $(AOBJS)
44-
$(CC) $(CFLAGS) -o $@ $(AOBJS) -Lbcftools $(LIBPATH) libbam.a -lbcf $(LIBCURSES) -lm -lz
46+
$(CC) $(CFLAGS) -o $@ $(AOBJS) $(LDFLAGS) -Lbcftools $(LIBPATH) libbam.a -lbcf $(LIBCURSES) -lm -lz
4547

4648
razip:razip.o razf.o $(KNETFILE_O)
4749
$(CC) $(CFLAGS) -o $@ razf.o razip.o $(KNETFILE_O) -lz

0 commit comments

Comments
 (0)