summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthieu Vion <mvion@greensystemes.com>2020-10-16 11:52:15 +0200
committerDavid Peter <sharkdp@users.noreply.github.com>2020-10-16 14:22:59 +0200
commit7c7eebbe8368e9ac605113af026a9f5eaf74090e (patch)
tree4ce695f1e9315b93774a613ec13a53cb00104e41
parent57ad85814b89bdcb3ee8114b7eb45460156d9914 (diff)
Changed Makefile syntax test source
Now using Makefile from the Redis project
-rw-r--r--tests/syntax-tests/highlighted/Makefile/Makefile552
-rw-r--r--tests/syntax-tests/source/Makefile/LICENSE.md681
-rw-r--r--tests/syntax-tests/source/Makefile/Makefile552
3 files changed, 750 insertions, 1035 deletions
diff --git a/tests/syntax-tests/highlighted/Makefile/Makefile b/tests/syntax-tests/highlighted/Makefile/Makefile
index 5c4e344a..dc4d36fc 100644
--- a/tests/syntax-tests/highlighted/Makefile/Makefile
+++ b/tests/syntax-tests/highlighted/Makefile/Makefile
@@ -1,195 +1,385 @@
-#!/usr/bin/make -f
-# Generated automatically from Makefile.in by configure.
-# Un*x Makefile for GNU tar program.
-# Copyright (C) 1991 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute
-# it and/or modify it under the terms of the GNU
-# General Public License …
-…
-…
-
-SHELL = /bin/sh
-
-#### Start of system configuration section. ####
-
-srcdir = .
-
-# If you use gcc, you should either run the
-# fixincludes script that comes with it or else use
-# gcc with the -traditional option. Otherwise ioctl
-# calls will be compiled incorrectly on some systems.
-CC = gcc -O
-YACC = bison -y
-INSTALL = /usr/local/bin/install -c
-INSTALLDATA = /usr/local/bin/install -c -m 644
-
-# Things you might add to DEFS:
-# -DSTDC_HEADERS If you have ANSI C headers and
-# libraries.
-# -DPOSIX If you have POSIX.1 headers and
-# libraries.
-# -DBSD42 If you have sys/dir.h (unless
-# you use -DPOSIX), sys/file.h,
-# and st_blocks in `struct stat'.
-# -DUSG If you have System V/ANSI C
-# string and memory functions
-# and headers, sys/sysmacros.h,
-# fcntl.h, getcwd, no valloc,
-# and ndir.h (unless
-# you use -DDIRENT).
-# -DNO_MEMORY_H If USG or STDC_HEADERS but do not
-# include memory.h.
-# -DDIRENT If USG and you have dirent.h
-# instead of ndir.h.
-# -DSIGTYPE=int If your signal handlers
-# return int, not void.
-# -DNO_MTIO If you lack sys/mtio.h
-# (magtape ioctls).
-# -DNO_REMOTE If you do not have a remote shell
-# or rexec.
-# -DUSE_REXEC To use rexec for remote tape
-# operations instead of
-# forking rsh or remsh.
-# -DVPRINTF_MISSING If you lack vprintf function
-# (but have _doprnt).
-# -DDOPRNT_MISSING If you lack _doprnt function.
-# Also need to define
-# -DVPRINTF_MISSING.
-# -DFTIME_MISSING If you lack ftime system call.
-# -DSTRSTR_MISSING If you lack strstr function.
-# -DVALLOC_MISSING If you lack valloc function.
-# -DMKDIR_MISSING If you lack mkdir and
-# rmdir system calls.
-# -DRENAME_MISSING If you lack rename system call.
-# -DFTRUNCATE_MISSING If you lack ftruncate
-# system call.
-# -DV7 On Version 7 Unix (not
-# tested in a long time).
-# -DEMUL_OPEN3 If you lack a 3-argument version
-# of open, and want to emulate it
-# with system calls you do have.
-# -DNO_OPEN3 If you lack the 3-argument open
-# and want to disable the tar -k
-# option instead of emulating open.
-# -DXENIX If you have sys/inode.h
-# and need it 94 to be included.
-
-DEFS = -DSIGTYPE=int -DDIRENT -DSTRSTR_MISSING \
- -DVPRINTF_MISSING -DBSD42
-# Set this to rtapelib.o unless you defined NO_REMOTE,
-# in which case make it empty.
-RTAPELIB = rtapelib.o
-LIBS =
-DEF_AR_FILE = /dev/rmt8
-DEFBLOCKING = 20
-
-CDEBUG = -g
-CFLAGS = $(CDEBUG) -I. -I$(srcdir) $(DEFS) \
- -DDEF_AR_FILE=\"$(DEF_AR_FILE)\" \
- -DDEFBLOCKING=$(DEFBLOCKING)
-LDFLAGS = -g
-
-prefix = /usr/local
-# Prefix for each installed program,
-# normally empty or `g'.
-binprefix =
-
-# The directory to install tar in.
-bindir = $(prefix)/bin
-
-# The directory to install the info files in.
-infodir = $(prefix)/info
-
-#### End of system configuration section. ####
-
-SRCS_C = tar.c create.c extract.c buffer.c \
- getoldopt.c update.c gnu.c mangle.c \
- version.c list.c names.c diffarch.c \
- port.c wildmat.c getopt.c getopt1.c \
- regex.c
-SRCS_Y = getdate.y
-SRCS = $(SRCS_C) $(SRCS_Y)
-OBJS = $(SRCS_C:.c=.o) $(SRCS_Y:.y=.o) $(RTAPELIB)
-AUX = README COPYING ChangeLog Makefile.in \
- makefile.pc configure configure.in \
- tar.texinfo tar.info* texinfo.tex \
- tar.h port.h open3.h getopt.h regex.h \
- rmt.h rmt.c rtapelib.c alloca.c \
- msd_dir.h msd_dir.c tcexparg.c \
- level-0 level-1 backup-specs testpad.c
+# Redis Makefile
+# Copyright (C) 2009 Salvatore Sanfilippo <antirez at gmail dot com>
+# This file is released under the BSD license, see the COPYING file
+#
+# The Makefile composes the final FINAL_CFLAGS and FINAL_LDFLAGS using
+# what is needed for Redis plus the standard CFLAGS and LDFLAGS passed.
+# However when building the dependencies (Jemalloc, Lua, Hiredis, ...)
+# CFLAGS and LDFLAGS are propagated to the dependencies, so to pass
+# flags only to be used when compiling / linking Redis itself REDIS_CFLAGS
+# and REDIS_LDFLAGS are used instead (this is the case of 'make gcov').
+#
+# Dependencies are stored in the Makefile.dep file. To rebuild this file
+# Just use 'make dep', but this is only needed by developers.
+
+release_hdr := $(shell sh -c './mkreleasehdr.sh')
+uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
+OPTIMIZATION?=-O2
+DEPENDENCY_TARGETS=hiredis linenoise lua
+NODEPS:=clean distclean
+
+# Default settings
+STD=-std=c11 -pedantic -DREDIS_STATIC=''
+ifneq (,$(findstring clang,$(CC)))
+ifneq (,$(findstring FreeBSD,$(uname_S)))
+ STD+=-Wno-c11-extensions
+endif
+endif
+WARN=-Wall -W -Wno-missing-field-initializers
+OPT=$(OPTIMIZATION)
+
+PREFIX?=/usr/local
+INSTALL_BIN=$(PREFIX)/bin
+INSTALL=install
+PKG_CONFIG?=pkg-config
+
+# Default allocator defaults to Jemalloc if it's not an ARM
+MALLOC=libc
+ifneq ($(uname_M),armv6l)
+ifneq ($(uname_M),armv7l)
+ifeq ($(uname_S),Linux)
+ MALLOC=jemalloc
+endif
+endif
+endif
+
+# To get ARM stack traces if Redis crashes we need a special C flag.
+ifneq (,$(filter aarch64 armv,$(uname_M)))
+ CFLAGS+=-funwind-tables
+else
+ifneq (,$(findstring armv,$(uname_M)))
+ CFLAGS+=-funwind-tables
+endif
+endif
+
+# Backwards compatibility for selecting an allocator
+ifeq ($(USE_TCMALLOC),yes)
+ MALLOC=tcmalloc
+endif
+
+ifeq ($(USE_TCMALLOC_MINIMAL),yes)
+ MALLOC=tcmalloc_minimal
+endif
+
+ifeq ($(USE_JEMALLOC),yes)
+ MALLOC=jemalloc
+endif
+
+ifeq ($(USE_JEMALLOC),no)
+ MALLOC=libc
+endif
+
+# Override default settings if possible
+-include .make-settings
+
+FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS)
+FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
+FINAL_LIBS=-lm
+DEBUG=-g -ggdb
+
+# Linux ARM needs -latomic at linking time
+ifneq (,$(filter aarch64 armv,$(uname_M)))
+ FINAL_LIBS+=-latomic
+else
+ifneq (,$(findstring armv,$(uname_M)))
+ FINAL_LIBS+=-latomic
+endif
+endif
+
+ifeq ($(uname_S),SunOS)
+ # SunOS
+ ifneq ($(@@),32bit)
+ CFLAGS+= -m64
+ LDFLAGS+= -m64
+ endif
+ DEBUG=-g
+ DEBUG_FLAGS=-g
+ export CFLAGS LDFLAGS DEBUG DEBUG_FLAGS
+ INSTALL=cp -pf
+ FINAL_CFLAGS+= -D__EXTENSIONS__ -D_XPG6
+ FINAL_LIBS+= -ldl -lnsl -lsocket -lresolv -lpthread -lrt
+else
+ifeq ($(uname_S),Darwin)
+ # Darwin
+ FINAL_LIBS+= -ldl
+ OPENSSL_CFLAGS=-I/usr/local/opt/openssl/include
+ OPENSSL_LDFLAGS=-L/usr/local/opt/openssl/lib
+else
+ifeq ($(uname_S),AIX)
+ # AIX
+ FINAL_LDFLAGS+= -Wl,-bexpall
+ FINAL_LIBS+=-ldl -pthread -lcrypt -lbsd
+else
+ifeq ($(uname_S),OpenBSD)
+ # OpenBSD
+ FINAL_LIBS+= -lpthread
+ ifeq ($(USE_BACKTRACE),yes)
+ FINAL_CFLAGS+= -DUSE_BACKTRACE -I/usr/local/include
+ FINAL_LDFLAGS+= -L/usr/local/lib
+ FINAL_LIBS+= -lexecinfo
+ endif
+
+else
+ifeq ($(uname_S),FreeBSD)
+ # FreeBSD
+ FINAL_LIBS+= -lpthread -lexecinfo
+else
+ifeq ($(uname_S),DragonFly)
+ # FreeBSD
+ FINAL_LIBS+= -lpthread -lexecinfo
+else
+ifeq ($(uname_S),OpenBSD)
+ # OpenBSD
+ FINAL_LIBS+= -lpthread -lexecinfo
+else
+ifeq ($(uname_S),NetBSD)
+ # NetBSD
+ FINAL_LIBS+= -lpthread -lexecinfo
+else
+ # All the other OSes (notably Linux)
+ FINAL_LDFLAGS+= -rdynamic
+ FINAL_LIBS+=-ldl -pthread -lrt
+endif
+endif
+endif
+endif
+endif
+endif
+endif
+endif
+# Include paths to dependencies
+FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src
+
+# Determine systemd support and/or build preference (defaulting to auto-detection)
+BUILD_WITH_SYSTEMD=no
+# If 'USE_SYSTEMD' in the environment is neither "no" nor "yes", try to
+# auto-detect libsystemd's presence and link accordingly.
+ifneq ($(USE_SYSTEMD),no)
+ LIBSYSTEMD_PKGCONFIG := $(shell $(PKG_CONFIG) --exists libsystemd && echo $$?)
+# If libsystemd cannot be detected, continue building without support for it
+# (unless a later check tells us otherwise)
+ifeq ($(LIBSYSTEMD_PKGCONFIG),0)
+ BUILD_WITH_SYSTEMD=yes
+endif
+endif
+ifeq ($(USE_SYSTEMD),yes)
+ifneq ($(LIBSYSTEMD_PKGCONFIG),0)
+$(error USE_SYSTEMD is set to "$(USE_SYSTEMD)", but $(PKG_CONFIG) cannot find libsystemd)
+endif
+# Force building with libsystemd
+ BUILD_WITH_SYSTEMD=yes
+endif
+ifeq ($(BUILD_WITH_SYSTEMD),yes)
+ FINAL_LIBS+=$(shell $(PKG_CONFIG) --libs libsystemd)
+ FINAL_CFLAGS+= -DHAVE_LIBSYSTEMD
+endif
+
+ifeq ($(MALLOC),tcmalloc)
+ FINAL_CFLAGS+= -DUSE_TCMALLOC
+ FINAL_LIBS+= -ltcmalloc
+endif
+
+ifeq ($(MALLOC),tcmalloc_minimal)
+ FINAL_CFLAGS+= -DUSE_TCMALLOC
+ FINAL_LIBS+= -ltcmalloc_minimal
+endif
+
+ifeq ($(MALLOC),jemalloc)
+ DEPENDENCY_TARGETS+= jemalloc
+ FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include
+ FINAL_LIBS := ../deps/jemalloc/lib/libjemalloc.a $(FINAL_LIBS)
+endif
+
+ifeq ($(BUILD_TLS),yes)
+ FINAL_CFLAGS+=-DUSE_OPENSSL $(OPENSSL_CFLAGS)
+ FINAL_LDFLAGS+=$(OPENSSL_LDFLAGS)
+ LIBSSL_PKGCONFIG := $(shell $(PKG_CONFIG) --exists libssl && echo $$?)
+ifeq ($(LIBSSL_PKGCONFIG),0)
+ LIBSSL_LIBS=$(shell $(PKG_CONFIG) --libs libssl)
+else
+ LIBSSL_LIBS=-lssl
+endif
+ LIBCRYPTO_PKGCONFIG := $(shell $(PKG_CONFIG) --exists libcrypto && echo $$?)
+ifeq ($(LIBCRYPTO_PKGCONFIG),0)
+ LIBCRYPTO_LIBS=$(shell $(PKG_CONFIG) --libs libcrypto)
+else
+ LIBCRYPTO_LIBS=-lcrypto
+endif
+ FINAL_LIBS += ../deps/hiredis/libhiredis_ssl.a $(LIBSSL_LIBS) $(LIBCRYPTO_LIBS)
+endif
+
+REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
+REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS)
+REDIS_INSTALL=$(QUIET_INSTALL)$(INSTALL)
+
+CCCOLOR="\033[34m"
+LINKCOLOR="\033[34;1m"
+SRCCOLOR="\033[33m"
+BINCOLOR="\033[37;1m"
+MAKECOLOR="\033[32;1m"
+ENDCOLOR="\033[0m"
+
+ifndef V
+QUIET_CC = @printf ' %b %b\n' $(CCCOLOR)CC$(ENDCOLOR) $(SRCCOLOR)$@$(ENDCOLOR) 1>&2;
+QUIET_LINK = @printf ' %b %b\n' $(LINKCOLOR)LINK$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR) 1>&2;
+QUIET_INSTALL = @printf ' %b %b\n' $(LINKCOLOR)INSTALL$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR) 1>&2;
+endif
+
+REDIS_SERVER_NAME=redis-server
+REDIS_SENTINEL_NAME=redis-sentinel
+REDIS_SERVER_OBJ=adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crcspeed.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o redis-check-aof.o geo.o lazyfree.o module.o evict.o expire.o geohash.o geohash_helper.o childinfo.o defrag.o siphash.o rax.o t_stream.o listpack.o localtime.o lolwut.o lolwut5.o lolwut6.o acl.o gopher.o tracking.o connection.o tls.o sha256.o timeout.o setcpuaffinity.o
+REDIS_CLI_NAME=redis-cli
+REDIS_CLI_OBJ=anet.o adlist.o dict.o redis-cli.o zmalloc.o release.o ae.o crcspeed.o crc64.o siphash.o crc16.o
+REDIS_BENCHMARK_NAME=redis-benchmark
+REDIS_BENCHMARK_OBJ=ae.o anet.o redis-benchmark.o adlist.o dict.o zmalloc.o siphash.o
+REDIS_CHECK_RDB_NAME=redis-check-rdb
+REDIS_CHECK_AOF_NAME=redis-check-aof
+
+all: $(REDIS_SERVER_NAME) $(REDIS_SENTINEL_NAME) $(REDIS_CLI_NAME) $(REDIS_BENCHMARK_NAME) $(REDIS_CHECK_RDB_NAME) $(REDIS_CHECK_AOF_NAME)
+ @echo ""
+ @echo "Hint: It's a good idea to run 'make test' ;)"
+ @echo ""
+
+Makefile.dep:
+ -$(REDIS_CC) -MM *.c > Makefile.dep 2> /dev/null || true
+
+ifeq (0, $(words $(findstring $(MAKECMDGOALS), $(NODEPS))))
+-include Makefile.dep
+endif
.PHONY: all
-all: tar rmt tar.info
-tar: $(OBJS)
- $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
+persist-settings: distclean
+ echo STD=$(STD) >> .make-settings
+ echo WARN=$(WARN) >> .make-settings
+ echo OPT=$(OPT) >> .make-settings
+ echo MALLOC=$(MALLOC) >> .make-settings
+ echo BUILD_TLS=$(BUILD_TLS) >> .make-settings
+ echo USE_SYSTEMD=$(USE_SYSTEMD) >> .make-settings
<