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