mirror of
https://github.com/netdata/libbpf.git
synced 2026-03-26 03:09:07 +08:00
add a simple Makefile to build and clean up
add missing macros, static inline functions, etc. add README to illustrate the purpose of this repo. Signed-off-by: Yonghong Song <yhs@fb.com>
This commit is contained in:
23
src/Makefile
Normal file
23
src/Makefile
Normal file
@@ -0,0 +1,23 @@
|
||||
# SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
|
||||
|
||||
TOPDIR = ..
|
||||
INCLUDES = -I. -I$(TOPDIR)/include -I$(TOPDIR)/include/uapi
|
||||
CFLAGS = $(INCLUDES) -O2 -Werror -Wall
|
||||
|
||||
FEATURE_REALLOCARRAY := $(shell $(TOPDIR)/scripts/check-reallocarray.sh)
|
||||
ifneq ($(FEATURE_REALLOCARRAY),)
|
||||
CFLAGS += -DCOMPAT_NEED_REALLOCARRAY
|
||||
endif
|
||||
|
||||
OBJFILES = bpf.o btf.o libbpf.o libbpf_errno.o netlink.o nlattr.o str_error.o
|
||||
|
||||
all: libbpf.a
|
||||
|
||||
libbpf.a: $(OBJFILES)
|
||||
/bin/rm -f $@; /bin/ar rcs $@ $^
|
||||
|
||||
%.o: %.c
|
||||
gcc $(CFLAGS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
/bin/rm -f libbpf.a $(OBJFILES)
|
||||
Reference in New Issue
Block a user