Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0
0002 # Makefile for bootconfig command
0003 include ../scripts/Makefile.include
0004 
0005 bindir ?= /usr/bin
0006 
0007 ifeq ($(srctree),)
0008 srctree := $(patsubst %/,%,$(dir $(CURDIR)))
0009 srctree := $(patsubst %/,%,$(dir $(srctree)))
0010 endif
0011 
0012 LIBSRC = $(srctree)/lib/bootconfig.c $(srctree)/include/linux/bootconfig.h
0013 CFLAGS = -Wall -g -I$(CURDIR)/include
0014 
0015 ALL_TARGETS := bootconfig
0016 ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
0017 
0018 all: $(ALL_PROGRAMS) test
0019 
0020 $(OUTPUT)bootconfig: main.c include/linux/bootconfig.h $(LIBSRC)
0021         $(CC) $(filter %.c,$^) $(CFLAGS) -o $@
0022 
0023 test: $(ALL_PROGRAMS) test-bootconfig.sh
0024         ./test-bootconfig.sh $(OUTPUT)
0025 
0026 install: $(ALL_PROGRAMS)
0027         install $(OUTPUT)bootconfig $(DESTDIR)$(bindir)
0028 
0029 clean:
0030         $(RM) -f $(OUTPUT)*.o $(ALL_PROGRAMS)