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