2 ## Makefile for nvram utility
4 ## (C) 2005-2008 coresystems GmbH
5 ## written by Stefan Reinauer <stepan@coresystems.de>
7 ## SPDX-License-Identifier: GPL-2.0-only
12 INSTALL
= /usr
/bin
/env
install
14 CFLAGS
= -O2
-g
-Wall
-Wextra
-Wmissing-prototypes
-I.
-DCMOS_HAL
=1
17 CLI_OBJS
= cli
/nvramtool.o cli
/opts.o
19 OBJS
= cmos_lowlevel.o cmos_ops.o common.o compute_ip_checksum.o \
20 hexdump.o input_file.o layout.o accessors
/layout-common.o accessors
/layout-text.o accessors
/layout-bin.o lbtable.o \
21 reg_expr.o cbfs.o accessors
/cmos-hw-unix.o accessors
/cmos-mem.o
25 OS_ARCH
= $(shell uname
)
26 ifeq ($(OS_ARCH
), Darwin
)
27 LDFLAGS
= -framework DirectHW
29 ifeq ($(OS_ARCH
),$(filter $(OS_ARCH
),NetBSD OpenBSD
))
30 LDFLAGS
= -l
$(shell uname
-p
)
32 ifeq ($(shell uname
-o
2>/dev
/null
), Cygwin
)
40 $(CC
) -o
$(PROGRAM
) $(OBJS
) $(LDFLAGS
) $(CFLAGS
)
43 rm -f
$(PROGRAM
) $(OBJS
) junit.xml
49 @
$(CC
) -MM
-MG
*.c
> .dependencies
52 mkdir
-p
$(DESTDIR
)$(PREFIX
)/sbin
53 $(INSTALL
) $(PROGRAM
) $(DESTDIR
)$(PREFIX
)/sbin
54 mkdir
-p
$(DESTDIR
)$(PREFIX
)/share
/man
/man8
55 $(INSTALL
) -p
-m644 cli
/$(PROGRAM
).8 $(DESTDIR
)$(PREFIX
)/share
/man
/man8
57 .PHONY
: all clean distclean dep
59 -include .dependencies