diff --git a/Makefile b/Makefile index 46b3b3b..b1e86c1 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,11 @@ -CPPFLAGS= -DHAVE_KALLOC -fopenmp -std=c++11 -Wno-sign-compare -Wno-write-strings -Wno-unused-but-set-variable -CFLAGS= -g -Wall -O2 #-Wextra -LIBS= -lm -lz -lpthread +export CPPFLAGS= -g -Wall -O2 -DHAVE_KALLOC -fopenmp -std=c++11 -Wno-sign-compare -Wno-write-strings -Wno-unused-but-set-variable +export LIBS= -lm -lz -lpthread all:winnowmap winnowmap: MAKE_DIRS - +$(MAKE) -C src - $(CXX) $(CPPFLAGS) src/main.o -o bin/$@ -Lsrc -lwinnowmap $(LIBS) + +$(MAKE) -e -C src + $(CXX) $(CPPFLAGS) src/main.o -o bin/$@ -Lsrc -lwinnowmap $(LIBS) +$(MAKE) -C ext/meryl/src TARGET_DIR=$(shell pwd) MAKE_DIRS: diff --git a/src/Makefile b/src/Makefile index 49ecd32..729cee2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -12,19 +12,19 @@ else # if arm_neon is defined OBJS+=ksw2_extz2_neon.o ksw2_extd2_neon.o ksw2_exts2_neon.o INCLUDES+=-Isse2neon ifeq ($(aarch64),) #if aarch64 is not defined - CFLAGS+=-D_FILE_OFFSET_BITS=64 -mfpu=neon -fsigned-char + CPPFLAGS+=-D_FILE_OFFSET_BITS=64 -mfpu=neon -fsigned-char else #if aarch64 is defined - CFLAGS+=-D_FILE_OFFSET_BITS=64 -fsigned-char + CPPFLAGS+=-D_FILE_OFFSET_BITS=64 -fsigned-char endif endif ifneq ($(asan),) - CFLAGS+=-fsanitize=address + CPPFLAGS+=-fsanitize=address LIBS+=-fsanitize=address endif ifneq ($(tsan),) - CFLAGS+=-fsanitize=thread + CPPFLAGS+=-fsanitize=thread LIBS+=-fsanitize=thread endif @@ -32,7 +32,7 @@ endif .SUFFIXES:.c .o .c.o: - $(CXX) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) $< -o $@ + $(CXX) -c $(CPPFLAGS) $(INCLUDES) $< -o $@ all:$(PROG) @@ -42,46 +42,46 @@ libwinnowmap.a:$(OBJS) $(AR) -csru $@ $(OBJS) sdust:sdust.c kalloc.o kalloc.h kdq.h kvec.h kseq.h ketopt.h sdust.h - $(CXX) -D_SDUST_MAIN $(CFLAGS) $< kalloc.o -o $@ -lz + $(CXX) -D_SDUST_MAIN $< kalloc.o -o $@ -lz # SSE-specific targets on x86/x86_64 ifeq ($(arm_neon),) # if arm_neon is defined, compile this target with the default setting (i.e. no -msse2) ksw2_ll_sse.o:ksw2_ll_sse.c ksw2.h kalloc.h - $(CXX) -c $(CFLAGS) -msse2 $(CPPFLAGS) $(INCLUDES) $< -o $@ + $(CXX) -c -msse2 $(CPPFLAGS) $(INCLUDES) $< -o $@ endif ksw2_extz2_sse41.o:ksw2_extz2_sse.c ksw2.h kalloc.h - $(CXX) -c $(CFLAGS) -msse4.1 $(CPPFLAGS) -DKSW_CPU_DISPATCH $(INCLUDES) $< -o $@ + $(CXX) -c -msse4.1 $(CPPFLAGS) -DKSW_CPU_DISPATCH $(INCLUDES) $< -o $@ ksw2_extz2_sse2.o:ksw2_extz2_sse.c ksw2.h kalloc.h - $(CXX) -c $(CFLAGS) -msse2 -mno-sse4.1 $(CPPFLAGS) -DKSW_CPU_DISPATCH -DKSW_SSE2_ONLY $(INCLUDES) $< -o $@ + $(CXX) -c -msse2 -mno-sse4.1 $(CPPFLAGS) -DKSW_CPU_DISPATCH -DKSW_SSE2_ONLY $(INCLUDES) $< -o $@ ksw2_extd2_sse41.o:ksw2_extd2_sse.c ksw2.h kalloc.h - $(CXX) -c $(CFLAGS) -msse4.1 $(CPPFLAGS) -DKSW_CPU_DISPATCH $(INCLUDES) $< -o $@ + $(CXX) -c -msse4.1 $(CPPFLAGS) -DKSW_CPU_DISPATCH $(INCLUDES) $< -o $@ ksw2_extd2_sse2.o:ksw2_extd2_sse.c ksw2.h kalloc.h - $(CXX) -c $(CFLAGS) -msse2 -mno-sse4.1 $(CPPFLAGS) -DKSW_CPU_DISPATCH -DKSW_SSE2_ONLY $(INCLUDES) $< -o $@ + $(CXX) -c -msse2 -mno-sse4.1 $(CPPFLAGS) -DKSW_CPU_DISPATCH -DKSW_SSE2_ONLY $(INCLUDES) $< -o $@ ksw2_exts2_sse41.o:ksw2_exts2_sse.c ksw2.h kalloc.h - $(CXX) -c $(CFLAGS) -msse4.1 $(CPPFLAGS) -DKSW_CPU_DISPATCH $(INCLUDES) $< -o $@ + $(CXX) -c -msse4.1 $(CPPFLAGS) -DKSW_CPU_DISPATCH $(INCLUDES) $< -o $@ ksw2_exts2_sse2.o:ksw2_exts2_sse.c ksw2.h kalloc.h - $(CXX) -c $(CFLAGS) -msse2 -mno-sse4.1 $(CPPFLAGS) -DKSW_CPU_DISPATCH -DKSW_SSE2_ONLY $(INCLUDES) $< -o $@ + $(CXX) -c -msse2 -mno-sse4.1 $(CPPFLAGS) -DKSW_CPU_DISPATCH -DKSW_SSE2_ONLY $(INCLUDES) $< -o $@ ksw2_dispatch.o:ksw2_dispatch.c ksw2.h - $(CXX) -c $(CFLAGS) -msse4.1 $(CPPFLAGS) -DKSW_CPU_DISPATCH $(INCLUDES) $< -o $@ + $(CXX) -c -msse4.1 $(CPPFLAGS) -DKSW_CPU_DISPATCH $(INCLUDES) $< -o $@ # NEON-specific targets on ARM ksw2_extz2_neon.o:ksw2_extz2_sse.c ksw2.h kalloc.h - $(CXX) -c $(CFLAGS) $(CPPFLAGS) -DKSW_SSE2_ONLY -D__SSE2__ $(INCLUDES) $< -o $@ + $(CXX) -c $(CPPFLAGS) -DKSW_SSE2_ONLY -D__SSE2__ $(INCLUDES) $< -o $@ ksw2_extd2_neon.o:ksw2_extd2_sse.c ksw2.h kalloc.h - $(CXX) -c $(CFLAGS) $(CPPFLAGS) -DKSW_SSE2_ONLY -D__SSE2__ $(INCLUDES) $< -o $@ + $(CXX) -c $(CPPFLAGS) -DKSW_SSE2_ONLY -D__SSE2__ $(INCLUDES) $< -o $@ ksw2_exts2_neon.o:ksw2_exts2_sse.c ksw2.h kalloc.h - $(CXX) -c $(CFLAGS) $(CPPFLAGS) -DKSW_SSE2_ONLY -D__SSE2__ $(INCLUDES) $< -o $@ + $(CXX) -c $(CPPFLAGS) -DKSW_SSE2_ONLY -D__SSE2__ $(INCLUDES) $< -o $@ # other non-file targets @@ -89,7 +89,7 @@ clean: rm -fr gmon.out *.o a.out $(PROG) $(PROG_EXTRA) *~ *.a *.dSYM build dist mappy*.so mappy.c python/mappy.c mappy.egg* depend: - (LC_ALL=C; export LC_ALL; makedepend -Y -- $(CFLAGS) $(CPPFLAGS) -- *.c) + (LC_ALL=C; export LC_ALL; makedepend -Y -- $(CPPFLAGS) -- *.c) # DO NOT DELETE