~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/verification/rv/Makefile

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /tools/verification/rv/Makefile (Version linux-6.12-rc7) and /tools/verification/rv/Makefile (Version linux-6.3.13)


  1 # SPDX-License-Identifier: GPL-2.0-only        !!   1 NAME    :=      rv
  2                                                !!   2 # Follow the kernel version
  3 ifeq ($(srctree),)                             !!   3 VERSION :=      $(shell cat VERSION 2> /dev/null || make -sC ../../.. kernelversion | grep -v make)
  4   srctree       := $(patsubst %/,%,$(dir $(CUR !!   4 
  5   srctree       := $(patsubst %/,%,$(dir $(src !!   5 # From libtracefs:
  6   srctree       := $(patsubst %/,%,$(dir $(src !!   6 # Makefiles suck: This macro sets a default value of $(2) for the
  7 endif                                          !!   7 # variable named by $(1), unless the variable has been set by
  8                                                !!   8 # environment or command line. This is necessary for CC and AR
  9 include $(srctree)/tools/scripts/Makefile.incl !!   9 # because make sets default values, so the simpler ?= approach
 10                                                !!  10 # won't work as expected.
 11 # O is an alias for OUTPUT                     !!  11 define allow-override
 12 OUTPUT          := $(O)                        !!  12   $(if $(or $(findstring environment,$(origin $(1))),\
 13                                                !!  13             $(findstring command line,$(origin $(1)))),,\
 14 ifeq ($(OUTPUT),)                              !!  14     $(eval $(1) = $(2)))
 15   OUTPUT       := $(CURDIR)/                   !!  15 endef
 16 else                                           !!  16 
 17   # subdir is used by the ../Makefile in $(cal !!  17 # Allow setting CC and AR, or setting CROSS_COMPILE as a prefix.
 18   ifneq ($(subdir),)                           !!  18 $(call allow-override,CC,$(CROSS_COMPILE)gcc)
 19     OUTPUT        := $(OUTPUT)/$(subdir)       !!  19 $(call allow-override,AR,$(CROSS_COMPILE)ar)
 20   endif                                        !!  20 $(call allow-override,STRIP,$(CROSS_COMPILE)strip)
 21 endif                                          !!  21 $(call allow-override,PKG_CONFIG,pkg-config)
 22                                                !!  22 $(call allow-override,LD_SO_CONF_PATH,/etc/ld.so.conf.d/)
 23 ifneq ($(patsubst %/,,$(lastword $(OUTPUT))),) !!  23 $(call allow-override,LDCONFIG,ldconfig)
 24   OUTPUT := $(OUTPUT)/                         !!  24 
 25 endif                                          !!  25 INSTALL =       install
 26                                                !!  26 MKDIR   =       mkdir
 27 RV              := $(OUTPUT)rv                 !!  27 FOPTS   :=      -flto=auto -ffat-lto-objects -fexceptions -fstack-protector-strong \
 28 RV_IN           := $(RV)-in.o                  !!  28                 -fasynchronous-unwind-tables -fstack-clash-protection
 29                                                !!  29 WOPTS   :=      -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -Wno-maybe-uninitialized
 30 VERSION         := $(shell sh -c "make -sC ../ !!  30 
 31 DOCSRC          := ../../../Documentation/tool !!  31 TRACEFS_HEADERS := $$($(PKG_CONFIG) --cflags libtracefs)
 32                                                !!  32 
 33 FEATURE_TESTS   := libtraceevent               !!  33 CFLAGS  :=      -O -g -DVERSION=\"$(VERSION)\" $(FOPTS) $(MOPTS) $(WOPTS) $(TRACEFS_HEADERS) $(EXTRA_CFLAGS) -I include
 34 FEATURE_TESTS   += libtracefs                  !!  34 LDFLAGS :=      -ggdb $(EXTRA_LDFLAGS)
 35 FEATURE_DISPLAY := libtraceevent               !!  35 LIBS    :=      $$($(PKG_CONFIG) --libs libtracefs)
 36 FEATURE_DISPLAY += libtracefs                  !!  36 
 37                                                !!  37 SRC     :=      $(wildcard src/*.c)
 38 ifeq ($(V),1)                                  !!  38 HDR     :=      $(wildcard src/*.h)
 39   Q             =                              !!  39 OBJ     :=      $(SRC:.c=.o)
                                                   >>  40 DIRS    :=      src
                                                   >>  41 FILES   :=      Makefile README.txt
                                                   >>  42 CEXT    :=      bz2
                                                   >>  43 TARBALL :=      $(NAME)-$(VERSION).tar.$(CEXT)
                                                   >>  44 TAROPTS :=      -cvjf $(TARBALL)
                                                   >>  45 BINDIR  :=      /usr/bin
                                                   >>  46 DATADIR :=      /usr/share
                                                   >>  47 DOCDIR  :=      $(DATADIR)/doc
                                                   >>  48 MANDIR  :=      $(DATADIR)/man
                                                   >>  49 LICDIR  :=      $(DATADIR)/licenses
                                                   >>  50 SRCTREE :=      $(or $(BUILD_SRC),$(CURDIR))
                                                   >>  51 
                                                   >>  52 # If running from the tarball, man pages are stored in the Documentation
                                                   >>  53 # dir. If running from the kernel source, man pages are stored in
                                                   >>  54 # Documentation/tools/rv/.
                                                   >>  55 ifneq ($(wildcard Documentation/.*),)
                                                   >>  56 DOCSRC  =       Documentation/
 40 else                                               57 else
 41   Q             = @                            !!  58 DOCSRC  =       $(SRCTREE)/../../../Documentation/tools/rv/
 42 endif                                          << 
 43                                                << 
 44 all: $(RV)                                     << 
 45                                                << 
 46 include $(srctree)/tools/build/Makefile.includ << 
 47 include Makefile.rv                            << 
 48                                                << 
 49 # check for dependencies only on required targ << 
 50 NON_CONFIG_TARGETS := clean install doc doc_cl << 
 51                                                << 
 52 config          := 1                           << 
 53 ifdef MAKECMDGOALS                             << 
 54   ifeq ($(filter-out $(NON_CONFIG_TARGETS),$(M << 
 55   config        := 0                           << 
 56 endif                                              59 endif
 57 endif                                          << 
 58                                                << 
 59 ifeq ($(config),1)                             << 
 60   include $(srctree)/tools/build/Makefile.feat << 
 61   include Makefile.config                      << 
 62 endif                                          << 
 63                                                << 
 64 CFLAGS          += $(INCLUDES) $(LIB_INCLUDES) << 
 65                                                << 
 66 export CFLAGS OUTPUT srctree                   << 
 67                                                << 
 68 $(RV): $(RV_IN)                                << 
 69         $(QUIET_LINK)$(CC) $(LDFLAGS) -o $(RV) << 
 70                                                    60 
 71 static: $(RV_IN)                               !!  61 LIBTRACEEVENT_MIN_VERSION = 1.5
 72         $(eval LDFLAGS += -static)             !!  62 LIBTRACEFS_MIN_VERSION = 1.3
 73         $(QUIET_LINK)$(CC) $(LDFLAGS) -o $(RV) << 
 74                                                    63 
 75 rv.%: fixdep FORCE                             !!  64 .PHONY: all warnings show_warnings
 76         make -f $(srctree)/tools/build/Makefil !!  65 all:    warnings rv
 77                                                    66 
 78 $(RV_IN): fixdep FORCE                         !!  67 TEST_LIBTRACEEVENT = $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEEVENT_MIN_VERSION) libtraceevent > /dev/null 2>&1 || echo n")
 79         make $(build)=rv                       !!  68 ifeq ("$(TEST_LIBTRACEEVENT)", "n")
                                                   >>  69 WARNINGS = show_warnings
                                                   >>  70 MISSING_LIBS += echo "**   libtraceevent version $(LIBTRACEEVENT_MIN_VERSION) or higher";
                                                   >>  71 MISSING_PACKAGES += "libtraceevent-devel"
                                                   >>  72 MISSING_SOURCE += echo "**  https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/ ";
                                                   >>  73 endif
                                                   >>  74 
                                                   >>  75 TEST_LIBTRACEFS = $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEFS_MIN_VERSION) libtracefs > /dev/null 2>&1 || echo n")
                                                   >>  76 ifeq ("$(TEST_LIBTRACEFS)", "n")
                                                   >>  77 WARNINGS = show_warnings
                                                   >>  78 MISSING_LIBS += echo "**   libtracefs version $(LIBTRACEFS_MIN_VERSION) or higher";
                                                   >>  79 MISSING_PACKAGES += "libtracefs-devel"
                                                   >>  80 MISSING_SOURCE += echo "**  https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/ ";
                                                   >>  81 endif
                                                   >>  82 
                                                   >>  83 define show_dependencies
                                                   >>  84         @echo "********************************************";                           \
                                                   >>  85         echo "** NOTICE: Failed build dependencies";                                    \
                                                   >>  86         echo "**";                                                                      \
                                                   >>  87         echo "** Required Libraries:";                                                  \
                                                   >>  88         $(MISSING_LIBS)                                                                 \
                                                   >>  89         echo "**";                                                                      \
                                                   >>  90         echo "** Consider installing the latest libtracefs from your";                  \
                                                   >>  91         echo "** distribution, e.g., 'dnf install $(MISSING_PACKAGES)' on Fedora,";     \
                                                   >>  92         echo "** or from source:";                                                      \
                                                   >>  93         echo "**";                                                                      \
                                                   >>  94         $(MISSING_SOURCE)                                                               \
                                                   >>  95         echo "**";                                                                      \
                                                   >>  96         echo "********************************************"
                                                   >>  97 endef
                                                   >>  98 
                                                   >>  99 show_warnings:
                                                   >> 100         $(call show_dependencies);
                                                   >> 101 
                                                   >> 102 ifneq ("$(WARNINGS)", "")
                                                   >> 103 ERROR_OUT = $(error Please add the necessary dependencies)
                                                   >> 104 
                                                   >> 105 warnings: $(WARNINGS)
                                                   >> 106         $(ERROR_OUT)
                                                   >> 107 endif
                                                   >> 108 
                                                   >> 109 rv: $(OBJ)
                                                   >> 110         $(CC) -o rv $(LDFLAGS) $(OBJ) $(LIBS)
                                                   >> 111 
                                                   >> 112 .PHONY: install
                                                   >> 113 install: doc_install
                                                   >> 114         $(MKDIR) -p $(DESTDIR)$(BINDIR)
                                                   >> 115         $(INSTALL) rv -m 755 $(DESTDIR)$(BINDIR)
                                                   >> 116         $(STRIP) $(DESTDIR)$(BINDIR)/rv
                                                   >> 117 
                                                   >> 118 .PHONY: clean tarball
                                                   >> 119 clean: doc_clean
                                                   >> 120         @test ! -f rv || rm rv
                                                   >> 121         @test ! -f $(TARBALL) || rm -f $(TARBALL)
                                                   >> 122         @rm -rf *~ $(OBJ) *.tar.$(CEXT)
                                                   >> 123 
                                                   >> 124 tarball: clean
                                                   >> 125         rm -rf $(NAME)-$(VERSION) && mkdir $(NAME)-$(VERSION)
                                                   >> 126         echo $(VERSION) > $(NAME)-$(VERSION)/VERSION
                                                   >> 127         cp -r $(DIRS) $(FILES) $(NAME)-$(VERSION)
                                                   >> 128         mkdir $(NAME)-$(VERSION)/Documentation/
                                                   >> 129         cp -rp $(SRCTREE)/../../../Documentation/tools/rv/* $(NAME)-$(VERSION)/Documentation/
                                                   >> 130         tar $(TAROPTS) --exclude='*~' $(NAME)-$(VERSION)
                                                   >> 131         rm -rf $(NAME)-$(VERSION)
                                                   >> 132 
                                                   >> 133 .PHONY: doc doc_clean doc_install
                                                   >> 134 doc:
                                                   >> 135         $(MAKE) -C $(DOCSRC)
 80                                                   136 
 81 clean: doc_clean fixdep-clean                  !! 137 doc_clean:
 82         $(call QUIET_CLEAN, rv)                !! 138         $(MAKE) -C $(DOCSRC) clean
 83         $(Q)find . -name '*.o' -delete -o -nam << 
 84         $(Q)rm -f rv rv-static fixdep FEATURE- << 
 85         $(Q)rm -rf feature                     << 
 86                                                   139 
 87 .PHONY: FORCE clean                            !! 140 doc_install:
                                                   >> 141         $(MAKE) -C $(DOCSRC) install
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php