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
|
|
|
|
2020-03-03 19:24:40 +08:00
|
|
|
all: $(ALL_PROGRAMS)
|
|
|
|
|
|
|
|
$(OUTPUT)bootconfig: main.c $(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)
|