"Fossies" - the Fresh Open Source Software Archive

Member "xxHash-0.8.0/tests/Makefile" (27 Jul 2020, 2246 Bytes) of package /linux/misc/xxHash-0.8.0.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "Makefile": 0.7.4_vs_0.8.0.

    1 CFLAGS += -Wall -Wextra -Wundef -g
    2 
    3 NM = nm
    4 GREP = grep
    5 
    6 # Define *.exe as extension for Windows systems
    7 ifneq (,$(filter Windows%,$(OS)))
    8 EXT =.exe
    9 else
   10 EXT =
   11 endif
   12 
   13 ifneq (,$(filter %UTF-8,$(LANG)))
   14 ENABLE_UNICODE ?= 1
   15 else
   16 ENABLE_UNICODE ?= 0
   17 endif
   18 
   19 .PHONY: default
   20 default: all
   21 
   22 .PHONY: all
   23 all: test
   24 
   25 .PHONY: test
   26 test: test_multiInclude test_unicode
   27 
   28 .PHONY: test_multiInclude
   29 test_multiInclude:
   30 	@$(MAKE) clean
   31 	# compile without xxhash.o, ensure symbols exist within target
   32 	# Note: built using only default rules
   33 	$(MAKE) multiInclude
   34 	@$(MAKE) clean
   35 	# compile with xxhash.o, to detect duplicated symbols
   36 	$(MAKE) multiInclude_withxxhash
   37 	@$(MAKE) clean
   38 	# Note: XXH_INLINE_ALL with XXH_NAMESPACE is currently disabled
   39 	# compile with XXH_NAMESPACE
   40 	# CPPFLAGS=-DXXH_NAMESPACE=TESTN_ $(MAKE) multiInclude_withxxhash
   41 	# no symbol prefixed TESTN_ should exist
   42 	# ! $(NM) multiInclude_withxxhash | $(GREP) TESTN_
   43 	#$(MAKE) clean
   44 	# compile with XXH_NAMESPACE and without xxhash.o
   45 	# CPPFLAGS=-DXXH_NAMESPACE=TESTN_ $(MAKE) multiInclude
   46 	# no symbol prefixed TESTN_ should exist
   47 	# ! $(NM) multiInclude | $(GREP) TESTN_
   48 	#@$(MAKE) clean
   49 
   50 .PHONY: test_ppc_redefine
   51 test_ppc_redefine: ppc_define.c
   52 	@$(MAKE) clean
   53 	$(CC) $(CPPFLAGS) $(CFLAGS) -c $^
   54 
   55 xxhsum$(EXT): ../xxhash.c ../xxhash.h ../xxhsum.c
   56 	$(CC) $(CFLAGS) $(LDFLAGS) ../xxhash.c ../xxhsum.c -o $@
   57 
   58 # Make sure that Unicode filenames work.
   59 # https://github.com/Cyan4973/xxHash/issues/293
   60 .PHONY: test_unicode
   61 ifeq (0,$(ENABLE_UNICODE))
   62 test_unicode:
   63 	@echo "Skipping Unicode test, your terminal doesn't appear to support UTF-8."
   64 	@echo "Try with ENABLE_UNICODE=1"
   65 else
   66 test_unicode: xxhsum$(EXT) generate_unicode_test.c
   67 	# Generate a Unicode filename test dynamically
   68 	# to keep UTF-8 out of the source tree.
   69 	$(CC) $(CFLAGS) $(LDFLAGS) generate_unicode_test.c -o generate_unicode_test$(EXT)
   70 	./generate_unicode_test$(EXT)
   71 	$(SHELL) ./unicode_test.sh
   72 endif
   73 
   74 xxhash.o: ../xxhash.c ../xxhash.h
   75 	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -c -o $@ $<
   76 
   77 multiInclude_withxxhash: multiInclude.o xxhash.o
   78 	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^
   79 
   80 clean:
   81 	@$(RM) *.o
   82 	@$(RM) multiInclude multiInclude_withxxhash
   83 	@$(RM) *.unicode generate_unicode_test$(EXT) unicode_test.* xxhsum$(EXT)