-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
65 lines (56 loc) · 2.35 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Include config.make only if we're not looking for help
ifeq ($(findstring help, $(strip $(MAKECMDGOALS))),)
ifeq ($(findstring tools, $(strip $(MAKECMDGOALS))),)
ifeq ($(findstring clean, $(strip $(MAKECMDGOALS))),)
ifeq ($(findstring dist, $(strip $(MAKECMDGOALS))),)
include config.make
endif
endif
endif
endif
# Get version string from H5Z-ZFP
H5Z_ZFP_VERSINFO := $(shell grep '^\#define H5Z_FILTER_ZFP_VERSION_[MP]' src/H5Zzfp_version.h | cut -d' ' -f3 | tr '\n' '.' | cut -d'.' -f-3 2>/dev/null)
.PHONY: help all clean dist install
help:
@echo ""
@echo ""
@echo ""
@echo " This is H5Z-ZFP version $(H5Z_ZFP_VERSINFO)."
@echo "See http://h5z-zfp.readthedocs.io/en/latest/ file for more info."
@echo ""
@echo "Typical make command is..."
@echo ""
@echo " make CC=<C-compiler> HDF5_HOME=<path> ZFP_HOME=<path> PREFIX=<path> all"
@echo ""
@echo "where <path> is a dir whose children are include/lib/bin subdirs."
@echo "HDF5_HOME can also be set using an INC,LIB,BIN triplet specifying"
@echo "HDF5 include, library and binary dirs separated by commas."
@echo "Standard make variables (e.g. CFLAGS, LD, etc.) can be set as usual."
@echo "Optionally, add FC=<fortran-compiler> to include Fortran support and tests."
@echo ""
@echo "Available make targets are..."
@echo " all - build everything needed for H5Z-ZFP plugin/lib"
@echo " check - all + run tests"
@echo " tools - build tools (currently just print_h5repack_farg)"
@echo " install - install plugin/lib"
@echo " clean - clean away all derived targets"
@echo " dist - create distribution tarfile"
@echo " help - this help message"
all:
cd src; $(MAKE) $(MAKEVARS) $@
check: all
cd test; $(MAKE) $(MAKEVARS) $@
tools:
cd test; $(MAKE) $(MAKEVARS) print_h5repack_farg
install: all
cd src; $(MAKE) $(MAKEVARS) $@
clean:
rm -f H5Z-ZFP-$(H5Z_ZFP_VERSINFO).tar.gz
cd src; $(MAKE) $(MAKEVARS) $@
cd test; $(MAKE) $(MAKEVARS) $@
dist: clean
rm -rf H5Z-ZFP-$(H5Z_ZFP_VERSINFO) H5Z-ZFP-$(H5Z_ZFP_VERSINFO).tar.gz; \
mkdir H5Z-ZFP-$(H5Z_ZFP_VERSINFO); \
tar cf - --exclude ".git*" --exclude H5Z-ZFP-$(H5Z_ZFP_VERSINFO) . | tar xf - -C H5Z-ZFP-$(H5Z_ZFP_VERSINFO); \
tar cvf - H5Z-ZFP-$(H5Z_ZFP_VERSINFO) | gzip --best > H5Z-ZFP-$(H5Z_ZFP_VERSINFO).tar.gz; \
rm -rf H5Z-ZFP-$(H5Z_ZFP_VERSINFO);