| 1 |
# SPDX-License-Identifier: GPL-2.0 |
| 2 |
include ../config.mk |
| 3 |
|
| 4 |
CFLAGS += -fPIC |
| 5 |
|
| 6 |
UTILOBJ = utils.o utils_math.o rt_names.o ll_map.o ll_types.o ll_proto.o ll_addr.o \ |
| 7 |
inet_proto.o namespace.o json_writer.o json_print.o json_print_math.o \ |
| 8 |
names.o color.o bpf_legacy.o bpf_glue.o exec.o fs.o cg_map.o \ |
| 9 |
ppp_proto.o bridge.o sha1.o escape.o |
| 10 |
|
| 11 |
ifeq ($(HAVE_ELF),y) |
| 12 |
ifeq ($(HAVE_LIBBPF),y) |
| 13 |
UTILOBJ += bpf_libbpf.o |
| 14 |
endif |
| 15 |
endif |
| 16 |
|
| 17 |
ifneq ($(HAVE_SELINUX),y) |
| 18 |
UTILOBJ += selinux.o |
| 19 |
endif |
| 20 |
|
| 21 |
NLOBJ=libgenl.o libnetlink.o |
| 22 |
ifeq ($(HAVE_MNL),y) |
| 23 |
NLOBJ += mnl_utils.o mnlg.o |
| 24 |
endif |
| 25 |
|
| 26 |
all: libnetlink.a libutil.a |
| 27 |
|
| 28 |
libnetlink.a: $(NLOBJ) |
| 29 |
$(QUIET_AR)$(AR) rcs $@ $^ |
| 30 |
|
| 31 |
libutil.a: $(UTILOBJ) $(ADDLIB) |
| 32 |
$(QUIET_AR)$(AR) rcs $@ $^ |
| 33 |
|
| 34 |
install: |
| 35 |
|
| 36 |
clean: |
| 37 |
rm -f $(NLOBJ) $(UTILOBJ) $(ADDLIB) libnetlink.a libutil.a |