2 ## SPDX-License-Identifier: GPL-2.0-only
5 TOP ?
= $(abspath ..
/..
)
7 COMMONLIB
= $(ROOT
)/commonlib
8 CC ?
= $(CROSS_COMPILE
)gcc
9 INSTALL ?
= /usr
/bin
/env
install
13 CFLAGS
+= -Wall
-Wextra
-Wmissing-prototypes
-Wshadow
$(WERROR
)
14 CPPFLAGS
+= -I .
-I
$(ROOT
)/commonlib
/include -I
$(ROOT
)/commonlib
/bsd
/include
15 CPPFLAGS
+= -include $(ROOT
)/commonlib
/bsd
/include/commonlib
/bsd
/compiler.h
17 OBJS
= $(PROGRAM
).o
$(COMMONLIB
)/bsd
/ipchksum.o
24 rm -f
$(PROGRAM
) $(OBJS
:.c
=.o
) .dependencies
*~ junit.xml
27 $(INSTALL
) -d
$(DESTDIR
)$(PREFIX
)/sbin
/
28 $(INSTALL
) cbmem
$(DESTDIR
)$(PREFIX
)/sbin
/
33 @
$(CC
) $(CFLAGS
) $(CPPFLAGS
) -MM
*.c
> .dependencies
36 @echo
"${PROGRAM}: View machine's cbmem contents"
37 @echo
"Targets: all, clean, distclean, help, install"
38 @echo
"To disable warnings as errors, run make as:"
39 @echo
" make all WERROR=\"\""
41 .PHONY
: all clean distclean install help
43 -include .dependencies