127b27ec6Sopenharmony_ci# ##########################################################################
227b27ec6Sopenharmony_ci# LZ4 programs - Makefile
327b27ec6Sopenharmony_ci# Copyright (C) Yann Collet 2016-2020
427b27ec6Sopenharmony_ci#
527b27ec6Sopenharmony_ci# GPL v2 License
627b27ec6Sopenharmony_ci#
727b27ec6Sopenharmony_ci# This program is free software; you can redistribute it and/or modify
827b27ec6Sopenharmony_ci# it under the terms of the GNU General Public License as published by
927b27ec6Sopenharmony_ci# the Free Software Foundation; either version 2 of the License, or
1027b27ec6Sopenharmony_ci# (at your option) any later version.
1127b27ec6Sopenharmony_ci#
1227b27ec6Sopenharmony_ci# This program is distributed in the hope that it will be useful,
1327b27ec6Sopenharmony_ci# but WITHOUT ANY WARRANTY; without even the implied warranty of
1427b27ec6Sopenharmony_ci# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1527b27ec6Sopenharmony_ci# GNU General Public License for more details.
1627b27ec6Sopenharmony_ci#
1727b27ec6Sopenharmony_ci# You should have received a copy of the GNU General Public License along
1827b27ec6Sopenharmony_ci# with this program; if not, write to the Free Software Foundation, Inc.,
1927b27ec6Sopenharmony_ci# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2027b27ec6Sopenharmony_ci#
2127b27ec6Sopenharmony_ci# You can contact the author at :
2227b27ec6Sopenharmony_ci#  - LZ4 homepage : http://www.lz4.org
2327b27ec6Sopenharmony_ci#  - LZ4 source repository : https://github.com/lz4/lz4
2427b27ec6Sopenharmony_ci# ##########################################################################
2527b27ec6Sopenharmony_ci
2627b27ec6Sopenharmony_ciVOID    := /dev/null
2727b27ec6Sopenharmony_ciLZ4DIR  := ../include
2827b27ec6Sopenharmony_ciLIBDIR  := ../static
2927b27ec6Sopenharmony_ciDLLDIR  := ../dll
3027b27ec6Sopenharmony_ci
3127b27ec6Sopenharmony_ciCFLAGS  ?= -O3   # can select custom flags. For example : CFLAGS="-O2 -g" make
3227b27ec6Sopenharmony_ciCFLAGS  += -Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum \
3327b27ec6Sopenharmony_ci           -Wdeclaration-after-statement -Wstrict-prototypes \
3427b27ec6Sopenharmony_ci           -Wpointer-arith -Wstrict-aliasing=1
3527b27ec6Sopenharmony_ciCFLAGS  += $(MOREFLAGS)
3627b27ec6Sopenharmony_ciCPPFLAGS:= -I$(LZ4DIR) -DXXH_NAMESPACE=LZ4_
3727b27ec6Sopenharmony_ciFLAGS   := $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
3827b27ec6Sopenharmony_ci
3927b27ec6Sopenharmony_ci
4027b27ec6Sopenharmony_ci# Define *.exe as extension for Windows systems
4127b27ec6Sopenharmony_ciifneq (,$(filter Windows%,$(OS)))
4227b27ec6Sopenharmony_ciEXT =.exe
4327b27ec6Sopenharmony_cielse
4427b27ec6Sopenharmony_ciEXT =
4527b27ec6Sopenharmony_ciendif
4627b27ec6Sopenharmony_ci
4727b27ec6Sopenharmony_ci.PHONY: default fullbench-dll fullbench-lib
4827b27ec6Sopenharmony_ci
4927b27ec6Sopenharmony_ci
5027b27ec6Sopenharmony_cidefault: all
5127b27ec6Sopenharmony_ci
5227b27ec6Sopenharmony_ciall: fullbench-dll fullbench-lib
5327b27ec6Sopenharmony_ci
5427b27ec6Sopenharmony_ci
5527b27ec6Sopenharmony_cifullbench-lib: fullbench.c xxhash.c
5627b27ec6Sopenharmony_ci	$(CC) $(FLAGS) $^ -o $@$(EXT) $(LIBDIR)/liblz4_static.lib
5727b27ec6Sopenharmony_ci
5827b27ec6Sopenharmony_cifullbench-dll: fullbench.c xxhash.c
5927b27ec6Sopenharmony_ci	$(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 $(DLLDIR)/liblz4.dll
6027b27ec6Sopenharmony_ci
6127b27ec6Sopenharmony_ciclean:
6227b27ec6Sopenharmony_ci	@$(RM) fullbench-dll$(EXT) fullbench-lib$(EXT) \
6327b27ec6Sopenharmony_ci	@echo Cleaning completed
64