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

TOMOYO Linux Cross Reference
Linux/tools/lib/subcmd/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/lib/subcmd/Makefile (Version linux-6.12-rc7) and /tools/lib/subcmd/Makefile (Version linux-6.5.13)


  1 # SPDX-License-Identifier: GPL-2.0                  1 # SPDX-License-Identifier: GPL-2.0
  2 include ../../scripts/Makefile.include              2 include ../../scripts/Makefile.include
  3 include ../../scripts/utilities.mak                 3 include ../../scripts/utilities.mak             # QUIET_CLEAN
  4                                                     4 
  5 ifeq ($(srctree),)                                  5 ifeq ($(srctree),)
  6 srctree := $(patsubst %/,%,$(dir $(CURDIR)))        6 srctree := $(patsubst %/,%,$(dir $(CURDIR)))
  7 srctree := $(patsubst %/,%,$(dir $(srctree)))       7 srctree := $(patsubst %/,%,$(dir $(srctree)))
  8 srctree := $(patsubst %/,%,$(dir $(srctree)))       8 srctree := $(patsubst %/,%,$(dir $(srctree)))
  9 #$(info Determined 'srctree' to be $(srctree))      9 #$(info Determined 'srctree' to be $(srctree))
 10 endif                                              10 endif
 11                                                    11 
 12 CC ?= $(CROSS_COMPILE)gcc                          12 CC ?= $(CROSS_COMPILE)gcc
 13 LD ?= $(CROSS_COMPILE)ld                           13 LD ?= $(CROSS_COMPILE)ld
 14 AR ?= $(CROSS_COMPILE)ar                           14 AR ?= $(CROSS_COMPILE)ar
 15                                                    15 
 16 RM = rm -f                                         16 RM = rm -f
 17                                                    17 
 18 MAKEFLAGS += --no-print-directory                  18 MAKEFLAGS += --no-print-directory
 19                                                    19 
 20 INSTALL = install                                  20 INSTALL = install
 21                                                    21 
 22 # Use DESTDIR for installing into a different      22 # Use DESTDIR for installing into a different root directory.
 23 # This is useful for building a package. The p     23 # This is useful for building a package. The program will be
 24 # installed in this directory as if it was the     24 # installed in this directory as if it was the root directory.
 25 # Then the build tool can move it later.           25 # Then the build tool can move it later.
 26 DESTDIR ?=                                         26 DESTDIR ?=
 27 DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))'          27 DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))'
 28                                                    28 
 29 LIBFILE = $(OUTPUT)libsubcmd.a                     29 LIBFILE = $(OUTPUT)libsubcmd.a
 30                                                    30 
 31 CFLAGS := -ggdb3 -Wall -Wextra -std=gnu99 -fPI     31 CFLAGS := -ggdb3 -Wall -Wextra -std=gnu99 -fPIC
 32                                                    32 
 33 ifeq ($(DEBUG),0)                                  33 ifeq ($(DEBUG),0)
 34   ifeq ($(feature-fortify-source), 1)              34   ifeq ($(feature-fortify-source), 1)
 35     CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOU     35     CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
 36   endif                                            36   endif
 37 endif                                              37 endif
 38                                                    38 
 39 ifeq ($(DEBUG),1)                                  39 ifeq ($(DEBUG),1)
 40   CFLAGS += -O0                                    40   CFLAGS += -O0
 41 else                                           !!  41 else ifeq ($(CC_NO_CLANG), 0)
 42   CFLAGS += -O3                                    42   CFLAGS += -O3
                                                   >>  43 else
                                                   >>  44   CFLAGS += -O6
 43 endif                                              45 endif
 44                                                    46 
 45 # Treat warnings as errors unless directed not     47 # Treat warnings as errors unless directed not to
 46 ifneq ($(WERROR),0)                                48 ifneq ($(WERROR),0)
 47   CFLAGS += -Werror                                49   CFLAGS += -Werror
 48 endif                                              50 endif
 49                                                    51 
 50 CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET     52 CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
 51                                                    53 
 52 CFLAGS += -I$(srctree)/tools/include/              54 CFLAGS += -I$(srctree)/tools/include/
 53                                                    55 
 54 CFLAGS += $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)        56 CFLAGS += $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
 55                                                    57 
 56 SUBCMD_IN := $(OUTPUT)libsubcmd-in.o               58 SUBCMD_IN := $(OUTPUT)libsubcmd-in.o
 57                                                    59 
 58 ifeq ($(LP64), 1)                                  60 ifeq ($(LP64), 1)
 59   libdir_relative = lib64                          61   libdir_relative = lib64
 60 else                                               62 else
 61   libdir_relative = lib                            63   libdir_relative = lib
 62 endif                                              64 endif
 63                                                    65 
 64 prefix ?=                                          66 prefix ?=
 65 libdir = $(prefix)/$(libdir_relative)              67 libdir = $(prefix)/$(libdir_relative)
 66                                                    68 
 67 # Shell quotes                                     69 # Shell quotes
 68 libdir_SQ = $(subst ','\'',$(libdir))              70 libdir_SQ = $(subst ','\'',$(libdir))
 69                                                    71 
 70 all:                                               72 all:
 71                                                    73 
 72 export srctree OUTPUT CC LD CFLAGS V               74 export srctree OUTPUT CC LD CFLAGS V
 73 include $(srctree)/tools/build/Makefile.includ     75 include $(srctree)/tools/build/Makefile.include
 74                                                    76 
 75 all: fixdep $(LIBFILE)                             77 all: fixdep $(LIBFILE)
 76                                                    78 
 77 $(SUBCMD_IN): fixdep FORCE                     !!  79 $(SUBCMD_IN): FORCE
 78         @$(MAKE) $(build)=libsubcmd                80         @$(MAKE) $(build)=libsubcmd
 79                                                    81 
 80 $(LIBFILE): $(SUBCMD_IN)                           82 $(LIBFILE): $(SUBCMD_IN)
 81         $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(     83         $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(SUBCMD_IN)
 82                                                    84 
 83 define do_install_mkdir                            85 define do_install_mkdir
 84         if [ ! -d '$(DESTDIR_SQ)$1' ]; then        86         if [ ! -d '$(DESTDIR_SQ)$1' ]; then             \
 85                 $(INSTALL) -d -m 755 '$(DESTDI     87                 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$1'; \
 86         fi                                         88         fi
 87 endef                                              89 endef
 88                                                    90 
 89 define do_install                                  91 define do_install
 90         if [ ! -d '$2' ]; then             \       92         if [ ! -d '$2' ]; then             \
 91                 $(INSTALL) -d -m 755 '$2'; \       93                 $(INSTALL) -d -m 755 '$2'; \
 92         fi;                                        94         fi;                                             \
 93         $(INSTALL) $1 $(if $3,-m $3,) '$2'         95         $(INSTALL) $1 $(if $3,-m $3,) '$2'
 94 endef                                              96 endef
 95                                                    97 
 96 install_lib: $(LIBFILE)                            98 install_lib: $(LIBFILE)
 97         $(call QUIET_INSTALL, $(LIBFILE)) \        99         $(call QUIET_INSTALL, $(LIBFILE)) \
 98                 $(call do_install_mkdir,$(libd    100                 $(call do_install_mkdir,$(libdir_SQ)); \
 99                 cp -fpR $(LIBFILE) $(DESTDIR)$    101                 cp -fpR $(LIBFILE) $(DESTDIR)$(libdir_SQ)
100                                                   102 
101 HDRS := exec-cmd.h help.h pager.h parse-option    103 HDRS := exec-cmd.h help.h pager.h parse-options.h run-command.h
102 INSTALL_HDRS_PFX := $(DESTDIR)$(prefix)/includ    104 INSTALL_HDRS_PFX := $(DESTDIR)$(prefix)/include/subcmd
103 INSTALL_HDRS := $(addprefix $(INSTALL_HDRS_PFX    105 INSTALL_HDRS := $(addprefix $(INSTALL_HDRS_PFX)/, $(HDRS))
104                                                   106 
105 $(INSTALL_HDRS): $(INSTALL_HDRS_PFX)/%.h: %.h     107 $(INSTALL_HDRS): $(INSTALL_HDRS_PFX)/%.h: %.h
106         $(call QUIET_INSTALL, $@) \               108         $(call QUIET_INSTALL, $@) \
107                 $(call do_install,$<,$(INSTALL    109                 $(call do_install,$<,$(INSTALL_HDRS_PFX)/,644)
108                                                   110 
109 install_headers: $(INSTALL_HDRS)                  111 install_headers: $(INSTALL_HDRS)
110         $(call QUIET_INSTALL, libsubcmd_header    112         $(call QUIET_INSTALL, libsubcmd_headers)
111                                                   113 
112 install: install_lib install_headers              114 install: install_lib install_headers
113                                                   115 
114 clean:                                            116 clean:
115         $(call QUIET_CLEAN, libsubcmd) $(RM) $    117         $(call QUIET_CLEAN, libsubcmd) $(RM) $(LIBFILE); \
116         find $(or $(OUTPUT),.) -name \*.o -or     118         find $(or $(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM)
117                                                   119 
118 FORCE:                                            120 FORCE:
119                                                   121 
120 .PHONY: clean FORCE                               122 .PHONY: clean FORCE
                                                      

~ [ 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