Skip to content

Commit

Permalink
Improved Makefile compatibility with bioconda
Browse files Browse the repository at this point in the history
  • Loading branch information
TimD1 committed Feb 15, 2024
1 parent 6858fd6 commit b390c72
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,48 +1,46 @@
CXX = g++
CXXFLAGS = -Wall -Wextra -std=c++17 -O3
OBJS = globals.o print.o variant.o dist.o bed.o cluster.o phase.o edit.o timer.o
TARGET = vcfdist
INSTALLDIR = /usr/local/bin
OBJS = globals.o print.o variant.o dist.o bed.o cluster.o phase.o edit.o timer.o

LDLIBS = -lz -lhts -lpthread
# g++ < 9.1 and llvm < 9.0 require linking to lstdc++fs
# if using g++ >= 9.1 or llvm >= 9.0, please comment the following line
LDLIBS += -lstdc++fs
CXX ?= g++
CXXFLAGS ?= -O3
CXXFLAGS += -Wall -Wextra -std=c++17
LDFLAGS += -lz -lhts -lpthread

all: $(TARGET)

install:
cp $(TARGET) $(INSTALLDIR)

$(TARGET): $(OBJS) main.cpp
$(CXX) $(CXXFLAGS) $(OBJS) -o $(TARGET) main.cpp $(LDLIBS)
$(CXX) $(OBJS) -o $(TARGET) main.cpp $(LDFLAGS)

globals.o: globals.cpp globals.h bed.h print.h defs.h timer.h
$(CXX) -c $(CXXFLAGS) globals.cpp
$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) globals.cpp

print.o: print.cpp print.h globals.h phase.h dist.h edit.h defs.h variant.h
$(CXX) -c $(CXXFLAGS) print.cpp
$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) print.cpp

timer.o: timer.cpp timer.h globals.h defs.h
$(CXX) -c $(CXXFLAGS) timer.cpp
$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) timer.cpp

variant.o: variant.cpp variant.h print.h fasta.h defs.h globals.h
$(CXX) -c $(CXXFLAGS) variant.cpp
$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) variant.cpp

dist.o: dist.cpp dist.h fasta.h variant.h cluster.h print.h edit.h defs.h globals.h
$(CXX) -c $(CXXFLAGS) dist.cpp
$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) dist.cpp

bed.o: bed.cpp bed.h print.h defs.h globals.h
$(CXX) -c $(CXXFLAGS) bed.cpp
$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) bed.cpp

edit.o: edit.cpp edit.h defs.h globals.h
$(CXX) -c $(CXXFLAGS) edit.cpp
$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) edit.cpp

cluster.o: cluster.cpp cluster.h variant.h fasta.h globals.h dist.h defs.h
$(CXX) -c $(CXXFLAGS) cluster.cpp
$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) cluster.cpp

phase.o: phase.cpp phase.h cluster.h print.h globals.h defs.h variant.h
$(CXX) -c $(CXXFLAGS) phase.cpp
$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) phase.cpp

clean:
rm -f $(TARGET) *.o

0 comments on commit b390c72

Please sign in to comment.