From 17c3d4a82d04f6711c876bc9a7cd9fb80646e27a Mon Sep 17 00:00:00 2001 From: Alessandro Gario Date: Thu, 16 Jun 2022 18:40:49 +0200 Subject: [PATCH] make: Add missing ubpf_config.h generator --- vm/Makefile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/vm/Makefile b/vm/Makefile index 788810c3..616bc9ed 100644 --- a/vm/Makefile +++ b/vm/Makefile @@ -35,7 +35,11 @@ endif all: libubpf.a libubpf.so test -ubpf_jit_x86_64.o: ubpf_jit_x86_64.c ubpf_jit_x86_64.h +ubpf_jit_x86_64.o: ubpf_config.h ubpf_jit_x86_64.c ubpf_jit_x86_64.h + +ubpf_vm.o: ubpf_config.h + +test.o: ubpf_config.h libubpf.a: ubpf_vm.o ubpf_jit_arm64.o ubpf_jit_x86_64.o ubpf_loader.o ubpf_jit.o ar rc $@ $^ @@ -43,14 +47,19 @@ libubpf.a: ubpf_vm.o ubpf_jit_arm64.o ubpf_jit_x86_64.o ubpf_loader.o ubpf_jit.o libubpf.so: ubpf_vm.o ubpf_jit_x86_64.o ubpf_loader.o $(CC) -shared -o $@ $^ $(LDLIBS) +.PHONY: ubpf_config.h +ubpf_config.h: + echo '#define UBPF_HAS_ELF_H 1' > "inc/ubpf_config.h" + test: test.o libubpf.a -install: +install: all $(INSTALL) -d $(DESTDIR)$(PREFIX)/lib $(INSTALL) -m 644 libubpf.a $(DESTDIR)$(PREFIX)/lib $(INSTALL) -m 644 libubpf.so $(DESTDIR)$(PREFIX)/lib $(INSTALL) -d $(DESTDIR)$(PREFIX)/include $(INSTALL) -m 644 inc/ubpf.h $(DESTDIR)$(PREFIX)/include + $(INSTALL) -m 644 inc/ubpf_config.h $(DESTDIR)$(PREFIX)/include clean: - rm -f test libubpf.a libubpf.so *.o + rm -f test libubpf.a libubpf.so *.o inc/ubpf_config.h