Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Makefile #137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,40 +1,37 @@

# HAPCUT2 MAKEFILE
default: all

CFLAGS=-Wall -g -O3 -Wall -D_GNU_SOURCE
CFLAGS=-Wall -g -O3 -Wall -D_GNU_SOURCE -I/home/jialechen/software/htslib-1.20/include
LDFLAGS=-L/home/jialechen/software/htslib-1.20/lib -lhts

# DIRECTORIES
B=build
H=hairs-src
X=hapcut2-src
HTSLIB=htslib #/usr/common/src/htslib #path/to/htslib/
HTSLIB=/home/jialechen/software/htslib-1.20
T=test
# below is the path to CUnit directory, change if need be
CUNIT=/usr/include/CUnit
LDFLAGS=-L$(HTSLIB)

all: $(B)/extractHAIRS $(B)/HAPCUT2

#temporarily removed -O2 flag after -I$(HTSLIB)
$(B)/extractHAIRS: $(B)/bamread.o $(B)/hashtable.o $(B)/readvariant.o $(B)/readfasta.o $(B)/hapfragments.o $(H)/extracthairs.c $(H)/parsebamread.c $(H)/realignbamread.c $(H)/nw.c $(H)/realign_pairHMM.c $(H)/estimate_hmm_params.c | $(B)
$(CC) $(CFLAGS) $(LDFLAGS) -I$(HTSLIB) -g $(B)/bamread.o $(B)/hapfragments.o $(B)/hashtable.o $(B)/readfasta.o $(B)/readvariant.o -o $(B)/extractHAIRS $(H)/extracthairs.c -pthread -lhts -lm -lz -lcurl -llzma -lbz2
#temporarily removed -O2 flag after -I$(HTSLIB)
$(CC) $(CFLAGS) $(LDFLAGS) -g $(B)/bamread.o $(B)/hapfragments.o $(B)/hashtable.o $(B)/readfasta.o $(B)/readvariant.o -o $(B)/extractHAIRS $(H)/extracthairs.c -pthread -lm -lz -lcurl -llzma -lbz2

$(B)/hapfragments.o: $(H)/hapfragments.c $(H)/hapfragments.h $(H)/readvariant.h | $(B)
$(CC) -c $(CFLAGS) $(H)/hapfragments.c -o $(B)/hapfragments.o

$(B)/readvariant.o: $(H)/readvariant.c $(H)/readvariant.h $(H)/hashtable.h $(H)/hashtable.c | $(B)
$(CC) -c $(CFLAGS) -I$(HTSLIB) $(H)/readvariant.c -o $(B)/readvariant.o
$(CC) -c $(CFLAGS) $(H)/readvariant.c -o $(B)/readvariant.o

$(B)/bamread.o: $(H)/bamread.h $(H)/bamread.c $(H)/readfasta.h $(H)/readfasta.c | $(B)
$(CC) -c $(CFLAGS) -I$(HTSLIB) $(H)/bamread.c -lhts -o $(B)/bamread.o
$(CC) -c $(CFLAGS) $(H)/bamread.c -o $(B)/bamread.o

$(B)/hashtable.o: $(H)/hashtable.h $(H)/hashtable.c | $(B)
$(CC) -c $(CFLAGS) $(H)/hashtable.c -o $(B)/hashtable.o

$(B)/readfasta.o: $(H)/readfasta.c $(H)/readfasta.h | $(B)
$(CC) -c $(CFLAGS) -I$(HTSLIB) $(H)/readfasta.c -o $(B)/readfasta.o
$(CC) -c $(CFLAGS) $(H)/readfasta.c -o $(B)/readfasta.o

# BUILD HAPCUT2

Expand Down Expand Up @@ -78,7 +75,6 @@ install-hapcut2:
install-hairs:
cp $(B)/extractHAIRS /usr/local/bin


# UNINSTALL
uninstall: uninstall-hapcut2 uninstall-hairs

Expand All @@ -88,7 +84,6 @@ uninstall-hapcut2:
uninstall-hairs:
rm /usr/local/bin/extractHAIRS


# CLEANUP
clean:
rm -rf $(B)