Skip to content

Commit f9dbef3

Browse files
committed
makefile can create releases and binaries
1 parent f32ebc4 commit f9dbef3

File tree

1 file changed

+26
-20
lines changed

1 file changed

+26
-20
lines changed

Makefile

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ CXX = g++
66
AR = ar
77
CPPFLAGS += -I slow5lib/include/ -I slow5lib/src
88
CFLAGS += -g -rdynamic -Wall -O2
9-
LANG = -x c++ -std=c++11
9+
LANGFLAG = -x c++ -std=c++11
1010
LDFLAGS += $(LIBS) -lpthread -lz
1111
BUILD_DIR = build
1212

@@ -33,37 +33,37 @@ $(BINARY): src/config.h $(HDF5_LIB) $(OBJ_BIN) slow5lib/lib/libslow5.a
3333
$(CXX) $(CFLAGS) $(OBJ_BIN) slow5lib/lib/libslow5.a $(LDFLAGS) -o $@
3434

3535
$(BUILD_DIR)/main.o: src/main.c src/error.h
36-
$(CXX) $(LANG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
36+
$(CXX) $(LANGFLAG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
3737

3838
$(BUILD_DIR)/f2s.o: src/f2s.c src/error.h
39-
$(CXX) $(LANG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
39+
$(CXX) $(LANGFLAG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
4040

4141
$(BUILD_DIR)/s2f.o: src/s2f.c src/error.h
42-
$(CXX) $(LANG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
42+
$(CXX) $(LANGFLAG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
4343

4444
$(BUILD_DIR)/index.o: src/index.c src/error.h
45-
$(CXX) $(LANG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
45+
$(CXX) $(LANGFLAG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
4646

4747
$(BUILD_DIR)/get.o: src/get.c src/error.h
48-
$(CXX) $(LANG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
48+
$(CXX) $(LANGFLAG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
4949

5050
$(BUILD_DIR)/view.o: src/view.c src/error.h
51-
$(CXX) $(LANG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
51+
$(CXX) $(LANGFLAG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
5252

5353
$(BUILD_DIR)/thread.o: src/thread.c
54-
$(CXX) $(LANG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
54+
$(CXX) $(LANGFLAG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
5555

5656
$(BUILD_DIR)/read_fast5.o: src/read_fast5.c
57-
$(CXX) $(LANG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
57+
$(CXX) $(LANGFLAG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
5858

5959
$(BUILD_DIR)/merge.o: src/merge.c src/error.h
60-
$(CXX) $(LANG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
60+
$(CXX) $(LANGFLAG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
6161

6262
$(BUILD_DIR)/split.o: src/split.c src/error.h
63-
$(CXX) $(LANG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
63+
$(CXX) $(LANGFLAG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
6464

6565
$(BUILD_DIR)/stats.o: src/stats.c src/error.h
66-
$(CXX) $(LANG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
66+
$(CXX) $(LANGFLAG) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
6767

6868
slow5lib/lib/libslow5.a:
6969
make -C slow5lib
@@ -92,26 +92,32 @@ clean:
9292

9393
# Delete all gitignored files (but not directories)
9494
distclean: clean
95+
make clean
9596
git clean -f -X
9697
rm -rf $(BUILD_DIR)/* autom4te.cache
9798

9899
dist: distclean
99100
mkdir -p slow5tools-$(VERSION)
101+
mkdir -p slow5tools-$(VERSION)/scripts slow5tools-$(VERSION)/docs slow5tools-$(VERSION)/slow5lib
100102
autoreconf
101103
cp -r README.md LICENSE Makefile configure.ac config.mk.in \
102-
installdeps.mk src docs build configure slow5tools-$(VERSION)
103-
mkdir -p slow5tools-$(VERSION)/scripts
104+
installdeps.mk configure build src slow5tools-$(VERSION)
104105
cp scripts/install-hdf5.sh slow5tools-$(VERSION)/scripts
106+
cp -r docs/commands.md slow5tools-$(VERSION)/docs/
107+
cp -r slow5lib/lib slow5lib/include slow5lib/src slow5lib/Makefile slow5lib/LICENSE slow5tools-$(VERSION)/slow5lib
105108
tar -zcf slow5tools-$(VERSION)-release.tar.gz slow5tools-$(VERSION)
106109
rm -rf slow5tools-$(VERSION)
107110

108-
binary:
111+
binary: distclean
112+
autoreconf
113+
scripts/install-hdf5.sh
114+
./configure --enable-localhdf5
115+
make -j8
109116
mkdir -p slow5tools-$(VERSION)
110-
make clean
111-
make && mv slow5tools slow5tools-$(VERSION)/slow5tools_x86_64_linux
112-
cp -r README.md LICENSE docs slow5tools-$(VERSION)/
113-
#mkdir -p slow5tools-$(VERSION)/scripts
114-
#cp scripts/test.sh slow5tools-$(VERSION)/scripts
117+
mkdir slow5tools-$(VERSION)/docs
118+
mv slow5tools slow5tools-$(VERSION)/slow5tools_x86_64_linux
119+
cp -r README.md LICENSE slow5tools-$(VERSION)/
120+
cp -r docs/commands.md slow5tools-$(VERSION)/docs/
115121
tar -zcf slow5tools-$(VERSION)-binaries.tar.gz slow5tools-$(VERSION)
116122
rm -rf slow5tools-$(VERSION)
117123

0 commit comments

Comments
 (0)