xref: /openbmc/linux/tools/bootconfig/Makefile (revision 03ab8e6297acd1bc0eedaa050e2a1635c576fd11)
1950313ebSMasami Hiramatsu# SPDX-License-Identifier: GPL-2.0
2950313ebSMasami Hiramatsu# Makefile for bootconfig command
3306b69dcSMasami Hiramatsuinclude ../scripts/Makefile.include
4950313ebSMasami Hiramatsu
5950313ebSMasami Hiramatsubindir ?= /usr/bin
6950313ebSMasami Hiramatsu
7306b69dcSMasami Hiramatsuifeq ($(srctree),)
8306b69dcSMasami Hiramatsusrctree := $(patsubst %/,%,$(dir $(CURDIR)))
9306b69dcSMasami Hiramatsusrctree := $(patsubst %/,%,$(dir $(srctree)))
10306b69dcSMasami Hiramatsuendif
11950313ebSMasami Hiramatsu
12306b69dcSMasami HiramatsuLIBSRC = $(srctree)/lib/bootconfig.c $(srctree)/include/linux/bootconfig.h
13306b69dcSMasami HiramatsuCFLAGS = -Wall -g -I$(CURDIR)/include
14950313ebSMasami Hiramatsu
15306b69dcSMasami HiramatsuALL_TARGETS := bootconfig
16306b69dcSMasami HiramatsuALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
17950313ebSMasami Hiramatsu
18f30f00ccSMasami Hiramatsuall: $(ALL_PROGRAMS) test
19306b69dcSMasami Hiramatsu
20*4ee1b4caSMasami Hiramatsu$(OUTPUT)bootconfig: main.c include/linux/bootconfig.h $(LIBSRC)
21950313ebSMasami Hiramatsu	$(CC) $(filter %.c,$^) $(CFLAGS) -o $@
22950313ebSMasami Hiramatsu
23306b69dcSMasami Hiramatsutest: $(ALL_PROGRAMS) test-bootconfig.sh
24306b69dcSMasami Hiramatsu	./test-bootconfig.sh $(OUTPUT)
25950313ebSMasami Hiramatsu
26306b69dcSMasami Hiramatsuinstall: $(ALL_PROGRAMS)
27306b69dcSMasami Hiramatsu	install $(OUTPUT)bootconfig $(DESTDIR)$(bindir)
28081c6536SMasami Hiramatsu
29950313ebSMasami Hiramatsuclean:
30306b69dcSMasami Hiramatsu	$(RM) -f $(OUTPUT)*.o $(ALL_PROGRAMS)
31