modified: nfig1.py
[GalaxyCodeBases.git] / c_cpp / readscorr / Makefile
blobf352073fe1a7175e19fe182870911dfd89bd0849
1 CC = gcc
2 #CPP = g++
3 CFLAGS = -Wall -pipe -march=core2 -mtune=generic -pedantic -Wfloat-equal\
4 # -Wno-packed-bitfield-compat\
5 # -Wpadded -Wextra
6 # -DMKL_ILP64 -m64 -I$(MKLROOT)/include \
7 # -ftree-vectorize -ftree-vectorizer-verbose=5
8 LDFLAGS = -lz -lm -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,--enable-new-dtags -Wl,--hash-style=both \
9 # $(MKLROOT)/lib/em64t/libmkl_solver_ilp64_sequential.a -Wl,--start-group $(MKLROOT)/lib/em64t/libmkl_intel_ilp64.a $(MKLROOT)/lib/em64t/libmkl_sequential.a $(MKLROOT)/lib/em64t/libmkl_core.a -Wl,--end-group -lpthread
10 OPT = -O3
11 ASMO = -Wa,-a,-ad
13 OBJDIR = ./objects/
15 DEF = #-D NEW
17 MAKEARG = $(CFLAGS) $(DEF) $(OPT) $(ASMO)
19 # OpenMP
20 ifdef OPENMP
21 override CFLAGS := $(CFLAGS) -fopenmp
22 override DEF := $(DEF) -D OPENMP
23 endif
25 # pthread
26 ifdef PTHREAD
27 override LDFLAGS := $(LDFLAGS) -lpthread
28 override DEF := $(DEF) -D PTHREAD
29 endif
31 cobjects =
32 customobjects = $(addprefix $(OBJDIR),)# sdleftTFuint16.o sdleftTFuint32.o sdleftTFuint64.o sdleftTFpublic.o )
33 c99objects = $(addprefix $(OBJDIR), MurmurHash3.o gFileIO.o 2bitseq.o cfgparser.o gtools.o sdleft.o)
34 mainobjects = $(addprefix $(OBJDIR), main.o tester.o fcount.o gcount.o )
35 objects = $(cobjects) $(c99objects) $(customobjects)
36 exefiles = readscorr tester fcount gcount
38 all: clean $(objects) $(exefiles)
39 @echo [$(CC) $(CFLAGS) $(OPT) $(LDFLAGS)][$(MAKEARG)].
41 readscorr: $(objects) $(mainobjects)
42 @$(CC) $(CFLAGS) $(OPT) $(LDFLAGS) -o readscorr $(objects) $(addprefix $(OBJDIR), main.o)
43 tester: $(objects) $(mainobjects)
44 @$(CC) $(CFLAGS) $(OPT) $(LDFLAGS) -o tester $(objects) $(addprefix $(OBJDIR), tester.o)
45 fcount: $(objects) $(mainobjects)
46 @$(CC) $(CFLAGS) $(OPT) $(LDFLAGS) -o fcount $(objects) $(addprefix $(OBJDIR), fcount.o)
47 gcount: $(objects) $(mainobjects)
48 @$(CC) $(CFLAGS) $(OPT) $(LDFLAGS) -o gcount $(objects) $(addprefix $(OBJDIR), gcount.o)
50 #$(OBJDIR)sdleftTFuint16.o:
51 # $(CC) -std=gnu99 $(MAKEARG) -D USEUINT16 -c sdleftTF.c -o $@ > $(@:.o=.asm)
52 #$(OBJDIR)sdleftTFuint32.o:
53 # $(CC) -std=gnu99 $(MAKEARG) -D USEUINT32 -c sdleftTF.c -o $@ > $(@:.o=.asm)
54 #$(OBJDIR)sdleftTFuint64.o:
55 # $(CC) -std=gnu99 $(MAKEARG) -D USEUINT64 -c sdleftTF.c -o $@ > $(@:.o=.asm)
56 #$(OBJDIR)sdleftTFpublic.o:
57 # $(CC) -std=gnu99 $(MAKEARG) -D PUBLIC -c sdleftTF.c -o $@ > $(@:.o=.asm)
59 $(cobjects): $(OBJDIR)%.o: %.c
60 @$(CC) $(MAKEARG) -c $< -o $@ > $(@:.o=.asm)
61 #$(cppobjects): %.o: %.cpp
62 # $(CPP) $(MAKEARG) -c $< -o $@ > $@.asm
63 $(c99objects) $(mainobjects): $(OBJDIR)%.o: %.c
64 @$(CC) -std=gnu99 $(MAKEARG) -c $< -o $@ > $(@:.o=.asm)
66 debug: override MAKEARG := $(CFLAGS) $(DEF) -O -D DEBUG -g $(ASMO)
67 debug: all
69 alpha: override MAKEARG := $(CFLAGS) $(DEF) $(OPT) $(ASMO) -D TEST
70 alpha: all
72 alphadbg: override MAKEARG := $(CFLAGS) $(DEF) $(OPT) $(ASMO) -D TEST -D DEBUG -g
73 alphadbg: all
75 alphapf: override MAKEARG := $(CFLAGS) $(DEF) $(OPT) $(ASMO) -D TEST -pg -g
76 alphapf: override LDFLAGS += -pg
77 alphapf: gprofmain
79 gprofmain: clean readscorr
80 ./readscorr -o gprof test.lst 2> gprof.log
81 gprof -l readscorr > gprof.report
83 test: readscorr
84 valgrind --leak-check=yes ./readscorr test.lst -k 17
86 .PHONY : clean
87 clean:
88 -rm $(exefiles) $(mainobjects) $(objects)
89 @mkdir -p $(OBJDIR)