2020-01-11 00:03:56 +08:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
# Makefile for bootconfig command
|
2020-03-03 19:24:40 +08:00
|
|
|
include ../scripts/Makefile.include
|
2020-01-11 00:03:56 +08:00
|
|
|
|
|
|
|
bindir ?= /usr/bin
|
|
|
|
|
2020-03-03 19:24:40 +08:00
|
|
|
ifeq ($(srctree),)
|
|
|
|
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
|
|
|
|
srctree := $(patsubst %/,%,$(dir $(srctree)))
|
|
|
|
endif
|
2020-01-11 00:03:56 +08:00
|
|
|
|
2020-03-03 19:24:40 +08:00
|
|
|
LIBSRC = $(srctree)/lib/bootconfig.c $(srctree)/include/linux/bootconfig.h
|
|
|
|
CFLAGS = -Wall -g -I$(CURDIR)/include
|
2020-01-11 00:03:56 +08:00
|
|
|
|
2020-03-03 19:24:40 +08:00
|
|
|
ALL_TARGETS := bootconfig
|
|
|
|
ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
|
2020-01-11 00:03:56 +08:00
|
|
|
|
2021-09-17 18:02:32 +08:00
|
|
|
all: $(ALL_PROGRAMS) test
|
2020-03-03 19:24:40 +08:00
|
|
|
|
2021-09-17 18:03:16 +08:00
|
|
|
$(OUTPUT)bootconfig: main.c include/linux/bootconfig.h $(LIBSRC)
|
2020-01-11 00:03:56 +08:00
|
|
|
$(CC) $(filter %.c,$^) $(CFLAGS) -o $@
|
|
|
|
|
2020-03-03 19:24:40 +08:00
|
|
|
test: $(ALL_PROGRAMS) test-bootconfig.sh
|
|
|
|
./test-bootconfig.sh $(OUTPUT)
|
2020-01-11 00:03:56 +08:00
|
|
|
|
2020-03-03 19:24:40 +08:00
|
|
|
install: $(ALL_PROGRAMS)
|
|
|
|
install $(OUTPUT)bootconfig $(DESTDIR)$(bindir)
|
2020-01-11 00:04:07 +08:00
|
|
|
|
2020-01-11 00:03:56 +08:00
|
|
|
clean:
|
2020-03-03 19:24:40 +08:00
|
|
|
$(RM) -f $(OUTPUT)*.o $(ALL_PROGRAMS)
|