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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
# compiler executables --------------------------------------------------------
CC = gcc
CXX = g++
# language standard -----------------------------------------------------------
CSTD = -std=c89 -Wno-unused-function
# CSTD = -std=c99
CXXSTD = -std=c++98
# CXXSTD = -std=c++11
# common compiler options -----------------------------------------------------
FLAGS = -O3 -fPIC -Wall -Wextra -pedantic -I../include
SOFLAGS =
# macOS compiler options (uncomment on macOS) ---------------------------------
# SOFLAGS += -undefined dynamic_lookup
# required compiler macros ----------------------------------------------------
# floating-point arithmetic implementation; choose one
# FAST: optimize for speed; may impact correctness and portability
# SAFE: use volatile accumulator
# EMUL: emulate floating-point arithmetic
# INT: reinterpret floating-point numbers as integers; most portable
FPZIP_FP = FPZIP_FP_FAST
# FPZIP_FP = FPZIP_FP_SAFE
# FPZIP_FP = FPZIP_FP_EMUL
# FPZIP_FP = FPZIP_FP_INT
# output buffer size in bytes (ideally the disk block size)
FPZIP_BLOCK_SIZE = 0x1000
# FPZIP_BLOCK_SIZE = 1
# optional compiler macros ----------------------------------------------------
# use long long for 64-bit types
# DEFS += -DFPZIP_INT64='long long' -DFPZIP_INT64_SUFFIX='ll'
# DEFS += -DFPZIP_UINT64='unsigned long long' -DFPZIP_UINT64_SUFFIX='ull'
# bitwise type conversion mechanisms (defaults to memcpy)
# FPZIP_CONV = -DFPZIP_WITH_REINTERPRET_CAST
# FPZIP_CONV = -DFPZIP_WITH_UNION
DEFS += -DFPZIP_BLOCK_SIZE=$(FPZIP_BLOCK_SIZE) -DFPZIP_FP=$(FPZIP_FP) $(FPZIP_CONV)
# build targets ---------------------------------------------------------------
# default targets
BUILD_UTILITIES = 1
BUILD_TESTING = 1
BUILD_SHARED_LIBS = 0
# build all targets?
ifdef BUILD_ALL
ifneq ($(BUILD_ALL),0)
BUILD_UTILITIES = 1
BUILD_TESTING = 1
endif
endif
# build shared libraries?
ifneq ($(BUILD_SHARED_LIBS),0)
LIBRARY = shared
LIBFPZIP = libfpzip.so
else
LIBRARY = static
LIBFPZIP = libfpzip.a
endif
# conditionals ----------------------------------------------------------------
# compiler options ------------------------------------------------------------
CFLAGS = $(CSTD) $(FLAGS) $(DEFS)
CXXFLAGS = $(CXXSTD) $(FLAGS) $(DEFS)
|