arch/arm64: Support FEAT_CCIDX
[coreboot2.git] / util / ectool / Makefile
bloba90773e5c6b0577f3523ed530bfeb6d3c2427c68
1 ## SPDX-License-Identifier: GPL-2.0-only
3 CC ?= gcc
4 WERROR=-Werror
5 CFLAGS = -O2 -Wall -Wextra -Wshadow $(WERROR)
6 PROGRAM = ectool
7 INSTALL ?= /usr/bin/env install
8 PREFIX ?= /usr/local
9 OS_ARCH ?= $(shell uname)
11 ifeq ($(shell uname -o 2>/dev/null), Cygwin)
12 LDFLAGS = -lioperm
13 endif
15 ifeq ($(OS_ARCH), $(filter $(OS_ARCH), NetBSD OpenBSD))
16 LDFLAGS = -l$(shell uname -p)
17 endif
19 all: $(PROGRAM)
21 $(PROGRAM): ec.o ectool.o
22 $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
24 install: $(PROGRAM)
25 $(INSTALL) -d $(DESTDIR)$(PREFIX)/sbin
26 $(INSTALL) $(PROGRAM) $(DESTDIR)$(PREFIX)/sbin
28 clean:
29 rm -f *.o $(PROGRAM) junit.xml
31 distclean: clean
33 %.o: %.c
34 $(CC) $(CFLAGS) -c $^ -I. -o $@
36 help:
37 @echo "${PROGRAM}: Dump RAM of Embedded Controller (EC)"
38 @echo "Targets: all, clean, distclean, help, install"
39 @echo "To disable warnings as errors, run make as:"
40 @echo " make all WERROR=\"\""
42 .PHONY: all clean distclean help install