Skip to content

Commit

Permalink
Update Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
niemasd authored Sep 29, 2023
1 parent 07dc244 commit 76ed096
Showing 1 changed file with 4 additions and 25 deletions.
29 changes: 4 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,7 @@ CXXFLAGS?=-Wall -pedantic -std=c++11
# flag specifications for release and debug
RELEASEFLAGS?=$(CXXFLAGS) -O3
DEBUGFLAGS?=$(CXXFLAGS) -O0 -g #-pg

# htslib stuff (from https://github.com/fbreitwieser/bamcov/blob/master/Makefile)
INCLUDE=-Ihtslib
ifneq "$(origin PLATFORM)" "file"
PLATFORM := $(shell uname -s)
endif
ifeq "$(PLATFORM)" "Darwin"
HTSLIB=libhts.dylib
else ifeq "$(findstring CYGWIN,$(PLATFORM))" "CYGWIN"
HTSLIB=cyghts-$(LIBHTS_SOVERSION).dll
else ifeq "$(findstring MSYS,$(PLATFORM))" "MSYS"
HTSLIB=hts-$(LIBHTS_SOVERSION).dll
else
HTSLIB=libhts.so
endif
HTSLIB_A=htslib/libhts.a
LIBS=-llzma -lbz2 -lz -lcurl -pthread -lhts

# relevant constants
Expand All @@ -33,15 +18,9 @@ DEBUG_EXE=$(EXE)_$(DEBUG_SUFFIX)

# compile
all: $(EXE)
$(EXE): $(GLOBAL_DEPS) $(HTSLIB_A)
$(CXX) $(RELEASEFLAGS) $(INCLUDE) -o $(EXE) $(CPP_FILES) $(HTSLIB_A) $(LIBS)
debug: $(GLOBAL_DEPS) $(HTSLIB_A)
$(CXX) $(DEBUGFLAGS) $(INCLUDE) -o $(DEBUG_EXE) $(CPP_FILES) $(HTSLIB_A) $(LIBS)
$(EXE): $(GLOBAL_DEPS))
$(CXX) $(RELEASEFLAGS) $(INCLUDE) -o $(EXE) $(CPP_FILES) $(LIBS)
debug: $(GLOBAL_DEPS)
$(CXX) $(DEBUGFLAGS) $(INCLUDE) -o $(DEBUG_EXE) $(CPP_FILES) $(LIBS)
clean:
$(RM) $(EXE) $(DEBUG_EXE) *.o
htslib/Makefile:
git submodule update --init --recursive
htslib/libhts.a: htslib/Makefile
cd htslib && make libhts.a
htslib/$(HTSLIB): htslib/Makefile
cd htslib && make $(HTSLIB)

0 comments on commit 76ed096

Please sign in to comment.