Use $CPPFLAGS and $LDFLAGS if they are set
The bwa makefile doesn't set these two itself, but the environment or make command line might set any of CC/CPPFLAGS/CFLAGS/LDFLAGS/LIBS. Use $(CPPFLAGS) when compiling and $(LDFLAGS) when linking so they can be used to customise the build. Remove $(DFLAGS) from link commands as these preprocessor options are irrelevant for linking.
This commit is contained in:
parent
59cac0131a
commit
be36d981cd
8
Makefile
8
Makefile
|
|
@ -22,15 +22,15 @@ endif
|
|||
.SUFFIXES:.c .o .cc
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $< -o $@
|
||||
$(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $(CPPFLAGS) $< -o $@
|
||||
|
||||
all:$(PROG)
|
||||
|
||||
bwa:libbwa.a $(AOBJS) main.o
|
||||
$(CC) $(CFLAGS) $(DFLAGS) $(AOBJS) main.o -o $@ -L. -lbwa $(LIBS)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) $(AOBJS) main.o -o $@ -L. -lbwa $(LIBS)
|
||||
|
||||
bwamem-lite:libbwa.a example.o
|
||||
$(CC) $(CFLAGS) $(DFLAGS) example.o -o $@ -L. -lbwa $(LIBS)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) example.o -o $@ -L. -lbwa $(LIBS)
|
||||
|
||||
libbwa.a:$(LOBJS)
|
||||
$(AR) -csru $@ $(LOBJS)
|
||||
|
|
@ -39,7 +39,7 @@ clean:
|
|||
rm -f gmon.out *.o a.out $(PROG) *~ *.a
|
||||
|
||||
depend:
|
||||
( LC_ALL=C ; export LC_ALL; makedepend -Y -- $(CFLAGS) $(DFLAGS) -- *.c )
|
||||
( LC_ALL=C ; export LC_ALL; makedepend -Y -- $(CFLAGS) $(DFLAGS) $(CPPFLAGS) -- *.c )
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue