1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0 2*4882a593Smuzhiyun# Makefile for bootconfig command 3*4882a593Smuzhiyuninclude ../scripts/Makefile.include 4*4882a593Smuzhiyun 5*4882a593Smuzhiyunbindir ?= /usr/bin 6*4882a593Smuzhiyun 7*4882a593Smuzhiyunifeq ($(srctree),) 8*4882a593Smuzhiyunsrctree := $(patsubst %/,%,$(dir $(CURDIR))) 9*4882a593Smuzhiyunsrctree := $(patsubst %/,%,$(dir $(srctree))) 10*4882a593Smuzhiyunendif 11*4882a593Smuzhiyun 12*4882a593SmuzhiyunLIBSRC = $(srctree)/lib/bootconfig.c $(srctree)/include/linux/bootconfig.h 13*4882a593SmuzhiyunCFLAGS = -Wall -g -I$(CURDIR)/include 14*4882a593Smuzhiyun 15*4882a593SmuzhiyunALL_TARGETS := bootconfig 16*4882a593SmuzhiyunALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS)) 17*4882a593Smuzhiyun 18*4882a593Smuzhiyunall: $(ALL_PROGRAMS) 19*4882a593Smuzhiyun 20*4882a593Smuzhiyun$(OUTPUT)bootconfig: main.c $(LIBSRC) 21*4882a593Smuzhiyun $(CC) $(filter %.c,$^) $(CFLAGS) -o $@ 22*4882a593Smuzhiyun 23*4882a593Smuzhiyuntest: $(ALL_PROGRAMS) test-bootconfig.sh 24*4882a593Smuzhiyun ./test-bootconfig.sh $(OUTPUT) 25*4882a593Smuzhiyun 26*4882a593Smuzhiyuninstall: $(ALL_PROGRAMS) 27*4882a593Smuzhiyun install $(OUTPUT)bootconfig $(DESTDIR)$(bindir) 28*4882a593Smuzhiyun 29*4882a593Smuzhiyunclean: 30*4882a593Smuzhiyun $(RM) -f $(OUTPUT)*.o $(ALL_PROGRAMS) 31