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