blob: da5975775337e985b93d897752ec539720b2123a [file] [log] [blame]
Masami Hiramatsu950313e2020-01-11 01:03:56 +09001# SPDX-License-Identifier: GPL-2.0
2# Makefile for bootconfig command
Masami Hiramatsu306b69d2020-03-03 20:24:40 +09003include ../scripts/Makefile.include
Masami Hiramatsu950313e2020-01-11 01:03:56 +09004
5bindir ?= /usr/bin
6
Masami Hiramatsu306b69d2020-03-03 20:24:40 +09007ifeq ($(srctree),)
8srctree := $(patsubst %/,%,$(dir $(CURDIR)))
9srctree := $(patsubst %/,%,$(dir $(srctree)))
10endif
Masami Hiramatsu950313e2020-01-11 01:03:56 +090011
Masami Hiramatsu306b69d2020-03-03 20:24:40 +090012LIBSRC = $(srctree)/lib/bootconfig.c $(srctree)/include/linux/bootconfig.h
13CFLAGS = -Wall -g -I$(CURDIR)/include
Masami Hiramatsu950313e2020-01-11 01:03:56 +090014
Masami Hiramatsu306b69d2020-03-03 20:24:40 +090015ALL_TARGETS := bootconfig
16ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
Masami Hiramatsu950313e2020-01-11 01:03:56 +090017
Masami Hiramatsu306b69d2020-03-03 20:24:40 +090018all: $(ALL_PROGRAMS)
19
20$(OUTPUT)bootconfig: main.c $(LIBSRC)
Masami Hiramatsu950313e2020-01-11 01:03:56 +090021 $(CC) $(filter %.c,$^) $(CFLAGS) -o $@
22
Masami Hiramatsu306b69d2020-03-03 20:24:40 +090023test: $(ALL_PROGRAMS) test-bootconfig.sh
24 ./test-bootconfig.sh $(OUTPUT)
Masami Hiramatsu950313e2020-01-11 01:03:56 +090025
Masami Hiramatsu306b69d2020-03-03 20:24:40 +090026install: $(ALL_PROGRAMS)
27 install $(OUTPUT)bootconfig $(DESTDIR)$(bindir)
Masami Hiramatsu081c6532020-01-11 01:04:07 +090028
Masami Hiramatsu950313e2020-01-11 01:03:56 +090029clean:
Masami Hiramatsu306b69d2020-03-03 20:24:40 +090030 $(RM) -f $(OUTPUT)*.o $(ALL_PROGRAMS)