Skip to content

Commit

Permalink
libxdp: Move hard-coded -DLIBXDP_STATIC=1 compiler flag into a new
Browse files Browse the repository at this point in the history
variable called STATIC_CFLAGS inline with the SHARED_CFLAGS variable
to improve Makefile consistency.

Signed-off-by: Alasdair McWilliam <[email protected]>
  • Loading branch information
ajmmm authored and tohojo committed Oct 20, 2023
1 parent 1df4bcb commit 1dc1e78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/libxdp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ MAN_FILES := $(MAN_PAGE)
TEST_DIR := tests

SHARED_CFLAGS += -fPIC -DSHARED
STATIC_CFLAGS += -D LIBXDP_STATIC=1
LIB_HEADERS := $(wildcard $(HEADER_DIR)/xdp/*.h)
BPF_HEADERS := $(wildcard $(HEADER_DIR)/bpf/*.h) $(wildcard $(HEADER_DIR)/xdp/*.h)
EXTRA_LIB_DEPS := $(OBJECT_LIBBPF) $(LIBMK) $(LIB_OBJS) $(LIB_HEADERS) compat.h libxdp_internal.h xsk_def_xdp_prog.h bpf_instr.h
Expand Down Expand Up @@ -86,7 +87,7 @@ $(SHARED_OBJDIR):
$(Q)mkdir -p $(SHARED_OBJDIR)

$(STATIC_OBJDIR)/%.o: %.c $(EXTRA_LIB_DEPS) | $(STATIC_OBJDIR)
$(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) -D LIBXDP_STATIC=1 -Wall -I../../headers -c $< -o $@
$(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(STATIC_CFLAGS) -Wall -I../../headers -c $< -o $@

$(SHARED_OBJDIR)/%.o: %.c $(EXTRA_LIB_DEPS) | $(SHARED_OBJDIR)
$(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(SHARED_CFLAGS) -Wall -I../../headers -c $< -o $@
Expand Down

0 comments on commit 1dc1e78

Please sign in to comment.