Alien-Libjio
view release on metacpan or search on metacpan
libjio/libjio/Makefile view on Meta::CPAN
# output directory, will be created if it doesn't exist
O = build
CFLAGS = -std=c99 -pedantic -Wall -O3
MANDATORY_CFLAGS := \
-D_LARGEFILE_SOURCE=1 $(shell getconf LFS_CFLAGS 2>/dev/null) \
-D_XOPEN_SOURCE=600
MANDATORY_LDFLAGS := $(shell getconf LFS_LIBS 2>/dev/null)
ALL_CFLAGS += $(CFLAGS) $(MANDATORY_CFLAGS) -fPIC
ALL_LDFLAGS += $(LDFLAGS) $(MANDATORY_LDFLAGS) -fPIC
# some platforms do not have librt, we only use it if available
NEED_LIBRT := $(shell ld -o rtcheck.so -shared -lrt 2>/dev/null && echo -lrt; \
rm -f rtcheck.so)
LIBS = -lpthread $(NEED_LIBRT)
# shorthands for common build variants
ifdef DEBUG
ALL_CFLAGS += -g
ALL_LDFLAGS += -g
endif
ifdef PROFILE
ALL_CFLAGS += -g -pg -fprofile-arcs -ftest-coverage
ALL_LDFLAGS += -g -pg -fprofile-arcs -ftest-coverage -lgcov
endif
ifdef FI
ALL_CFLAGS += -DFIU_ENABLE=1
LIBS += -lfiu
endif
# prefix for installing the binaries
PREFIX = /usr/local
# prefix for eventual location of binaries
DESTDIR=$(PREFIX)
# install utility, we assume it's GNU/BSD compatible
INSTALL=install
# nicer output
ifneq ($(V), 1)
N_CC = @echo " CC $(subst $O/,,$@)"; $(CC)
N_AR = @echo " AR $(subst $O/,,$@)"; $(AR)
else
N_CC = $(CC)
N_AR = $(AR)
endif
# library version, used for soname and generated documentation
LIB_VER=1.01
LIB_SO_VER=1
OBJS = $(addprefix $O/,autosync.o checksum.o common.o compat.o trans.o \
check.o journal.o unix.o ansi.o)
# targets
default: all
all: $O/libjio.so $O/libjio.a $O/libjio.pc $O/jiofsck
# used to rebuild everything when the build flags have changed
BF = $(CC) ~ $(ALL_CFLAGS) ~ $(PREFIX)
$O/build-flags: .force-build-flags
@mkdir -p $O
@if [ x"$(BF)" != x"`cat $O/build-flags 2>/dev/null`" ]; then \
( run in 0.617 second using v1.01-cache-2.11-cpan-5b529ec07f3 )