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