1 # SPDX-License-Identifier: GPL-2.0 1 # SPDX-License-Identifier: GPL-2.0 2 # Makefile for bootconfig command 2 # Makefile for bootconfig command 3 include ../scripts/Makefile.include 3 include ../scripts/Makefile.include 4 4 5 bindir ?= /usr/bin 5 bindir ?= /usr/bin 6 6 7 ifeq ($(srctree),) 7 ifeq ($(srctree),) 8 srctree := $(patsubst %/,%,$(dir $(CURDIR))) 8 srctree := $(patsubst %/,%,$(dir $(CURDIR))) 9 srctree := $(patsubst %/,%,$(dir $(srctree))) 9 srctree := $(patsubst %/,%,$(dir $(srctree))) 10 endif 10 endif 11 11 12 LIBSRC = $(srctree)/lib/bootconfig.c $(srctree 12 LIBSRC = $(srctree)/lib/bootconfig.c $(srctree)/include/linux/bootconfig.h 13 CFLAGS = -Wall -g -I$(CURDIR)/include 13 CFLAGS = -Wall -g -I$(CURDIR)/include 14 14 15 ALL_TARGETS := bootconfig 15 ALL_TARGETS := bootconfig 16 ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_ 16 ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS)) 17 17 18 all: $(ALL_PROGRAMS) test !! 18 all: $(ALL_PROGRAMS) 19 19 20 $(OUTPUT)bootconfig: main.c include/linux/boot !! 20 $(OUTPUT)bootconfig: main.c $(LIBSRC) 21 $(CC) $(filter %.c,$^) $(CFLAGS) -o $@ 21 $(CC) $(filter %.c,$^) $(CFLAGS) -o $@ 22 22 23 test: $(ALL_PROGRAMS) test-bootconfig.sh 23 test: $(ALL_PROGRAMS) test-bootconfig.sh 24 ./test-bootconfig.sh $(OUTPUT) 24 ./test-bootconfig.sh $(OUTPUT) 25 25 26 install: $(ALL_PROGRAMS) 26 install: $(ALL_PROGRAMS) 27 install $(OUTPUT)bootconfig $(DESTDIR) 27 install $(OUTPUT)bootconfig $(DESTDIR)$(bindir) 28 28 29 clean: 29 clean: 30 $(RM) -f $(OUTPUT)*.o $(ALL_PROGRAMS) 30 $(RM) -f $(OUTPUT)*.o $(ALL_PROGRAMS)
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.