Home | History | Annotate | Download | only in example
      1 # ##########################################################################
      2 # LZ4 programs - Makefile
      3 # Copyright (C) Yann Collet 2016
      4 #
      5 # GPL v2 License
      6 #
      7 # This program is free software; you can redistribute it and/or modify
      8 # it under the terms of the GNU General Public License as published by
      9 # the Free Software Foundation; either version 2 of the License, or
     10 # (at your option) any later version.
     11 #
     12 # This program is distributed in the hope that it will be useful,
     13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 # GNU General Public License for more details.
     16 #
     17 # You should have received a copy of the GNU General Public License along
     18 # with this program; if not, write to the Free Software Foundation, Inc.,
     19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     20 #
     21 # You can contact the author at :
     22 #  - LZ4 homepage : http://www.lz4.org
     23 #  - LZ4 source repository : https://github.com/lz4/lz4
     24 # ##########################################################################
     25 
     26 VOID    := /dev/null
     27 LZ4DIR  := ../include
     28 LIBDIR  := ../static
     29 DLLDIR  := ../dll
     30 
     31 CFLAGS  ?= -O3   # can select custom flags. For example : CFLAGS="-O2 -g" make
     32 CFLAGS  += -Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum \
     33            -Wdeclaration-after-statement -Wstrict-prototypes \
     34            -Wpointer-arith -Wstrict-aliasing=1
     35 CFLAGS  += $(MOREFLAGS)
     36 CPPFLAGS:= -I$(LZ4DIR) -DXXH_NAMESPACE=LZ4_
     37 FLAGS   := $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
     38 
     39 
     40 # Define *.exe as extension for Windows systems
     41 ifneq (,$(filter Windows%,$(OS)))
     42 EXT =.exe
     43 else
     44 EXT =
     45 endif
     46 
     47 .PHONY: default fullbench-dll fullbench-lib
     48 
     49 
     50 default: all
     51 
     52 all: fullbench-dll fullbench-lib
     53 
     54 
     55 fullbench-lib: fullbench.c xxhash.c
     56 	$(CC) $(FLAGS) $^ -o $@$(EXT) $(LIBDIR)/liblz4_static.lib
     57 
     58 fullbench-dll: fullbench.c xxhash.c
     59 	$(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 $(DLLDIR)/liblz4.dll
     60 
     61 clean:
     62 	@$(RM) fullbench-dll$(EXT) fullbench-lib$(EXT) \
     63 	@echo Cleaning completed
     64