2017-08-31 18:24:54 +00:00
|
|
|
# ################################################################
|
2016-10-24 13:59:51 +00:00
|
|
|
# Copyright (c) 2016-present, Facebook, Inc.
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
2017-08-31 18:24:54 +00:00
|
|
|
# This source code is licensed under both the BSD-style license (found in the
|
|
|
|
# LICENSE file in the root directory of this source tree) and the GPLv2 (found
|
|
|
|
# in the COPYING file in the root directory of this source tree).
|
|
|
|
# ################################################################
|
2016-10-24 13:59:51 +00:00
|
|
|
|
2018-03-09 19:52:14 +00:00
|
|
|
CXXFLAGS ?= -O3
|
|
|
|
CXXFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wno-comment
|
|
|
|
CXXFLAGS += $(MOREFLAGS)
|
2018-06-10 23:04:21 +00:00
|
|
|
FLAGS = $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS)
|
2016-10-24 13:59:51 +00:00
|
|
|
|
2017-02-22 08:57:50 +00:00
|
|
|
ZSTDAPI = ../../lib/zstd.h
|
|
|
|
ZSTDMANUAL = ../../doc/zstd_manual.html
|
|
|
|
LIBVER_MAJOR_SCRIPT:=`sed -n '/define ZSTD_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < $(ZSTDAPI)`
|
|
|
|
LIBVER_MINOR_SCRIPT:=`sed -n '/define ZSTD_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < $(ZSTDAPI)`
|
|
|
|
LIBVER_PATCH_SCRIPT:=`sed -n '/define ZSTD_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < $(ZSTDAPI)`
|
|
|
|
LIBVER_SCRIPT:= $(LIBVER_MAJOR_SCRIPT).$(LIBVER_MINOR_SCRIPT).$(LIBVER_PATCH_SCRIPT)
|
|
|
|
LIBVER := $(shell echo $(LIBVER_SCRIPT))
|
2016-10-24 13:59:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Define *.exe as extension for Windows systems
|
|
|
|
ifneq (,$(filter Windows%,$(OS)))
|
|
|
|
EXT =.exe
|
|
|
|
else
|
|
|
|
EXT =
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2017-02-22 08:57:50 +00:00
|
|
|
.PHONY: default
|
2016-10-24 13:59:51 +00:00
|
|
|
default: gen_html
|
|
|
|
|
2017-02-22 08:57:50 +00:00
|
|
|
.PHONY: all
|
|
|
|
all: manual
|
|
|
|
|
2016-10-24 13:59:51 +00:00
|
|
|
gen_html: gen_html.cpp
|
2017-02-22 08:57:50 +00:00
|
|
|
$(CXX) $(FLAGS) $^ -o $@$(EXT)
|
|
|
|
|
|
|
|
$(ZSTDMANUAL): gen_html $(ZSTDAPI)
|
|
|
|
echo "Update zstd manual in /doc"
|
|
|
|
./gen_html $(LIBVER) $(ZSTDAPI) $(ZSTDMANUAL)
|
2016-10-24 13:59:51 +00:00
|
|
|
|
2017-02-22 08:57:50 +00:00
|
|
|
.PHONY: manual
|
|
|
|
manual: gen_html $(ZSTDMANUAL)
|
2016-10-24 13:59:51 +00:00
|
|
|
|
2017-02-22 08:57:50 +00:00
|
|
|
.PHONY: clean
|
2016-10-24 13:59:51 +00:00
|
|
|
clean:
|
|
|
|
@$(RM) gen_html$(EXT)
|
|
|
|
@echo Cleaning completed
|