Blame view

tools/bootconfig/Makefile 736 Bytes
950313ebf   Masami Hiramatsu   tools: bootconfig...
1
2
  # SPDX-License-Identifier: GPL-2.0
  # Makefile for bootconfig command
306b69dce   Masami Hiramatsu   bootconfig: Suppo...
3
  include ../scripts/Makefile.include
950313ebf   Masami Hiramatsu   tools: bootconfig...
4
5
  
  bindir ?= /usr/bin
306b69dce   Masami Hiramatsu   bootconfig: Suppo...
6
7
8
9
  ifeq ($(srctree),)
  srctree := $(patsubst %/,%,$(dir $(CURDIR)))
  srctree := $(patsubst %/,%,$(dir $(srctree)))
  endif
950313ebf   Masami Hiramatsu   tools: bootconfig...
10

306b69dce   Masami Hiramatsu   bootconfig: Suppo...
11
12
  LIBSRC = $(srctree)/lib/bootconfig.c $(srctree)/include/linux/bootconfig.h
  CFLAGS = -Wall -g -I$(CURDIR)/include
950313ebf   Masami Hiramatsu   tools: bootconfig...
13

306b69dce   Masami Hiramatsu   bootconfig: Suppo...
14
15
  ALL_TARGETS := bootconfig
  ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
950313ebf   Masami Hiramatsu   tools: bootconfig...
16

306b69dce   Masami Hiramatsu   bootconfig: Suppo...
17
18
19
  all: $(ALL_PROGRAMS)
  
  $(OUTPUT)bootconfig: main.c $(LIBSRC)
950313ebf   Masami Hiramatsu   tools: bootconfig...
20
  	$(CC) $(filter %.c,$^) $(CFLAGS) -o $@
306b69dce   Masami Hiramatsu   bootconfig: Suppo...
21
22
  test: $(ALL_PROGRAMS) test-bootconfig.sh
  	./test-bootconfig.sh $(OUTPUT)
950313ebf   Masami Hiramatsu   tools: bootconfig...
23

306b69dce   Masami Hiramatsu   bootconfig: Suppo...
24
25
  install: $(ALL_PROGRAMS)
  	install $(OUTPUT)bootconfig $(DESTDIR)$(bindir)
081c65360   Masami Hiramatsu   tools: bootconfig...
26

950313ebf   Masami Hiramatsu   tools: bootconfig...
27
  clean:
306b69dce   Masami Hiramatsu   bootconfig: Suppo...
28
  	$(RM) -f $(OUTPUT)*.o $(ALL_PROGRAMS)