brintos

brintos / linux-shallow public Read only

0
0
Text · 1.9 KiB · b5878be Raw
87 lines · plain
1# SPDX-License-Identifier: GPL-2.0-only2 3ifeq ($(srctree),)4  srctree	:= $(patsubst %/,%,$(dir $(CURDIR)))5  srctree	:= $(patsubst %/,%,$(dir $(srctree)))6  srctree	:= $(patsubst %/,%,$(dir $(srctree)))7endif8 9include $(srctree)/tools/scripts/Makefile.include10 11# O is an alias for OUTPUT12OUTPUT          := $(O)13 14ifeq ($(OUTPUT),)15  OUTPUT        := $(CURDIR)16else17  # subdir is used by the ../Makefile in $(call descend,)18  ifneq ($(subdir),)19    OUTPUT        := $(OUTPUT)/$(subdir)20  endif21endif22 23ifneq ($(patsubst %/,,$(lastword $(OUTPUT))),)24  OUTPUT        := $(OUTPUT)/25endif26 27RTLA		:= $(OUTPUT)rtla28RTLA_IN		:= $(RTLA)-in.o29 30VERSION		:= $(shell sh -c "make -sC ../../.. kernelversion | grep -v make")31DOCSRC		:= ../../../Documentation/tools/rtla/32 33FEATURE_TESTS	:= libtraceevent34FEATURE_TESTS	+= libtracefs35FEATURE_DISPLAY	:= libtraceevent36FEATURE_DISPLAY	+= libtracefs37 38ifeq ($(V),1)39  Q		=40else41  Q		= @42endif43 44all: $(RTLA)45 46include $(srctree)/tools/build/Makefile.include47include Makefile.rtla48 49# check for dependencies only on required targets50NON_CONFIG_TARGETS := clean install tarball doc doc_clean doc_install51 52config		:= 153ifdef MAKECMDGOALS54ifeq ($(filter-out $(NON_CONFIG_TARGETS),$(MAKECMDGOALS)),)55 config		:= 056endif57endif58 59ifeq ($(config),1)60  include $(srctree)/tools/build/Makefile.feature61  include Makefile.config62endif63 64CFLAGS		+= $(INCLUDES) $(LIB_INCLUDES)65 66export CFLAGS OUTPUT srctree67 68$(RTLA): $(RTLA_IN)69	$(QUIET_LINK)$(CC) $(LDFLAGS) -o $(RTLA) $(RTLA_IN) $(EXTLIBS)70 71static: $(RTLA_IN)72	$(eval LDFLAGS += -static)73	$(QUIET_LINK)$(CC) -static $(LDFLAGS) -o $(RTLA)-static $(RTLA_IN)  $(EXTLIBS)74 75rtla.%: fixdep FORCE76	make -f $(srctree)/tools/build/Makefile.build dir=. $@77 78$(RTLA_IN): fixdep FORCE79	make $(build)=rtla80 81clean: doc_clean fixdep-clean82	$(call QUIET_CLEAN, rtla)83	$(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete84	$(Q)rm -f rtla rtla-static fixdep FEATURE-DUMP rtla-*85	$(Q)rm -rf feature86.PHONY: FORCE clean87